遇到此问题 一般是权限问题
修改权限即可
然后用grant命令下放权限。
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'root-password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO root@127.0.0.1 IDENTIFIED BY 'root-password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root-password' WITH GRANT OPTION;
例如:
GRANT ALL PRIVILEGES ON *.* TO root@'%' identified by '123456'
注意:自己根据情况修改以上命令中的 “用户”“ip地址”“密码”。