Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am configuring mysql for my server, but I have one question: Is it possible for each domain to see their own mysql server, but only having to run one service at the server? I want to keep all databases for the domains separated, but I don't want to have to prefix each database name.

eg: suppose I have domain1.com and a domain2.com running on the same server. For both domains I want a database called statistics. If I want to do this now, I'll have to prefix the databases, so there are two databases: domain1_statistics and domain2_statistics, and the domains can only access their own databases. But I want to create 2 databases called statistics, one for each domain, so that each domain only sees its own statistics database. Is this possible?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can only achieve this if you run multiple servers (on different ports) with mysqld-multi

share|improve this answer
    
It isn't possible to create virtual servers or something like that? Multiple instances would probably create a large overhead... –  Tiddo Mar 28 '11 at 13:16
    
Unfortunately, no. –  Bart De Vos Mar 28 '11 at 21:16

You cannot have multiple databases with the same name in one mysql server instance. I would suggest merging the statistics tables into the domain's own database. Otherwise, you could prefix the tables for each domain within 1 statistics database. Which method you use depends on how and who you want to be able to access the statistics data

share|improve this answer
    
ok tx, the statistics database was just an example, but I have my answer now! –  Tiddo Mar 28 '11 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.