How to set the mysql/mariadb password --------------------------------------- Ref https://linuxize.com/post/how-to-reset-a-mysql-root-password/ 1. Stop the MySQL/MariaDB service systemctl stop mysql 2. Start the MySQL/MariaDB server without loading the grant tables mysqld_safe --skip-grant-tables & 3. Log in to the MySQL shell mysql -u root 4. Set a new root password Run the following commands if you run MySQL 5.7.6 and later or MariaDB 10.1.20 and later: ALTER USER 'root'@'localhost' IDENTIFIED BY 'MY_NEW_PASSWORD'; FLUSH PRIVILEGES; If ALTER USER statement doesn.t work for you, try to modify the user table directly: UPDATE mysql.user SET authentication_string = PASSWORD('MY_NEW_PASSWORD') WHERE User = 'root' AND Host = 'localhost'; FLUSH PRIVILEGES; Run the following commands if you have MySQL 5.7.5 and earlier or MariaDB 10.1.20 and earlier: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MY_NEW_PASSWORD'); FLUSH PRIVILEGES; 5. Stop and Start the database server normally mysqladmin -u root -p shutdown (will ask for password) 6. Start the database server normally systemctl start mariadb 7. Add www user msql -uroot -pver1amt CREATE USER 'www'@'localhost' IDENTIFIED BY 'www'; GRANT ALL PRIVILEGES ON *.* To 'www'@'localhost'; ##