8

It looks like I can not login to MySQL (actually MariaDB) as root user anymore in Ubuntu 15.04 (I upgraded from 14.04 via 14.10)

I already tried to reset the password.

What is working, is sudo mysql - but I want to login as root from an other user using mysql -uroot -p. When I create a new user with full rights and password, it is working.

Was there something changed?

Alex
  • 1,062

1 Answers1

6

So you've gone from version 5.5.44-1ubuntu0.14.04.1 to 10.0.20-0ubuntu0.15.04.1. Sounds scarier than it is, that's just what they called 5.6 for some reason.

It seems that newer versions of MariaDB have added a plugin to the user table to force authentication through a fixed path. In this case, the root database user is forced through the unix_socket plugin. This also seems to be known as auth_socket in some circles.

Anyway this plugin restricts things so only the system root user can log in as the database root, with no password. It's a security choice they've made.

You can revert this by blanking the plugin field for the root user:

shell$ sudo mysql -u root

[mysql] use mysql;
[mysql] update user set plugin='' where User='root';
[mysql] flush privileges;

A specified password should work after this. I'm not sure how advisable this is though.

Oli
  • 299,380