$ sudo vi /etc/mysql/mysql.conf.d/reset-mysql-password.cnf
[mysqld]
skip-grant-tables
$ sudo mysqld_safe --skip-grant-tables &
$ mysql -u root
mysql > UPDATE mysql.user SET authentication_string=null WHERE User='root';
mysql > FLUSH PRIVILEGES;
mysql > exit
$ mysql -u root
mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';
mysql > FLUSH PRIVILEGES;
sudo rm /etc/mysql/mysql.conf.d/reset-mysql-password.cnf
$ mysql -u root
mysql >
No comments:
Post a Comment