Fork me on GitHub

CentOS初始化Mysql5.7密码

/etc/init.d/mysql stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql


update user set authentication_string=password('123456') where user='root';
FLUSH PRIVILEGES;
exit;


/etc/init.d/mysql restart
mysql -uroot -p
Enter password: 123456

mysql>

 

出现上面mysql> 说明成功!

 

posted @ 2015-12-14 22:28  磊哥|www.javacn.site  阅读(1937)  评论(0编辑  收藏  举报