Knowledge Essentials - 3Essentials Hosting

Can I have 1 database accessible by 2 domains?

Article ID: 138

 Back to Search

Question: If I host 2 domains with 3Essentials, but have 1 database that I need accessible by both domains, is this possible?

Answer

  • MySQL databases: Yes
  • MS SQL databases: Yes
  • MS Access databases: No

Why not for MS Access databases?  

This is because MS Access uses Windows NTFS permissions to restrict access... an MS Access database is simply a file with permissions. So, if you have two domain's, domainA.com and domainB.com, and you place the db mydb.mdb into domainA.com's hosting space, only domainA.com's "hosting user" can access it. Files within domainA.com are only accessible by your domainA.com "hosting user", and files within domainB.com are only accessible by domainB.com's "hosting user". The is same security that keeps your domain hosting space secured from another customer on the same server, and it applies the same here.

However, if you simply upgrade your database to either MySQL or MS SQL, you do not have this problem. Security for MySQL or MSSQL databases is handled within the database server engines, i.e., you create a "db user" with each database. So in this scenario, you'd have:

  • A MySQL database "mydatabase" accessible with MySQL db user: username: "mydbuser" password: "mypassword"
    • the database can be created under either domainA or domainB, it doesn't matter, because access security for the domain is associated with the db username/pw, not the "hosting user" associated with the domain and file security.
  • domainA.com, can access mysql, presents mydbuser/mypassword and accesses "mydatabase"
  • domainB.com, can access mysql, presents mydbuser/mypassword and accesses "mydatabase"

You will probably find this same exact answer from any shared hosting provider, since the limitation is due to the nature of MS Access security... and any time you have multiple customers on a server (shared hosting), you have to isolate via security permissions in this fashion, and most shared hosting providers take a similar approach to this.

Some other observations: 

  • most of our plans include at least 1 MySQL database
  •  
  • Additionally, MySQL and MS SQL databases provide extremely better performance in a web application environment than an MS Access database. MS Access is fine if you have a small application with not a lot of users and changes, but if your web site is growing, you'd be wise to move to MySQL or MS SQL soon to head off performance problems before you start to experience them.
Although we don't assist with converting your db from Access to MySQL or MSSQL, I believe a quick yahoo/google search will result in numerous articles that show how quickly it can be done.
 
Downloads Associated With This Article
No downloads are currently associated with this article.