PSA: Empty mysql root password for Ubuntu 16.04 LTS

Today, I was trying out the new release, and then I ran into a wall: logging in to mysql didn’t work, even though I was sure that I’d configured it correctly; i.e. root with an empty password.

I’d done this hundreds of times already, so I was sure it’d work, but then again, it just didn’t. So I tried to reset the root password by killing mysql and then starting mysql_safe with a new password. In the past, this process has worked successfully, but then I kept getting the message that mysql_safe has ended; i.e. not good.

I left things as-is for awhile, before thinking to read the manual (RTM):-

Password behaviour when the MySQL root password is empty has changed. Packaging now enables socket authentication when the MySQL root password is empty. This means that a non-root user can’t log in as the MySQL root user with an empty password. For details, see the NEWS file.

Tldr: Non-root *nix users can no longer login as MySQL root, so just use sudo root.

p.s. Sudo is not the answer to everything. The trick here is knowing why: an upstream change.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s