September 3rd, 2000, 06:48 PM
$db = mysql_connect("localhost","username","password");
How would I rewrite this connect statement if I were trying to connect to the database from a different host?
Meaning, the current db is on www.webpage.com , the above connect statement would be placed on www.adifferentwebpage.com. Seems like this would be a simple task, but I can't find anything in my documentation.
September 3rd, 2000, 07:16 PM
$db = mysql_connect('www.otherserver.com','username,'password');
Make sure that you set the permissions IN Mysql
September 3rd, 2000, 07:21 PM
Maybe that is the problem. I tried the proper syntax you listed, and the page timed out.
How do I configure MySQL to accept remote queries?
September 3rd, 2000, 07:24 PM
hmmm, i forget... I'll look it up for you.
September 4th, 2000, 09:44 AM
grant (ALL | specific permissions ) on *.* to username@% identified by 'password'
*.* is in the format dbname.tablename. if you want to grant permission to all DBs/tables then leave it as *.*, if all tables of a specific Db then use dbname.*
The % character is a wildcard for the remote client (where the user will be connecting from). If they'll be connecting from multiple locations leave it a % (this is not very secure, tho). Else supply the hostname (valid domain name or IP address).