Set root password for MariaDB

Posted on by By Nikhilesh, in Miscellaneous | 0

[h1]Set root password for MariaDB on windows[/h1]

[h2]Problem Definition[/h2]

Have you just downloaded zip archive of MariaDB, unizipped it and don’t know how to start with MariaDB? Wait, this article will walk you through few steps, so that you will know how to Set root password for MariaDB on windows and start enjoying the features of MariaDB.

Open zip installer downloaded from MariaDB download for your windows machine. After download, extract it to local folder and go to bin folder. Enter following command on command prompt. (type help on console to get help. Start MariadDB in console)

…\bin\mysqld –console

This will show the startup log for MariaDB

Startup log when MariaDB starts without any error.

Startup log when MariaDB starts without any error.

Once log says that it is ready for connection, open another window, go to bin directory and type following command


Set root password for MariaDB on windows - MariaDB Shell Prompt

MariaDB Shell Prompt

Bingoo, now you got the command prompt… Now you can even log on to MariaDB with your mysql query browser without providing any credentials. You are ready to do whatever you want in MariaDB.


[h2]Set Password for Root[/h2]
Now, Following are steps to set root password and grant all the privileges.

mysql -u root

Above command would again bring back MariaDB Shell prompt for you

MariaDB [(none)]> use mysql;

Replace ‘NEWPASSWORD’ with your actual password in below statement.

MariaDB [(none)]> update user set password=PASSWORD(“NEWPASSWORD”) where User=’root’;

Now, flush the privileges and exit from the MariaDB server:

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit;

Now you can login to MariaDB with your new password. Open command window, go to bin folder and type following command.

mysql -u root -p

Enter the password and you are again on the shell prompt for MariaDB. Or open MySQL query browser and enter username and password to get into the MariaDB.

As MariaDB is an extension to MySQL, it inherits all the functionality and also has various enhancements and optimizations. Visit MariaDB website to know more about it.


Best Open Source Business Intelligence Software Helical Insight is Here


A Business Intelligence Framework

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments