Create MySQL database without user prefix

darko4spain@

New member
Joined
Feb 28, 2023
Messages
2
Hi .

I found this old threed from 2011 and I have the same problem.

Is anything changed from then? Can you please tell me how to change the db and user names to be without prefix, as we have lots of clients that are using this format and is near to imposible to change the configuration.

Thanks
 
Nothing changed yet. It's normal for panels like DA and CPanel for example, to use the usernames in the database name prefix.
Not in the database itself, only the names of the database and database user have this prefix.

Which problem is that prefix causing exactly for you or the user? In 2011 like now I don't understand why this could be required and I'm always curious to certain things. Like what those lots of clients using it that way with what?

P.s. thank you for creating a new thread about this instead of replying to an ancient thread! (y)(y)
 
Hi @Richard G

Thank you for the answer. Well, the problem is really simple. We were using Plesk for 10 years and there you can but DB and USER name what you like. We have software depoloid and mobil app that are used by 10K users, so now if we change to DirectAdmin, we have to change in every software (and there are lots of diferent once not one) and the connection our mobil app. The mobil app is specialy problematic as if we switch, we dont have in place "Force user to update" so until they manualy update in (if they ever update) it will be long time.

So in this moment there are two options. 1. Find a way to create at least 10 databases with the name and users like in the Plesk or 2. Dont use DA and return to Plesk.

I dont expect DA to add this feature for us :-) but if you have idea how we can do this so we start using this great panel I will be very grateful

Darko
 
Hello @darko4spain@
Thank you for your explanation, so I have an idea as to what is going on and where it's used for.
It's some time ago I worked with Plesk and I wasn't aware that with Plesk it was possible to choose db and dbuser name whatever you like.
Indeed switching to another panel can cause issues that way if you have a lot of external stuff going to connect to it like mobile apps.
Interesting option anyway.

In DA and in cPanel the username is always prefix. But in cPanel this can be disabled too for new databases.

I'm not aware of DA having such option. It has been asked about in 2007 and 2011. Since both other panels have it maybe it's possible to use a feedback request for it, but if you are in a hurry, that might not be a good choice for you.

Maybe @fln or @smtalk can provide you with a solution or workaround, if that is possible.
 
hi, I'm not sure this hook could edit variable or not


this is just idea, not for production ( Untesting ).

database_create_pre.sh
Code:
#!/bin/bash
replaceFrom="${user}_";
replaceInto="";
export database=${database/$replaceFrom/$replaceInto};
exit 0;

something like this, maybe try remove string "user_" from database name before creating database
 
Back
Top