Have been playing with a LAMP setup learning a bit of php. Now i want to add data to a database from another machine. MySQL is running, and listening on port 3306, if i telnet to it from the box using 'localhost' i get a reply. However i can't get at it using it's IP from this or any other machine. I'm guessing i need to add an iptables rule to open up the port or something? Can anyone confirm that this is the case and give me a hint on how i go about it?
TIA
Check the access rules for the user your attempting to connect to mysql with. It's probably set to only allow access to localhost.
Easiest way to fix it is with phpmyadmin rather than mysqladmin (if you have it). Also you should allow access only on a per host basis (rather than anywhere) if possible, for security.
Hmm... it was set to only access from localhost however changing it didn't solve the problem. Even before authentication the port doesn't appear to accessable though so there's something stopping it getting even that far.
If you set the host to '%' then that means anywhere. It will rule it out as being the cause. Obviously this isn't very secure though.
Ah got it. I had forgotten to set the bind address in my.cnf. It defaults to 127.0.0.1. Thanks anyway Geoff.
![]()
You beat me to it, i left it as 127.0.0.1 and it had me for ages, setting it to 0.0.0.0 solved it!
There are currently 1 users browsing this thread. (0 members and 1 guests)