情况

  1. 用户名和密码确定正确
  2. 普通用户也已经授权并刷新了权限
  3. 服务器也重启过
  4. 端口也没被占用

这样一来,肯定是因为限制了访问来源了。

解决

打开配置文件

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

注释本地绑定 bind-address

[mysqld]
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
log-error       = /var/log/mysql/error.log
# By default we only accept connections from localhost
#bind-address    = 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

再次连接成功!

留言评论
推荐阅读