lxg Veteran
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Wed Dec 26, 2012 1:07 am Post subject: |
|
|
On the server, set the value of bind-address to your network interface's IP address, and make sure that skip-networking is not active. Restart the mysql server.
On the client side, connect with the following command: mysql -h hostname -u username -p
The user must have the permission to connect from your hostname, so if you GRANTed the user permissions as user@localhost, you must once again GRANT them as user@your.client.host.name, or without a hostname at all (potentiall dangerous).
Be aware that having a MySQL server listening to a public network interface may be a security threat. If you know that you only connect from certain clients, make sure to set up IPtables rules which allows access to port 3306 (MySQL's standard port) only from the clients in question.
I personally don't let MySQL listen on public NICs, I always SSH to the machine first, and then open MySQL locally. A VPN may also be an adequate solution, if you want to use remote management software for MySQL. _________________ lxg.de – codebits and tech talk |
|