Connect MySql Database From remote machine

Ideal place for discussions related to Linux/Windows server security, Apache, MySQL, MS SQL and PHP, including tutorials and questions.
hr-ethadmin
Site Admin
Posts: 67
Joined: Fri May 31, 2013 1:04 pm

Connect MySql Database From remote machine

Postby hr-ethadmin » Sat Jun 01, 2013 11:11 am

Connect MySql Database From remote machine

Many times (Web/Desktop)Application developers need to connect to MySql database server hosted on remote cPanel server to be accessed from their desktop.

Here are the instructions to connect to MySql Database from remote Machine.

=> Enable Connection to Remote Host


- Login to cPanel of the domain
- Go to 'Remote MySql'
- At 'Remote Database Access Hosts'
- add access host IP (i.e. IP of the machine from which database has to be accessed)
- Click on 'Add Host' to finish.

=> Configuration

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

=> What if local machine has dynamic IP

- Simpy put '%'(percentage mark) in Add Access Host to allow access from any remote IP.
- Allow subnet only 215.26.%.% (This may be useful if machines having remote access to
Database belongs to same Subnet/ISP).

=> 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.

*Your IP may need to be allowed the access to 3306 port in the firewall of the server.

Return to “System Security”

Who is online

Users browsing this forum: No registered users and 1 guest