MySQL user/passwords - BUG?

jamie471

Verified User
Joined
Apr 12, 2005
Messages
12
Location
United Kingdom
When directadmin creates a database for a user for the first time, it creates a login for phpMyAdmin with their DA username but with the password of the database. Also, when a new database is added with a different password, the password of their DA username login for mysql is changed again.

Is this a bug in the way DA creates the mysql accounts? I have a number of people adding new databases, each of which has a different password and they ideally want to be able to login to phpMyAdmin via their DA user/pass. Is there a way of changing this so that whenever a new database is added or a password changed on one, that DA will update the user's main mysql account with their DA password and not the new database password?

This is the only minor problem (bug?) I have come across within DA itself and I take my hat off to the guys who produced such a good control panel. If they can fix this for me though I will be over the moon :)
 
jamie471 said:
When directadmin creates a database for a user for the first time, it creates a login for phpMyAdmin with their DA username but with the password of the database. Also, when a new database is added with a different password, the password of their DA username login for mysql is changed again.

Is this a bug in the way DA creates the mysql accounts? I have a number of people adding new databases, each of which has a different password and they ideally want to be able to login to phpMyAdmin via their DA user/pass. Is there a way of changing this so that whenever a new database is added or a password changed on one, that DA will update the user's main mysql account with their DA password and not the new database password?

This is the only minor problem (bug?) I have come across within DA itself and I take my hat off to the guys who produced such a good control panel. If they can fix this for me though I will be over the moon :)

When you create a database, the username and database names takes the form of:

DAUSERNAME_name

the password is your own,

When you need to login to a specific database (let say only admin_banners) you will need to enter the username of that database and password..

Now if you want to view all databases you have, just access it via:

http://www.SITENAME.com/phpmyadmin/ (can also be used to access only specific databases) ..

and use DA username/password..

Hope it helps,

Peace,
 
What I dont understand is why the login for phpMyAdmin isnt created the same as the DA_user and DA_pass. That way they would be able to manage ALL of their databases from the one login. However, instead of using the DA_pass, it uses the password you selected for the LAST database you either created or changed the password on which is idiotic in my opinion. No other control panel does this and it is causing quite a few problems with CPanel converts.

What I want to do is make it set the phpMyAdmin login to DA_user and DA_pass EVERYTIME that a database user is added/removed. Is this possible, and if so, how do I go about doing it ?
 
it may be possible via a custom script, if there is such a script, database creation script so instead of using the inputted username/password it will use the username/password stored in directadmin. What isnt possible is having it predefined in phpmyadmin since mysql works on its own auth system and it has to be created when the database is made.
 
Where are the usernames/passwords stored for the DA users? Im free for the next hour or so so I might go have a play and try and put a script together for it. I dont know why it isnt like this as default in DA though?
 
I'm just not seeing this behavior.

For example, create a DA user called "mysqltest" and a password of "dapass". Then, create a database called "mysqltest_test1" with the username "mysqltest_test1" and password of "test1pass".

You should now be able to login to phpmyadmin with either of these login/pass combinations.

Then, create a database called "mysqltest_test2" with the username of "mysqltest_test2" and a password of "test2pass".

You should now be able to login with any of these credentials. If you login as mysqltest_test1, you will only have access to the mysqltest_test1 database, same with test2, but if you login with the DA username/password, you'll have access to both databases.

That's the expected behavior AFAIK.
 
ballyn said:
I'm just not seeing this behavior.

For example, create a DA user called "mysqltest" and a password of "dapass". Then, create a database called "mysqltest_test1" with the username "mysqltest_test1" and password of "test1pass".

You should now be able to login to phpmyadmin with either of these login/pass combinations.

Then, create a database called "mysqltest_test2" with the username of "mysqltest_test2" and a password of "test2pass".

You should now be able to login with any of these credentials. If you login as mysqltest_test1, you will only have access to the mysqltest_test1 database, same with test2, but if you login with the DA username/password, you'll have access to both databases.

That's the expected behavior AFAIK.

and thats exactly how things work out for me?

thats what I was trying to explain.

Peace,
 
The login for phpMyAdmin with the DA username (ie say: mydomain) should be with the same password as the password for the DA account. It doesnt do this though and sets it to whatever you set the password on the newest database to.

IE:

I create my first database with password password1. DA login to phpMyAdmin has password password1.

I then create a second database with password2. DA login to phpMyAdmin is now password2.

Why cant it just set the password for phpMyAdmin to whatever the DA password is like almost every other control panel that exists does? With it changing passwords on it everytime a new database is added I have had people emailing me constantly asking why their login doesnt work any more. Its like buying a new car and only the keys for the new car will work in the old one all of a sudden.
 
Hello,

Here's a clarification on how it works.
Assumption, DA username is bob.

1) You've got a new DA account. There are no logins in mysql yet.
2) You create your first database. The database name will be bob_db. You set the username to be bob_user.

At this point you'll have 2 logins for bob_db. One will be bob_user, the other will be "bob".

Every time a new database is added, DA set the password for "bob" in mysql to match the password for "bob" in DA. This is because the code used to add "bob" to the new database also sets up the password for "bob", it won't hurt anything setting's bob's password multiple times, because it should always match the "bob" username for DA.

So all databases that bob creates should be able to use "bob" as the login.

On a side note, avoid using the "login-as" feature for doing this. If admin uses the login-as feature to login to bob's account, DA won't know what bob's password is, thus won't setup "bob"on any new database that are created under bob's account (by admin).

John
 
This is because the code used to add "bob" to the new database also sets up the password for "bob", it won't hurt anything setting's bob's password multiple times, because it should always match the "bob" username for DA.

That is exactly what is not happening. The password for bob changes every time and does not match the bob account for DA.

That is where the confusion comes in. The bob user login for phpmyadmin should have the same password as his DA login.

EDIT: If it helps, I am running CentOS 3.4, and the latest version of DA.

I cannot see it being a problem with MySQL or for that matter phpMyAdmin as both are working fine. I believe the problem is in the DA script for setting the mysql passwords.
 
Last edited:
When you logged in, did you log in as the user with the user password, or as admin or reseller with the the "admin|username" or "reseller|username" construct and the admin or reseller password?

Jeff
 
I have tried it with both logins. I first signed in with the user level account which I used to create the database with and couldnt figure out why it wouldnt login to phpmyadmin with the same user/password.

Since then I have logged in as the admin/admin password and attempted to do the same and couldn't get it to login either.

I noticed the password for the phpmyadmin is the same as the database and not the same as the DA login for the user when I logged in under the da_admin account and looked at the user table for mysql. The hashed password for their DA login was the same as the one for their database password.
 
Interesting I didnt know DA login credentials work for all databases created by that user.
 
Back
Top