Web Hosting Talk







View Full Version : php mysql


babak
07-27-2002, 08:52 AM
Hi

I always conect to mysql using "localhost", but how do you conect from an nother server to mysql?

TNX.

Regards,
Babak

S2 Web Design
07-27-2002, 09:27 AM
You'll need to ask your host if they allow remote connections to your mysql databases and then they will need to set it up on their end. If you have root access to the machine, then the following command will be helpful:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER on database_name.* to user_name@'host_connecting_from' identified by 'password';

If you want to allow remote connections from anywhere with a username/password, replace host_connecting_from with '%'.

apollo
07-27-2002, 12:55 PM
plus, you should check if mysql default port is not blocked by a firewall. The default MySQL port is 3306