2

I install mysql and phpmyadmin and in installation phpmyadmin i add config password is root but in connection with user is root and password is root i have this error

screenshot

1 Answer 1

3

I think the reason of the problem is that in Ubuntu 18.04 the default authentication method for the MySQL's root user is socket authentication. For example within the command line you can login as root by using sudo mysql instead of mysql -u'root' -p.

You can switch to mysql_native_password or even better you can create another user for web login and grant all privileges to this user. So let's assume the user you want to create is named webroot - you can create it by the following commands:

$ sudo mysql
mysql> CREATE USER 'webroot'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_strong_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'webroot'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> exit;

References:

1
  • You are welcome, @dev2019!
    – pa4080
    Sep 14, 2019 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .