1. 程式人生 > >ubuntu安裝mysql沒有輸入密碼,無法登入問題

ubuntu安裝mysql沒有輸入密碼,無法登入問題

sudo vim /etc/mysql/debian.cnf

 

預設的登入名和密碼就是上面的debian-sys-maint,先使用這個登陸上去修改root的密碼

update mysql.user set authentication_string=PASSWORD('haojunjie'), plugin='mysql_native_password' where user='root';

然後重啟msyql即可登入    service mysql restart 即可登入