-- =============================================================================
-- Script de uso pontual — recriar os 5 usuarios do newportaltefnet no MAMP local
-- =============================================================================
-- Referencia: docs/DTs/DT-0003-usuarios-tefnet-no-mamp-local.md
-- Status: NAO usado por padrao. Aplicar APENAS se houver necessidade real de
-- renderizar telas do newportaltefnet via Apache local.
--
-- Aplicar com:
--   mysql -h 127.0.0.1 -P 3306 -u root -proot < sql/dev/criar-usuarios-tefnet.sql
--
-- Reverter com:
--   sql/dev/dropar-usuarios-tefnet.sql
-- =============================================================================

CREATE USER IF NOT EXISTS 'tefnet_erp'@'localhost'        IDENTIFIED WITH mysql_native_password BY 'tefnet753951';
CREATE USER IF NOT EXISTS 'tefnet_fatstand'@'localhost'   IDENTIFIED WITH mysql_native_password BY 'tefnet753951';
CREATE USER IF NOT EXISTS 'tefnet_fatpremiu'@'localhost'  IDENTIFIED WITH mysql_native_password BY 'tefnet753951';
CREATE USER IF NOT EXISTS 'tefnet_xmlfatst'@'localhost'   IDENTIFIED WITH mysql_native_password BY 'tefnet753951';
CREATE USER IF NOT EXISTS 'tefnet_xmlfatpr'@'localhost'   IDENTIFIED WITH mysql_native_password BY 'tefnet753951';

GRANT ALL PRIVILEGES ON tefnet_erp.* TO 'tefnet_erp'@'localhost';
GRANT ALL PRIVILEGES ON tefnet_erp.* TO 'tefnet_fatstand'@'localhost';
GRANT ALL PRIVILEGES ON tefnet_erp.* TO 'tefnet_fatpremiu'@'localhost';
GRANT ALL PRIVILEGES ON tefnet_erp.* TO 'tefnet_xmlfatst'@'localhost';
GRANT ALL PRIVILEGES ON tefnet_erp.* TO 'tefnet_xmlfatpr'@'localhost';

FLUSH PRIVILEGES;

SELECT User, Host FROM mysql.user WHERE User LIKE 'tefnet_%' ORDER BY User;
