vim /etc/my.cnf
找到[mysqld],在后面添加skip-grant-tables
[mysqld] skip-grant-tables
mysql -u root //进入user数据库 use user //查看root密码 select * from user;
04 Jul 2017