sudo mysql -u root -pmysql
將root用戶受權給因此鏈接: grant all privileges on . to 'root'@'%' identified by 'xxxxxx'; 最後一個爲mysql密碼 讓權限當即生效:flush privileges;sql