MariaDB Warning: "root @localhost" has both ... Password will be ignored

I installed MariaDB on Ubuntu LTS 16.04. Then i ran

/usr/bin/mysql_secure_installation 

and set the root password. Access to the database through mysql -u root -p works fine. But checking the status with service mysql status opens a log file with this warning:

 [Warning] 'user' entry ' root@localhost ' has both a password and an authentication plugin specified. The password will be ignored. 

Questions:

  • Is it a concern or completely normal?
  • If it bothers, how can I fix it?
+5
source share
1 answer

This is normal if, when you say "access to the database through mysql -u root -p works fine", you mean that you start it as a system root (or under sudo ). You should not do this as a regular user.

Packages created by Ubuntu by default have unix_socket authentication for the local root. To check, run

 SELECT user, host, plugin FROM mysql.user; 

You should see unix_socket in the plugin column for root@localhost .

If you want to use password authentication, run

 UPDATE mysql.user SET plugin = '' WHERE plugin = 'unix_socket'; FLUSH PRIVILEGES; 
+10
source

Source: https://habr.com/ru/post/1266791/


All Articles