Translations:Devops:Install OpenMRS SDK/77/nb

Fra pc-aid wiki

Stop the database

sudo systemctl stop mariadb.service

Start MySQL/MariaDB in Safe Mode with the command:

mariadbd-safe --skip-grant-tables &

You can now log in to MySQL/MariaDB as root without having to enter a password:

mariadb -u root

Reset the MySQL/MariaDB password with the following command. Change my-new-password to a secure password.

UPDATE user SET password=PASSWORD("my-new-password") WHERE user='root';

Reload the privilege tables:

FLUSH PRIVILEGES;

Exit the MySQL/MariaDB client:

quit;

Shut down MySQL/MariaDB:

mariadb-admin -u root -p shutdown

Start MySQL/MariaDB:

sudo systemctl start mariadb.service

source:https://www.ionos.com/digitalguide/hosting/technical-matters/reset-mysql-mariadb-root-password/