简体   繁体   English

无法连接远程mysql数据库

[英]No able to connect remote mysql database

I'm trying to connect on my mysql database when I'm not on localhost - on localhost it's working. 当我不在localhost上时,我正在尝试在mysql数据库上进行连接-在localhost上它正在工作。 Everytime I wish to connect, I don't have any error, but only a timeout exec... 每次我想连接时,我都没有任何错误,但是只有一个超时执行程序...

Here is what I've done so far 这是我到目前为止所做的

  • create a user on mysql who can access to any hosts("%") 在mysql上创建一个可以访问任何主机的用户(“%”)
  • purge the iptables 清除iptables
  • my port 3306 is opened (see screenshot) 我的端口3306已打开(请参见屏幕截图)
  • the bind-address line is 0.0.0.0 in the mysqld.cnf file - I even tried to put in it comment - please note my.cnf sends to the mysqld.cnf file. mysqld.cnf文件中的bind-address行为0.0.0.0-我什至尝试在其中添加注释-请注意my.cnf发送到mysqld.cnf文件。
  • of course for every modification I've restarted the mysql server - and the server itself... 当然,对于每次修改,我都重新启动了mysql服务器-以及服务器本身...
  • no firewall are setup... 没有设置防火墙...

在此处输入图片说明

I'm on Ubuntu 16.04 LTS, mysql and phpmyadmin are setup on it. 我在Ubuntu 16.04 LTS上,已在上面安装mysql和phpmyadmin。

What I'm missing ? 我想念什么? Thank you for your help Bastien 谢谢您的帮助Bastien

After you changed the bind address you restarted with systemctl restart mysql.service , yes? 更改绑定地址后,使用systemctl restart mysql.service启动,然后systemctl restart mysql.service ,可以吗?

Here's a very similar situation, try following all of these steps: Remote Connections Mysql Ubuntu 这是一种非常相似的情况,请尝试执行以下所有步骤: 远程连接Mysql Ubuntu

I think the flush privileges step will be a help to you. 我认为冲洗特权步骤将为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM