Controlling database access from the outside

By default, for security reasons, MySQL databases only allow connections coming directly from the web server (localhost). However, with the Remote MySQL feature, you can define exceptions – for example, for your local PC or an external application server.

Security Note: Whenever possible, only allow specific IP addresses. Avoid using the wildcard % (access from anywhere), as this represents a potential security risk for your data.

Adding a new access host

To allow an external device access, follow these steps:

  1. Determine your current public IP address (e.g., via "whatismyip.com").
  2. Enter this IP in the "Host" field.
  3. (Optional) Add a description in the "Comment" field (e.g., "Office PC Thomas") so you know who this access belongs to later.
  4. Click on "Add Host".
Pro Tip: You can use wildcards. 1.2.3.% allows access for the entire address range from 1.2.3.0 to 1.2.3.255. This is useful if your internet provider regularly assigns you new IPs from the same range.

Managing and deleting access hosts

In the list of allowed hosts, you can see all currently authorized addresses.

  • Change description: Update your comments at any time to maintain a clear overview.
  • Revoke access: Click "Delete" next to an entry to immediately block access for that host.

Common connection issues

If the connection fails despite the IP address being allowed, please check the following points:

Port 3306 Ensure that your local firewall (or your router's) allows outgoing connections on port 3306.
User Privileges The MySQL user must have been correctly assigned to the database in cPanel (see the article "Manage MySQL Databases").
Server Name Use either your domain or your web server's IP address as the hostname in your software.

Using a dynamic IP and don't want to manually whitelist it constantly?
Ask CURIAWEB Support about alternative solutions like access via an SSH tunnel!

Was this answer helpful? 1 Users Found This Useful (1 Votes)