Is it possible to use one MySQL DB by 2+ sites in one hosting account (CPanel, reseller)? If it's possible what should i do and how should i connect to DB? Tnanks in advance.
jatar_k
4:05 pm on Aug 10, 2004 (gmt 0)
If they are in the same account does that mean they both have access to the same db? If you log into your site with ftp and they are both in the same area, then I would think you could use the same mysql_connect data in each site and it should work.
The best advice is to try it out. :)
Just use the same user/pass and then try connecting to mysql.
JasonHamilton
4:26 pm on Aug 10, 2004 (gmt 0)
even if the accounts are on different servers, as long as mysql can be connected to by a remote machine, it should not be an issue
GreenLeaf
4:36 pm on Aug 10, 2004 (gmt 0)
Thanks! Should i use 'localhost' or something else?
JasonHamilton
4:36 pm on Aug 10, 2004 (gmt 0)
the remote site would have to use the ip address of the sql database server. if both are on the same machine, use localhost.
GreenLeaf
4:48 pm on Aug 10, 2004 (gmt 0)
Thanks a lot!
ergophobe
5:25 pm on Aug 11, 2004 (gmt 0)
Also, if the sites are not sharing a set of tables (in which case, why two sites?), come up with a prefix schema for your tables. So you have tables
site1_users site1_other_table
site2_users site2_other table
JasonHamilton
11:59 pm on Aug 29, 2004 (gmt 0)
I'd rather keep everything the same, and have the connection random which server it uses.