ubuntu下安装了mysql后,发现却无法以root登录。
提示: access denied for user root @localhost
是因为auth_socket的验证类型引起的。
首先 sudo gedit /etc/mysql/deblan.cnf
然后使用 里面的帐号 密码登录
mysql -u debian-sys-maint -p
use mysql
update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost'; 把密码改成123456
flush privileges;
quit 退出