MySQL Forums
Forum List  »  MySQL Workbench

Re: Help connecting to a networked database
Posted by: Steve Richards
Date: January 10, 2015 12:38PM

I'm fairly new to Linux and MySQL myself really but I've recently been investigating a problem with remote access the other way round (Linux client and Windows server). You shouldn't need to open ports for access within your LAN - that's just a requirement if you want to be able to access it from outside. What you probably need to do is find your MySQL configuration file on the server (your Linux box) and comment out the line "bind-address = 127.0.0.1 by putting a hash symbol (#) at the start of the line. That should allow MySQL to accept remote connections. You will also have to make sure that the MySQL account that you're using allows connections from non-local machines. You can do that in Workbench by going to "Users and Privileges" and checking the "From Host" column of the User Accounts list. If it's something like "localhost" or "127.0.0.1" then it's restricted to the local machine. Changing it to "%" (the wildcard) should allow connections from anywhere (you might want to narrow it to your local LAN but you can look into that later). Restart your MySQL daemon (sudo /etc/init.d/mysql restart does it for me - could be different for your Linux distro).

To test access you can try accessing from the command line. Open a "command prompt" window on your Windows box and navigate to your MySQL program directory (e.g. cd "\Program Files\MySql\bin"). Then issue a mysql command, supplying arguments containing your Linux box as the hostname, the username (e.g. root) and password e.g.

mysql -hyourwinboxname -uroot -pfoobar

(Note that there are no spaces between the option flags (-h, -u, -p) and their values.)

You should either get an error message indicating that something's not right, or a "mysql>" prompt indicating that you're in.

Hope that helps. I just tried opening my Linux instance to my Windows machine using this approach and it worked, but apologies if I've got something wrong and it doesn't work for you.

Good luck.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Help connecting to a networked database
621
January 10, 2015 12:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.