MySQL remote access

Hi, we have a java newsletter manager which uses MySQL as a database. When the application runs on the localhost it works but we need to access the database from other clients in the local area network.

I found this line on a website… bind-address = {server ip}

I have done this, and restarted mysql but no luck so far. I have installed MySQL using YAST. What could be the problem? Does openSUSE 11.2 use a firewall in the default desktop edition? Thanks

Thanks :slight_smile:

Yes. Firewall. Yast -> Security and Users -> Firewall -> Allowed Services. Open port for MySQL server.

Hope this helps. :slight_smile:

Well, not only do you have to check the firewall, but also the GRANTs in MySQL. Usually when apps need a DB, the instructions say to run a command like:

GRANT ALL ON somedatabase.* TO someuser@localhost IDENTIFIED BY ‘somepassword’;

Obviously that will only allow localhost clients to connect. You have to add another GRANT for someuser@<ip address of client> or someuser@’%’ for all remote clients. You have to try it from the client with the mysql command line utility. No response means firewall blocking. Connection rejected means no authorisation.

You shouldn’t need to change the listen directive. It should listen on all interfaces by default. In fact if you change that to listen only on the server’s IP,. then it will not be listening on 127.0.0.1. However localhost as a MySQL hostname actually means the Unix socket, so you may not notice it’s not listening on 127.0.0.1.

Hi!

It’s working now :wink: thanks for your prompt replies! The openSUSE community never fails to impress me! Thanks again!!

Regards,
Samuel

BTW… the problem was both the firewall and the user permissions.