How to login into phpMyAdmin as Admin

Johnws2022

Verified User
Joined
Jan 14, 2022
Messages
96
Hi,

I would like to create a database in phpMyAdmin instead of being inside DA control panel so that I can select database collation and chipset based on individual website.

With user login thereare no privileges to create databases in phpMyAdmin.

How to login into phpMyAdmin as Admin? Where its credentials are located?

Appreciate any help.
 
There are 2 kinds of admin.
Admin from Directadmin, or da_admin account of mysql, which is the same as the mysql root account.
This is used to create other databases and users.

You can find the credentials in botht he /usr/local/directadmin/conf/my.cnf and /usr/local/directadmin/conf/mysql.conf files.
 
Hello,

Appreciate any help.

In a case you did not know:

Here how can you change a database collation after its creation:

SQL:
ALTER DATABASE <database_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

Here how can you change a table collation after its creation:

SQL:
ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
 
There are 2 kinds of admin.
Admin from Directadmin, or da_admin account of mysql, which is the same as the mysql root account.
This is used to create other databases and users.

You can find the credentials in botht he /usr/local/directadmin/conf/my.cnf and /usr/local/directadmin/conf/mysql.conf files.
thanks, they are there.

After accessing phpMyAdmin using da_admin credentials, I am no longer able to import database via SSH even a database is created inside DA Control panel. Here is the error when importing a database via SSH:

ERROR 1045 (28000): Access denied for user 'admin_dbusername'@'localhost' (using password: YES)


How can reset this phpMyAdmin back to DA default so that I can import database via SSH which is much quicker than via phpMyAdmin.

Many thanks
 
Last edited:
I have tried to solve the above problems with links here:


and


to reset root password of mysql without a success, I decided to reinstall my vps server; that is the easiest way.

Update: After reinstalling a new vps server, the error above came up again when importing a DB via SSH. This is a DA bug because this error is generated when I created DB username different from DB name. When they are the same, no such error.

DA's bug!

Can DA please help fix it.

Many thanks
 
Last edited:
ERROR 1045 (28000): Access denied for user 'admin_dbusername'@'localhost' (using password: YES)
Well that is odd. I don't know how you are trying to work, but this should be da_admin@localhost and not admin_dbusername@localhost.

As far as I know there is no bug. There is a username, for example foobar. So the databasename always will have this part in the databasename.
For example foobar_dbname is a databasename then.

When importing the database for foobar via SSH, it's done like this:
mysql -ufoobar_uname -p dbname < /path/to/the/backup.sql
or if you are using root then:
mysql -uroot -p dbname < /path/to/the/backup.sql
where dbname is the dbname of foobar.
When using da_admin you can use -uda_admin for it.

Ofcourse the -p will prompt you for the appropriate password.

This all works without any issues, so there is no bug as far as I'm aware of. Seems to me you're using a wrong command if you get an admin_dbusername@localhost as error notice.
 
Last edited:
Hi Richard,

You are very helpful.

I can confirm this is a DA's bug. I have been working with DA for over 3 years at least, and I always import databases via SSH with the following command:

mysql -p -u admin_dbusername admin_dbname < imported_database.sql

Example:

mysql -p -u admin_foo1 admin_foo2 < imported_database.sql - there is error like above

mysql -p -u admin_foo1 admin_foo1 < imported_database.sql - no error

When the strings of both db name and db username are the same created inside DA's Control Panel, there is no error with issuing the above command. If they are different, the error as mentioned above is generated. I have not tested much, but with newly installed server, there should be no error with importing a db via SSH.

Can you test that please?

Cheers
 
Last edited:
mysql -p -u admin_foo1 admin_foo2 < imported_database.sql - there is error like above
Ah now I understand how you ment this. You are only using the admin account. And this way you are restoring several databases from admin and you have a seperate admin databaseusername. I thought you used the admin name to restore a users database. I just misunderstood the "dbusername" in this case.

I corrected it to make more clear in my previous post in the example. For a user it's indeed user_uname like in your example admin_foo1.

Back to your issue.
Can you test that please?
Maybe later if I have time. Have you tried the same in Enhanced skin? Because I don't use Evo.
And in Enhanced there is always the option to either create a new db username or use the existing one, when creating a new database.
 
Oke I just tested. Created 2 databases as admin. Being admin_test1 and admin_test2 via the DA panel.
The database username is also admin_test1. So just as in your example, only the second database is named otherwise.

Then I tried restoring via SSH and as you can see, no issue at all.
1717518788278.png


1717518861334.png


Since I can't reproduce, it might not be a bug. Maybe best send in a ticket for your issue.
 
Oke I just tested. Created 2 databases as admin. Being admin_test1 and admin_test2 via the DA panel.
The database username is also admin_test1. So just as in your example, only the second database is named otherwise.

Then I tried restoring via SSH and as you can see, no issue at all.
View attachment 8090

View attachment 8091

Since I can't reproduce, it might not be a bug. Maybe best send in a ticket for your issue.
Thanks. Yesterday there was such error on old server after I accesssed phpMyAdmin with da_admin credentials - I thought because of da_admin. Then on new server, while importing a database to that of one of my main sites, same error was generated 3 times till I made both strings be the same.

I ll try to test that again soon when I am available.
 
Update: I have a chance to test what said above, and can confirm that there is no errors described above when using different strings for DB's name and DB username.

Sorry for this false alarm!
 
Back
Top