1、sudo gedit /etc/my.cnf
2、加入
skip-grant-tables
3、直接登录,输密码时回车
mysql -u root -p
4、修改密码
use mysql;
update mysql.user set authentication_string=password('zhuxiaoyong1212') where user='root' ;
5、退出重启mysql
sudo service mysql restart;
1、sudo gedit /etc/my.cnf
2、加入
skip-grant-tables
3、直接登录,输密码时回车
mysql -u root -p
4、修改密码
use mysql;
update mysql.user set authentication_string=password('zhuxiaoyong1212') where user='root' ;
5、退出重启mysql
sudo service mysql restart;