Today I wanted to access my local sql-server hosted on PC1 (192.168.1.73) trough my laptop (PC2 @ 192.168.1.67). Here’s what happened…
So I started up wampserver, it’s my favorite apache-mysql-php all-in-one server I use to run my php creations on. When everything was running I started HeidiSQL, my favorite sql database editor, on my laptop, and fill in the settings needed to connect:
When I push the Open button, nothing happens for a minute, but then a popup appears:
- Is the MySQL server running?
- Does user firstname.lastname@example.org got rights to connect with MySQL server?
- Is the firewall allowing the connection?
I checked the first two points, those were OK! I was running the MySQL server and in PhpMyAdmin I checked to see that I have given myself enough rights to connect to the local MySQL server.
After this I checked to see if the firewall (on PC1) was the problem, in Windows 7 I did the following:
Start -> Control Panel -> System and Security -> Windows Firewall
Then in the menu on the left press: Allow a program or feature through Windows Firewall… it will show:
It’s easy to see that the MySQL server (mysqld.exe) isn’t added to the list, so lets add it!
To enable the Allow another program button press the Change settings button at the top of the window. Now press Allow another program, a popup jumps on the screen showing a list of program’s that you might want to add, but in my case, the MySQL server wasn’t in the list, so press Browse to manually search for it. Using WampServer 2 with default installation settings, your mysqld.exe is at “C:\wamp\bin\mysql\mysql5.1.36\bin\mysqld.exe”. After selecting the file press Open, followed by the Add button. The program is now added to the list shown above. You can decide for yourself whether you want both checkboxes checked. I recommend only checking the Private checkbox, since you don’t want anybody in a public network access yourMySQL server when you still haven’t set a password for the root account!!!
Now you should be able to succesfully access your local MySQL server from any computer in your local network!