ABHIONLINUX
Site useful for linux administration and web hosting

2009/11/16

How to connect mysql from remote server

mysql -u root -p -h

where remote server = remote server ip address
To enable MySQL to listen to remote connections, you must find your my.cnf file.

find / -name 'my.cnf'

(the global 'my.cnf is' likely to be /etc but it may be found in other places)

Open the file, and put a # in front of skip-networking or bind-address=127.0.0.1

Example of end result:

1. skip-networking

or

1. bind-address = 127.0.0.1


Also check for any firewall stopping port 3306

Restart MySQL and everything should work fine.

Don't forget to grant users access from remote hosts.

No comments:

Post a Comment