sql >> Base de Datos >  >> RDS >> Mysql

¿Cómo restablecer la contraseña de root en MySQL 8.0.11?

como aquí dice:

1. Si está en modo skip-grant-tables
en mysqld_safe:

UPDATE mysql.user SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
exit;

y luego, en la terminal:

mysql -u root

en mysql:

ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';

2.no en modo skip-grant-tables
solo en mysql:

ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';