mariadb won’t let me access from “remote”

Posted on

Question :

I have one Linux computer(CentOS7.4) as server, one windows computer. I have setup the mariadb server. On windows, I use mysql-workbench as client.

enter image description here

However, I can access the server via ‘tcp/ip over ssh’, but when I connect using ‘tcp/ip’ I get 10060 error.
enter image description here

By the way, I can ping, it seems the network is ok. Therefore, what’s wrong with my setting?

three things to check

  1. the user and host:

enter image description here

  1. and 3. the settings file in /etc/my.cnf:
    enter image description here

  2. server.cnf

enter image description here

  1. mysqld
    enter image description here

  2. bind-adress and skip-networking
    enter image description here

Answer :

Four things to check:

  1. Check that the DB user allows for connecting from the remote client. A user has a both a ‘user’ and a ‘host’ component. SELECT user, host FROM mysql.user; will show your users including their hosts, i.e. the clients they allow. You can use the wildcard ‘%’ to allow connecting from any client, or a specific IP address or hostname if you prefer that.
  2. Make sure that the skip-networking variable is not enabled in the configuration files.
  3. Make sure bind-address is either not enabled or pointing to a specific IP address you want to allow in the configuration files.

Once you have updated the configuration files, restart MariaDB.

Check the MariaDB documentation on configuring for remote client access for details.

  1. Make sure the firewall on CentOS isn’t blocking access:

    sudo firewall-cmd --zone=public --permanent --add-service=mysql

    sudo systemctl restart firewalld

Leave a Reply

Your email address will not be published. Required fields are marked *