Set root password for MariaDB on windows
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)
This will show the startup log for MariaDB
Once log says that it is ready for connection, open another window, go to bin directory and type following command
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.
Set Password for Root
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.