1. 程式人生 > >ubuntu安裝mysql未設定密碼

ubuntu安裝mysql未設定密碼

開啟 /etc/mysql debian.cnf
裡面會有賬號密碼 使用登入 修改密碼。

進入之後執行sql語句

use mysql;
// 下面這句命令有點長,請注意。
update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password"; 
flush privileges;
quit;

root的密碼設定為root

參照地址