##停止mysql服务
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
##进入mysql
# mysql -u root mysql
#重新设置root的密码
mysql> UPDATE user SET Password=PASSWORD(“newpassword”) where USER=“root”;
mysql> FLUSH PRIVILEGES;
mysql> quit
#启动mysql服务
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新密码newpassword>
mysql> quit
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)总结
最新推荐文章于 2024-09-18 19:46:30 发布