[EN] Solved: Error 1698 (28000) in MySQL/MariaDB

Der Artikel ist über 1 Jahr alt. Einige Inhalte können demnach veraltet sein. Bitte beachte dies beim Lesen des Artikels.
This is a translated and adapted version of the original article (German), published in July 2016.

Last year I installed the database server MariaDB on a Ubuntu Server 16.04 LTS using the command

The installation was successful but the installer didn’t ask me for any root password. Every login attempt failed and this error appeared:

The solution is quite easy and already explained here. In a nutshell: MariaDB on Ubuntu Server 16.04 uses the plugin „unix_socket“ for authentication. You have to authenticate using your Unix account (in other words: call the MySQL client using sudo).

Attention: the use of the following commands is at your own risk! Every computer system is different. I’m not responsible for any damage! I tested the commands on my system but I don’t know your system and dependency constellation. Please contact your system administrator for further information.

If you want to use e.g. phpMyAdmin and need plain authentication, you can deactivate this behavior:

  1. log in to your database server using sudo mysql -u root -p
  2. switch to the system database: use mysql;
  3. deactivate the plugin: UPDATE user SET plugin='' WHERE user='root';
  4. set a password for the database server root account UPDATE user SET password=PASSWORD('NEWPASSWORD') WHERE user='root';
  5. clear the cache: flush privileges;

The plain authentication (username/password) should work from now on.

Gefällt dir der Artikel? Dann empfiehl ihn weiter!
LESETIPP  Git: remove files from repository only

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.