原因:權限的問題
解決辦法
grant all privileges on *.* to 'root'@'ip地址' identified by 'mysql 密碼';
如果是本地登錄:
grant all privileges on *.* to 'root'@'localhost' identified by 'mysql 密碼';
開放權限給所有ip設定root登陸:
grant all privileges on *.* to 'root'@'%' identified by 'mysql 密碼';
最後:
flush privileges;