sudo mysqld_safe --skip-grant-tables&
sudo mysql --user=root mysql
mysql> update user set authentication_string=PASSWORD('new-password') where user='root';
flush privileges;
quit
sudo service mysql restart
sudo mysql -u root -p
exit
sudo mysql_secure_installation
网友评论