6

Ps: i'm using my root account

mysql is giving me this error when I try to access it for the first time.

It's not working for me; I have Parrot OS, which is based on Debian Jessie. The problem started with adding the mysql repository, then the package installation (of mysqlserver etc); after all of that, I'm facing this error. I tried the procedure that you sent but at the last command it's giving me error 2002 which is probably caused by the stop command at the beginning.

2
  • 1
    This may possibly help: askubuntu.com/questions/705458/…
    – user147505
    Commented Jan 29, 2018 at 22:49
  • it's not working with me, i have Parrot OS which is based on debian jessie, the problem started with adding mysql repository then the package installation (of mysqlserver ecc....), after all of that i'm facing this error, i tried the procedure that you sent but at the last command it's giving me error 2002 which is probably caused by the stop command at the beginning
    – Monta
    Commented Jan 30, 2018 at 12:32

1 Answer 1

7

I've ran into a similar problem and got it working using this solution.

STEP 1: ADD UNIX AUTHENTICATION PLUGIN TO MARIADB CONFIG

Change the file /etc/mysql/mariadb.conf.d/50-server.cnf

Add the line below [mysqld] section.

plugin-load-add = auth_socket.so

Restart the server and you should log using

sudo mysql -u root

That's it!
It seems that Mariadb developpers have found a new approach for identifying based on the actual user, so they made an extension that allow you: if you're user1 on Linux and there happen to be a MySQL user named user1 then he will be logged in without a password based on the socket file (the last sentence is just my understanding I could be wrong or imprecise).

The bottom line you're good with the first step unless want the old identification behavior then move to step2 :

STEP 2: CHANGE TO STANDARD AUTHENTICATION
Run the following commands

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

Source and more info

1
  • In some cases which etc/mysql/mariadb.conf.d/50-server.cnf does not exist edit /etc/mysql/my.cnf and it will work. Commented Jul 6, 2018 at 17:46

You must log in to answer this question.

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