Search code examples
mysqlremote-accesswebmin

Connect to Mysql remotely in centos 6.x server LAMP


despite I've tried everything suggested in the forum I still can't connect to MySQL remotely. This is my my.cnf file:

[mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

I've tried also adding the line bind-address = 0.0.0.0 but still doesn't work. Then I deleted it because I've preferred leave the default configuration of my webserver and because I've read that, if is not specified, it is 0.0.0.0 by default.

I have the port 3306 open as you can see from my webmin module: Linux IPTables Firewall

I've created the MySQL account named 'michele' as you can see from my webimn module User Permissions

and also I granted to michele the permissions for any database Database Permissions

and granted to any host all permissions Host Permissions

To test my remote connection I'm trying to connect from MySQL for excel. that is the error error MySQL fro excel

It is impossible to stabilize the connection. Incorrect response of the connected party after the time interval or no response from the connected host MY-IP-SERVER:3306

Also I want to inform you that this is my second attempt to connect remotely. In my first I made it! For a problem that doesn't deal with the remote connection I needed to reinitialize my server and here I am.

The first time I remember that in some configuration file I've put # for comment some line but I don't remember which and if it deal with my problem. Please help me I'm going to be mad!

Michele


Solution

  • I made it! The problem was for the ipTable rule: REJECT reject with icmp-host-prohibited rule

    so for solve the problem I deleted it.

    on my server shell with root permission:

     # sudo iptables -L --line-numbers
    

    find the id rule and then deleted it:

     # sudo iptables -D INPUT 10