mysql cannot connect!

作者: 抓不住的风 | 来源:发表于2015-05-29 20:51 被阅读43次

mysql cannot connect!

1.Start the mysql server instance or daemon with the --skip-grant-tables option. (security setting)

$ mysqld --skip-grant-tables
2.Then Execute these statements.

$ mysql -u root mysql
$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;
3.Finally, restart the instance/daemon without the --skip-grant-tables option.

$ /etc/init.d/mysql restart
4.You should be able to connect with your new password.

$ mysql -u root -p
Enter password: my_password

相关文章

网友评论

    本文标题:mysql cannot connect!

    本文链接:https://www.haomeiwen.com/subject/axorqttx.html