VDS Sphera Knowledge Base

Main / Browse Categories / MySQL / How can I setup a remote connection to MySQL?

Print article Print Article    Email article Email Article

How can I setup a remote connection to MySQL?
To remotely connect to your MySQL databases, you must have an I.P.-based account. Login to your control panel and click on the side menu "ValueApps" then the "Database" tab. If you have not installed MySQL, click on "MySQL Database" under Available ValueApps. If you have already installed MySQL, click on "MySQLs" under Installed ValueApps. Check the box "TCP/IP Connection". Now login to your account via SSH.

Use the MySQL monitor to grant privileges.

Start the MySQL monitor with this command:

mysql
or:
/usr/local/mysql/bin/mysql
Your shell prompt should now look like this:
mysql>

Run this command:

GRANT ALL PRIVILEGES ON *.* TO USERNAME@IP IDENTIFIED BY "PASSWORD";
USERNAME is the username that you would like to create.
IP is the public IP address of your remote connection. See examples
PASSWORD is the password you would like to use for this username.

You now must flush MySQL's privileges. Run this command:

FLUSH PRIVILEGES;

Run this command to exit MySQL:

exit;

You can find your I.P. address by visiting these sites(opens a new window):

http://www.whatismyip.com
http://www.whatismyipaddress.net
http://www.showmyip.com
http://www.ipchicken.com

Host IP examples:

I.P. address or Host value of your remote Internet connection Username Connections matched by entry
corp.domain.com john john, connecting to remote MySQL server from corp.domain.com
corp.domain.com Any user, connecting to remote MySQL server from corp.domain.com
% john john, connecting from any host
% Any user, connecting from any host
%.domain.com john john, connecting to remote MySQL server from any host in the domain.com domain
133.155.177.199 john john, connecting to remote MySQL server from the host with IP address 133.155.177.199
133.155.177.% john john, connecting to remote MySQL server from any host in the 133.155.177 class C subnet
133.155.177.0/255.255.255.0 john Same as previous example

User Comments
How can I setup a remote connection to MySQL?  
There are no user comments for this topic.
 

Attachments
No attachments.

Related Articles
 How can I connect to MySQL using SSH?
 How can I dump a MySQL database from the command line?
 My Disk Quota is unusually high. What can I do?
 Where is MySQL located?
 Where is the MySQL log file?

Why Choose Our Hosting?

Continue reading »

Featured Hosting Plan


Learn more about our VPS Extreme

What is Included?

  • PHP 5/MySQL 5
  • Plesk Control Panel
  • Unique IP Address
  • SAS Hardware Raid diskspace
  • CentOS 5 x86_64 bit
  • Multi-homed Tier 1 Bandwidth
  • Full Upgrade capabilities
Continue reading »