To configure remote database access for cPanel, allowing a host with a wildcard (%), you would typically follow these steps:
-
Login to cPanel:
-
Use your cPanel account credentials to log in.
-
-
Access MySQL Database Section:
-
In the Databases section of cPanel, click on MySQL Databases.
-
-
Add a Remote Host:
-
Under the Remote MySQL section, you can add a host that can connect remotely to the database.
-
In the Host field, enter
%to allow connections from any IP address or specify a particular host or IP range. For example:-
%allows any IP to connect. -
192.168.1.%allows any IP in the192.168.1.*range.
-
-
-
Create a Database User:
-
In the MySQL Databases section, create a new user or use an existing user. Ensure that the user has access to the database that you want to allow remote access to.
-
-
Grant Privileges to the User:
-
In the MySQL Databases section, scroll down to the Add User to Database section.
-
Select the user and database, then assign the appropriate privileges (e.g., All Privileges).
-
-
Update MySQL Configuration:
-
Make sure that your MySQL server is configured to allow remote connections. You may need to modify the MySQL configuration file (
my.cnf) to bind MySQL to an external IP (or0.0.0.0to listen on all IP addresses). -
Add or ensure the following line is in your MySQL configuration (
my.cnformy.ini):bind-address = 0.0.0.0
-
-
Restart MySQL:
-
After making the necessary changes, restart the MySQL service to apply them.
-
-
Check Firewall:
-
Ensure that your server’s firewall allows inbound traffic to MySQL port (default: 3306).
-
Notes:
-
The
%wildcard in MySQL allows any host to connect. It’s a quick method for allowing broad access, but you should consider security risks and limit access where possible (e.g., restricting to specific IP ranges or addresses). -
You may need to ensure that remote MySQL connections are supported in your hosting plan.
