Change name of database

dangul

Verified User
Joined
Nov 17, 2008
Messages
34
Location
Sweden
Hi, is it possible to change the database name to something diffrent than ACCOUNT_XXX...
For example I have the account name "account1" and want database name somedatabase_one ?

In direct admin´s API there are only possibility to create databases like ACCOUNT_X

We are root so we can modify DirectAdmin configuration if we have to...

Thanks
Daniel
 
prefixing with the 'username' is done to preserve unique database names, so you'll find this convention used in all hosting control panels, so it isn't specific to DA.
 
prefixing with the 'username' is done to preserve unique database names, so you'll find this convention used in all hosting control panels, so it isn't specific to DA.
Plesk (sorry) lets you do it both ways.... but DA is better by far...

What I do on my sign up pages is to limit usernames to 8 characters, that way it minimises this MySQL limitations.
 
Yes, I know that but in DA they prefixing with account name and we want to prefixingwith domain name...
For example I have domain test.com my database should be test_com_1...

Is this hardcoded or can I modify this and if it is possible can I use the API also?

Thanks
Daniel
 
if you're using default skin, look at:

data/skins/default/user/db/db_create.html

and change |USERNAME| to |DOMAIN| where necessary

and see what happens when you then create
a new database.
 
Yes, I know that but in DA they prefixing with account name and we want to prefixingwith domain name...
For example I have domain test.com my database should be test_com_1...

You did not mention domain name in your first post.

The problem with that idea is that domain names can be very long and database names are limited to 16 characters. Your example of somedatabase_one just barely works. directadmin_com_1 would not work.
 
Yup I know that issue with database length, but we have to migrate x0 000 customers that already has the databasename like theirs domainname...

So it is impossible to create databases with another databasename like ACCOUNT_x in DA´s API?

//Daniel
 
but we have to migrate x0 000 customers

<sarcasm>Wow that's a lot</sarcasm>


You can create whatever databases you want. However DirectAdmin will not be able to manage them.

But if you already have a list of database names and users and passwords you can write a script to do the conversion. And would also link the old database name to the new database name so that nothing would have to be changed in the script. DirectAdmin will be able to see the databases under their new name and the customers' script could still use the old database name.

A better thing would be to actually change the database information in the scripts as well.

If you cannot write the script to do the conversion I can help you. But its not a free job.
 
Back
Top