Como recuperar a senha do root

Edite o arquivo my.cnf conforme abaixo:

[mysqld]

skip-grant-tables=on

Reinicie o mysql-server

Acesse o mysql sem senha execute o comando abaixo:

update user set plugin="mysql_native_password" where User="root";
FLUSH PRIVILEGES;
ALTER USER "root"@"localhost" IDENTIFIED BY 'root';
FLUSH PRIVILEGES;

Reverta a alteração excluindo o “skip-grant-tables=on”

[mysqld]

skip-grant-tables=on

Reinicie o mysql-server

 
dic_recuperar_senha_mysqlserver.txt · Última modificação: 2019/11/08 13:06 por admin
 
Exceto onde for informado ao contrário, o conteúdo neste wiki está sob a seguinte licença:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki