Posts: 1
Joined: Wed Jan 02, 2019 10:10 pm


Wed Jan 02, 2019 10:29 pm

Hi !

I’m quite new to this, and I need help.

I’m trying to install MySQL on my Raspberry Pi B 3+. I followed several tutorials, but I can’t seem to make this work. I can install mysql correctly with apt, but I cant reset the root password. Each time I try to, I cant log back in...

Can tou guys help fill in the gaps ? This is what I tried (other than the usual « set password » commands)

Code: Select all

sudo mysql_secure_installation

Reseting the password w/

Code: Select all

sudo mysqld_safe --skip-grant-tables --skip-networking &
Each time I can set the password but I cannot log back in (as I said earlier).


PS : Sorry if this is not enough, I may update later when I ger to my laptop...

Posts: 642
Joined: Thu Aug 17, 2017 9:08 pm


Thu Jan 03, 2019 5:55 pm

If you didn't do anything else than you described, everything still should be fine. The root user even should have a password. The "problem" is, that it isn't used for authentication.


Code: Select all

sudo mysql
to login (the server should run "normally" without "--skip-grant-tables").
If that works, create an alternative administrator account

Code: Select all

create user 'admin'@'localhost' identified by 'secret';
grant all privileges on *.* to 'admin'@'localhost' with grant option;
(replace secret by a good password).
Now login as admin

Code: Select all

mysql -uadmin -p
When tutorials ask for "root" use "admin" until you know, why the password for root is not used and what things will break, if you make MariaDB using password authentication for root.

Return to “Beginners”