The mysql_secure_installation command will guide you through the process of setting a root password and removing unsafe features from your installation.
sudo systemctl start mariadb
sudo mysql_secure_installation
By default, the root account is not password set. Press Enter.
Enter Y to set password and enter password. Example here using password 123Admin
You must write down the root password to use the Database configuration for Nodejs app
Setting a root password for MariaDB is just the most basic measure to secure your database. When you build or install a database-driven application, you typically create a database service user for that application and avoid using the root account for anything but database administration. data.
In addition, you should note the following:
Enter Y to remove anonymous user accounts.
Enter Y to disable remote root login.
Enter Y to remove the test database.
Type Y to reload privilege tables and save your changes.
sudo systemctl enable mariadb