What’s the default password of root user in mariadb?

If you have just installed mariadb, you should run this command in order to set a password for the root user and secure your installation:

$ sudo mysql_secure_installation

Besides asking you to provide the new root password, this utility will help you to remove anonymous user (created by default, intended for testing), disallow root login remotely (root should only be allowed to connect from ‘localhost’), remove test database and privileges ad reloading the privilege table. All of it just pressing the Enter key a couple of times 馃檪 Not bad!

If that process doesn’t work, try this other one:

(using sudo, don’t specify any password)

$ sudo mysql -u root

Create a new database:

CREATE DATABASE yourdb;

Grant privileges to a new user:

GRANT ALL ON yourdb.* TO yournewuser@localhost IDENTIFIED BY 'yourpassword';
FLUSH privileges;

 

3 comentarios en 芦What’s the default password of root user in mariadb?禄

  1. my homebrew installed Mariadb wouldnt accept blank for theroot password, so I tried your command-line above but it fsiled for the same reason I’ve got a fresh install thats inaccessible!!?

Deja una respuesta

Tu direcci贸n de correo electr贸nico no ser谩 publicada. Los campos obligatorios est谩n marcados con *

Este sitio usa Akismet para reducir el spam. Aprende c贸mo se procesan los datos de tus comentarios.