How to connect MySql Database from remote machine?

How to connect MySql Database from remote machine


Some time clients or their web developer/designer need to connect to MySql database server hosted on remote cPanel server to be accessed from their desktop.

Following are the steps to connect to MySql Database from remote Machine.

A. How to enable Connection to Remote Host

1. Login to cPanel of the domain
2. Go to ‘Remote MySql’
3. At ‘Remote Database Access Hosts’
4. Add access host IP (i.e. IP of the machine from which database has to
be accessed)
5. Click on ‘Add Host’ to finish.

B. Database configuration should me as follows:

Database Server = Server IP address
Database = cpanelusername_databasename
Database User = cpanelusername_databaseuser
Database Password = (what ever is set)
MySql Serverice Port no. = 3306

C. What if local machine has dynamic IP?

1. Simply put ‘%'(percentage mark) in Add Access Host to allow access from
any remote IP.
2. Allow subnet only 215.26.%.% (This may be useful if machines having
remote access to Database belongs to same Subnet/ISP).
3. It is recommended to have Static IP if remote connection to database
is permanent OR keep updating IP, if dynamic, into the access host list whenever it changes. This is secure way for remote connection and to avoid access to unwanted IPs.
4. Your IP may need to be allowed the access to 3306 port in the firewall
of the server.


Both comments and pings are currently closed.

Comments are closed.