Rich wrote:
Hi. Whenever I connect to a mysql database, I always connect to
'localhost'. Does that mean that you can connect to a database on
another host? If you can, does that mean that I could use the same
database for both of my websites (which are hosted with different
people)? And if you can, how please? I assume that I would have to
create another mysql user, but how would I connect to the database?
Thanks. Richard.
Richard,
You can, assuming the mysql database daemon is configured to allow remote
connections, and no firewall rules are preventing such a thing.
You will need to grant access to the databases for this host, assuming this
isn't already available. For example:
grant all on mydatabase.* to re********@192.168.1.1 identified by
somepassword;
You can now specify the ip address of this database server as the host for
any database applications.
Nathan