mysql issues

So there are 2 domains with the same name but 1 is for english and the other for swiss german.

One is .com and the other is .ch - For the .com we enabled mysql and when we try to enable it for the .ch we get a error that there is already a database by that name because both names are common to the TLD.

Follow ?

If such a error happens VM should ask for a new name to use instead of refusing to enable mysql. I know you can set it so that a default database isn't created but this isn't the point here.

Status: 
Closed (fixed)

Comments

Virtualmin should already handle this, by using DB names like foo for foo.com , and foo_ch for foo.ch.

What database names did it pick and try in your case?

It's a user name error....

Failed to modify server : A MySQL user named open-source-host already exists

Ok, so it is really a username clash. Don't the .com and .ch domains have a different admin usernames though? Because that is what determines the MySQL username.

Both are different...

Administration username open-source-hosting.ch Administration group open-source-hosting.ch

Administration username open-source-hosting.com Administration group open-source-hosting.com

Ok, I see the problem now .. MySQL has a 16-character limit on usernames, and open-source-hosting.ch and open-source-hosting.com are both the same when truncated to 16 characters :-(

Normally this isn't an issue, as domains like example.com and example.net are typically owned by the same login (one is a sub-server of the other), and so share the same MySQL login.

However, there is a quick work-around - edit the file under /etc/webmin/virtual-server/domains/ for the server without MySQL enabled, and add a line like :

mysql_user=someothername

Then re-try enabling the MySQL feature.

Ok that worked.. Guess you will need to create a new input line to ask for a new username when this happens ?

Yes, I will do that.

Automatically closed -- issue fixed for 2 weeks with no activity.

I have just had the same problem, I think.

bankhousebooks.co.uk already exists

Tried to create bankhousebooks.com as a seperate virtual server, and got an error :

mysql user bankhousebooks.c already exists

Couldn't find a way around it :(

lewisjenkins - The work-around is to select a different admin username on the domain creation form, one which doesn't have the same first 16 characters as one of your existing domains.

Does that help?

Automatically closed -- issue fixed for 2 weeks with no activity.