Troubleshooting Database Connection Issues

This article lists some reasons why you cannot connect to MariaDB remotely and shows you how to solve the remote database connection issues.

1> MariaDB service is not running.

2> DB user does not have correct password or permission.

3> Firewall restricts IP connection on the “Security” page.

4> Remote Connection issue between your local server to our MariaDB.

5> The MariaDB remote connection port is blocked by your server or ISP.

6> Wrong MariaDB connection information defined in application.

MariaDB service is not running

1) Please check the status on the “Overview” page of your application in the Control Panel.

2)Running the command “ps –ef” via shell interface to check the MariaDB status. The service is working if the result is as the following screenshot shows.

If the MariaDB service is not working, please use the shell tool in the Control Panel to check MariaDB logs. Inputting the command “cd log/”, then “ls -a”, followed by “vi mariadb_error.log” to open the log file.

DB user does not have correct password or permission

Open phpMyAdmin in the Control Panel and check the MariaDB User permission in phpMyAdmin.

1) If you cannot log in to MariaDB via phpMyAdmin and get the following error, the password of the database user might be wrong.

2) If a MariaDB user can log in to MariaDB via phpMyAdmin, please check if the user has remote connection permission in phpMyAdmin. The option ‘ % ’ means all hosts can connect to MariaDB user. While ‘127.0.0.1’ and ‘localhost’ mean the user does not support remote connection.

Firewall restricts IP connection on the “Security” Page

If you have enabled Firewall Rules under the “Security” tab, it will restrict the remote connection. Only the listed IPs will be allowed to connect to your application.

Solution:

  • You can add more allowed IPs to the Firewall(a maximum of 5 IPs or IP ranges).

  • Or you just stop the Firewall service to allow connections from all IPs.

Remote Connection issue between your local server to our MariaDB

We can use “ping” and “tracert” commands on your local computer to test the remote connection.

1. Use Ping to check the connection issue

Get the MariaDB package host IP on the Overview page in the Control Panel.

As our MariaDB server do not allow ping function. You can ping the gateway of the MariaDB package on local PC to test the connection between local PC and MariaDB server. If the result is like the following screenshot shows, it is normal. If it shows time out, please check your local network.

2. Use “Tracert” comamnd to check the connection issue

You can use the “tracert” command on most operation system to test the connection.

Mac / Linux:

Please run “yum -y install traceroute” or “apt-get install traceroute” install traceroute first.

1.Open a Terminal window.

2.Type "traceroute <mariadbhostip>" in the terminal and hit enter.

Windows:

1.Open the Start menu.

2.Click on Run.

3.Type "cmd" and press "OK" to open a command prompt.

4.Type "tracert <mariadbhostip>" and hit enter.

<mariadbhostip> should be filled in with your MariaDB hostname or host IP. If the result is like the following screenshot shows, it is normal. If the tracert process cannot complete, please check your local network.

The MariaDB remote connection port is blocked by your server or ISP

We can use telnet command to test if the port is blocked by your server or ISP.

For example:

If we want to test if the port 16258 is blocked, we can use “telnet <mariadbhostip> 16258” .

If the telnet command cannot be recognized on your local PC, please install a telnet client first.

To install a telnet client,

Windows server: https://social.technet.microsoft.com/wiki/contents/articles/38433.windows-10-enabling-telnet-client.aspx

Centos: # yum -y install telnet

Ubuntu & Debian: # apt-get install telnet

Wrong MariaDB connection information defined in the application

Please refer to the article “Connecting to MariaDB via Different Programming Languages” to check your database connection information in your codes.

Copyright © 2021 Cloud Clusters Inc.Revised on 05/31/2021

results matching ""

    No results matching ""