How do you set up a password during the initial installation of MariaDB?

To set the password for MariaDB, you first need to log in to the MariaDB server as root on the command line. You can use the following command:

sudo mysql -u root

Next, set the password using the following command:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

Replace new_password with the new password you want to set.

Next, use the following command to refresh permissions and exit MariaDB:

FLUSH PRIVILEGES;
EXIT;

Now you have successfully set the password for MariaDB.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds