解决方案如下:
[root@localhost ~]
# mysql -u 数据库用户名 -p当前用户下密码
mysql> grant all privileges on *.* to '数据库用户名'@'%' identified by '当前用户下密码'
;
mysql>
flush privileges;
最后重启数据库就行!
centos6请使用:service mysql restart、或者service mysqld restart重启centos7请使用:systemctl mysql.service restart、或者systemctl mysqld.service restart重启
然后重新设置连接即可!
转载于:https://www.cnblogs.com/lyzaidxh/p/10729810.html