MariaDB root password

I install nextcloudpi on my raspberry pi 3 witch the command:

curl -sSL | sudo bash

Know I wont use die MariaDB for other Project, but I do not now the root password. When I try
sudo mysql -u root -p
I can take my normal pi password. But I’m not login as root “MariaDB [(none)]>” I think.
If I try mysql -u root -p I get: ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’

In the ubuntuuser wiki is explain how to change the password for root:

MariaDB [(none)]> update mysql.user set password=password(‘geheim’) where user=‘root’;
MariaDB [(none)]> flush privileges;

but it do noch work.

All so I try this password “ its randomly generated, you can find it at /root/.my.cnf” but it all so get an error

Can any body tell me how to change or find out: the MariaDB root password?

Bye BlueGE

Hello, in french but ok

Mettre un mot de passe à l’utilisateur root de mariadb:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');

Changer le mode unix socket en « mysql native_password »:

UPDATE user SET plugin='mysql_native_password' WHERE User='root';
flush privileges;


Thank you Gael_Robert,
that works.

Can you say me what the (none) stands for MariaDB [(none)]>? It is not the user witch ist login the Maria DB?


I would assume that you haven’t selected a database. Try to select an exsitng database, e.g. nextcloud by executing “use nextcloud;” and it should be displayed instead of “none”.