- and _ are not allowed in creating Databases?

galacnet

Verified User
Joined
Jan 17, 2006
Messages
25
In relation to my pervious post at http://www.directadmin.com/forum/showthread.php?t=21366

I found the problem to it being that I wanted to create a database with a - or _

eg.
testing_db
testing-db

if I want to create "testing-db" system prints out the db as "testing-db" but when creating the database it returns with an error.

if I want to create "testing_db" system prints out the db as "testing_db" but creates the database as "testingdb".

Has anyone encountered before as well?
Without the - or _ my script runs smoothly without problems...
 
Hello,

The _ character won't be allowed for a few reasons.
1) the naming system in DA already uses username_dbname, so a 2nd one may cause confusion
2) the _ character is a wildcard character, similar to * .. so if DA were to do a lookup on your database, it might come up with any database that fits that wildcard, not the expected result.

Past that DA only allows a-zA-Z0-9, so the - character wouldn't fall into the list, thus you'd get the error.

John
 
Why wouldn't you allow "-" as part of the database-name, when it is allowed by MySQL?

Is there a way to work around this problem?

I have alot of existing databases with "-" in them, that I'm in the process of converting into DA, and changing their names would be an extremely huge job, as I would need to replace all occurences of the database-name in all scripts that uses it.

Please advice.
 
I've added dash "-" support for the next release.
It basically entails ensuring that all database names are escaped correctly with `quotes`... to prevent mysql from complaining.

John
 
Thats good news :) Since my posting, I have gotten around the problem by using numbers instead of the - but it stopped me from shifting my existing sites over as I use - for quite a number of my free galleries.
 
Back
Top