Yet another phpmyadmin unable to log in. Tried everything, please help

Hello friends.

Fresh install of Hestia 1.8.5 on Debian 11.7.

I can not log in to phpMyAdmin. I get the common error Unable to log in to root:

mysqli::real_connect(): (HY000/1698): Access denied for user ‘root’@‘localhost’

I tried to log in with the password from /usr/local/hestia/conf/mysql.conf file - didn’t work

After searching the forum I have tried creating the user and grant it full privileges - didn’t work.

mysql> CREATE USER 'newroot'@'localhost' IDENTIFIED BY 'some_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'newroot'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

I can create databases via Hestia db section.

Can you recommend a course of action aside from re-installing the panel?

Thank you.

Hello @someguy ,

Don’t use WITH GRANT OPTION when granting all privileges to your newroot user.

mysql> CREATE USER 'newroot'@'localhost' IDENTIFIED BY 'some_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'newroot'@'localhost';
mysql> FLUSH PRIVILEGES;

Cheers,
sahsanu

@sahsanu Thank you for reply. When trying your suggestion I get error

ERROR 1049 (42000): Unknown database 'PRIVILEGES'

So you use:

GRANT ALL PRIVILEGES ON *.* TO 'newroot'@'localhost';

And you get this error?

ERROR 1049 (42000): Unknown database 'PRIVILEGES'

That is really strange, indeed WITH GRANT OPTION should work too.

Login again to mysql, delete user and create it again:

mysql -uroot
mysql> DROP USER 'newroot'@'localhost';
mysql> CREATE USER 'newroot'@'localhost' IDENTIFIED BY 'some_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'newroot'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

And show the output of each command.

MariaDB [(none)]> DROP USER 'newroot'@'localhost';
ERROR 2006 (HY000): Server has gone away
No connection. Trying to reconnect...
Connection id:    35
Current database: *** NONE ***

ERROR 1396 (HY000): Operation DROP USER failed for 'newroot'@'localhost'
MariaDB [(none)]> CREATE USER 'newroot'@'localhost' IDENTIFIED BY 'some_password';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'newroot'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]>

Query executed ok but still unable to log in to phpmyadmin.

mysqli::real_connect(): (HY000/1045): Access denied for user 'newroot'@'localhost' (using password: YES)

But you are using newroot or new_root user?

1 Like

newroot

Thank you for your help. I made a typo when tried to log in with new_root instead of newroot. Then I tried to log in with newroot but did not restart the mariadb. After mariadb restart I was able to log in.
I had to restart mariadb.

Thank you @sahsanu for your help

1 Like

You are welcome. Using FLUSH PRIVILEGES should do the work, no need to restart MariaDB, anyways, if it is working now… we are happy :wink:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.