For security reasons, Webmin doesn’t allow remote access to the MySQL database server.
What will you do, if you are away from your office network and need to instantly access your database?
Fortunately, the Webmin MySQL remote access allows you to access your database from different locations.
But, often wrong MySQL server settings or bad firewall cause problems with MySQL remote access.
At Bobcares, we often get requests from our customers set up MySQL remote access in Webmin as part of our Server Management Services.
Today, we’ll see how our Support Engineers set up MySQL remote access and fix the related errors.
How we set up Webmin MySQL remote access
Let’s see how our Support Engineers do it from Webmin control panel.
1. Firstly, we log into Webmin -> Servers -> MySQL Database Server -> MySQL Server Configuration, and set “MySQL server listening address” to “0.0.0.0”.
2. For any Virtual Server that should have remotely accessible databases, go into Edit Databases -> Remote Hosts, and add the IP address of the remote system there.
3. Setup firewall rule to allow MySQL port. Goto Webmin > Networking > Linux Firewall. If the rule does not exist, create the following rule: “If protocol is TCP and destination port is 3306” then accept.
Related issues and fixes
From our experience in managing server, we’ve seen that many customers had issues related to MySQL remote access in Webmin. Let’s take a look at the top problems and how we fix them.
Wrong firewall settings
Recently, one of our customers contacted us with a problem related to MySQL remote access. He got an error while connecting to the database as MySQL user abc_test. The exact error said: SQL Error (2003): Can’t connect to MySQL server on ‘X.X.X.X’.
On checking, we found that the server’s firewall was blocking his IP address.
Then, our Support Engineers fixed the issue by tweaking the settings in the firewall configuration file.
Again, the tweaking may depend on the different firewall used in servers such as UFW, CSF, etc.
Incorrect Mysql server settings
Similarly, often errors may occur due to incorrect Mysql server settings. For instance, one of the customer’s MySQL server was accepting connections only from local IP addresses. All the remote connections were failing.
Then our Support Engineers took the following steps to solve the issue.
1. First, we logged into Webmin control panel and selected Edit Databases -> Remote Hosts, and added the IP address for the various systems that want to remotely access MySQL.
2. MySQL doesn’t listen for external connections by default. Then we edited my.cnf file, set the “bind-address” to “0.0.0.0”.
3. At last, we restarted MySQL service.
In addition, we always make sure that –skip-networking in MySQL server settings is disabled. Otherwise, the rule will prohibit remote access to the MySQL database.
[Having trouble with MySQL remote access in Webmin. ? We’ll fix it for you.]
Conclusion
In short, Webmin allows you to access your database from different locations. However, wrong MySQL server settings or bad firewall cause issues. Today, we saw how our Support Engineers set up MySQL remote access in Webmin and solved related issues.
0 Comments