MySQL在Ubuntu的登录问题


登录MySQL问题:

检查MySQL服务有没有开启/etc/init.d/mysql start

mysql -u root -p

输入密码之后,错误提示如下:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES),意思是root的密码不正确。

解决办法如下:
a.sudo mysqld_safe --user=root --skip-grant-tables --skip-networking &
输入命令之后,如果提示信息为:
mysqld_safe A mysqld process already exists
 
表示mysqld_safe进程存在,可以通过
ps -A|grep mysql 查看mysqld_safe进程ID
kill -9 -xxxx            终结ID为xxxx的进程

相关内容