cd /etc/mysql
sudo vim debian.cnf
復制 user 和 password
使用得到的u用戶名和p密碼,進入MySQL
mysql -uuser -ppassword
user mysql;
update mysql.user set authentication_string=password('mysql') where user='root';
此處設置用戶名:root 密碼:mysql
flush privileges;
quit