Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted
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.
Posted
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.
Posted

Ah got it. I had forgotten to set the bind address in my.cnf. It defaults to 127.0.0.1. Thanks anyway Geoff.

 

:)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...