MYSQL: Cambiar password

  • Ingresamos con
sudo mysql
  • Creamos usuario
CREATE USER 'sigetic'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'Remoto_BAS_0';

GRANT ALL PRIVILEGES ON bd_sis_sada_sigetic.* TO 'sigetic'@'localhost';
  • Alter
GRANT USAGE ON *.* TO 'remoto'@'localhost' IDENTIFIED BY 'Remoto_BAS_0';
SET PASSWORD FOR 'remoto'@'localhost' = PASSWORD('Remoto_BAS_0');

ALTER USER 'remoto'@'localhost' IDENTIFIED BY 'Remoto_BAS_0';

ERROR: [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: »mysql_native_password’ is deprecated and will be removed in a future release. Please use caching_sha2_password instead’

  • Verificar quienes lo utilizan
SELECT user, host, plugin FROM mysql.user WHERE plugin = 'mysql_native_password';

SELECT user, host, plugin FROM mysql.user WHERE plugin = 'caching_sha2_password';
  • Eliminar usuario
DROP USER 'remoto'@'localhost';
GRANT SYSTEM_USER ON *.* TO 'root'@'%';

ALTER USER 'remoto'@'%' IDENTIFIED WITH 'caching_sha2_password' BY 'Remoto_BAS_0';

ALTER USER 'root'@'%' IDENTIFIED WITH 'caching_sha2_password' BY 'Hefesto_BAS_0';

REVOKE SYSTEM_USER ON *.* FROM 'root'@'%';

exit