问题:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决步骤:
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
找到mysqld_safe 的进程ID, kill掉
#ps –ef|grep mysqld
#kill -9 ID
#kill -9 ID
# 重新启动:./mysqld_safe &
#登陆 mysql –u root -p