Failed to create additional databases - MySQL

Nearly 1-2 weeks ago we recognise users can't create additional MySQL databases.

Error message: "Failed to create database : Missing or invalid database name - only letters, numbers and _ are allowed"

if we create a subserver database created well. If we use install scripts database created as well too.

Edit Databases -> Create a new database. -> here we can't create a database.

We use Prefix for additional databases: ${PREFIX}_

Users has got rights to create and they do not reach the database limits, i tried it with a master admin too and received the same error message.

And till now it's worked well. Maybe, nearly until the last upgrade?

Status: 
Closed (fixed)

Comments

What is the prefix set to for this domain? You can see it on the Edit Virtual Server page, in the "Mailbox name prefix" or "Mailbox name suffix" field.

Mailbox name suffix example.com (Used by 4 users) default DB name looks like: one472_example_com

Anyway we can't create new MySQL database to any domain. (not only to that one) It's only works if use install scripts or create a new subserver.

So your domain names perhaps start with a number? I just noticed a virtualmin bug in handling the DB name in this case.

The work-around is to change the "Prefix for additional databases" to something like :

db${PREFIX}_

Sorry i check a wrong server template. so the good details are: Prefix for additional databases: ${UID}_ Default database name: ${UID}_${PREFIX}

Till now it's worked perfect, webmin change to first number to text 1 -> one so the default DB name is: one472_example_com and additional databases are all start with one472_

Can we fix it somehow? We do not like change naming convention on the servers if not really necessary.

thanks

I can send you a fix if you like? Virtualmin 3.78 changed the way the DB name is calculated slightly, which caused numeric prefixes to not be handled properly anymore. But this will be fixed in the 3.79 release.

If you want an update to fix this, just let me know which linux distribution you are using, and if you have Virtualmin pro or GPL.

if 3.79 release is not really far we can wait that (~1 months) until that we can create the databases manually for the customers and associate them to the virtualserver with the Import Database feature. Only a few customer need 2. database for the virtual server, so not a critical issue.

thanks

It will certainly be less than a month .. so if you are happy waiting, I guess we can call this issue solved.

ok. That's good for us, thanks.