0

I have a password secured mariadb server on an Ubuntu 18.04 server. I can log in at the command line using

mysql -u root -p with my password.

But when I go to https://myserver.com/phpmyadmin/index.php` I can not log in as root. This is the error I see:

#1698 - Access denied for user 'root'@'localhost'
 mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'

I am definitely using the same password I use on the command line.

I can log in as user phpmyadmin with the password I entered during dpkg-reconfigure phpmyadmin.

stone.212
  • 121

1 Answers1

2

@Søren gave an important link that is very close but not exactly the same:

Cannot enter phpmyadmin as root (MySQL 5.7)

The answer is: root user can not log in at phpmyadmin interface, so root privileges must be given to another user (ex phpmyadmin user).

The actual answer that worked was not marked as correct on that page. It was given by @Hemamalini and it is:

CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Tested on Ubuntu 18.04 PHP 7.2 PHPMyAdmin 4.6.6

stone.212
  • 121