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?
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;
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;
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)
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.