How to install and configure MariaDB (MySQL) database server on Debian 11
Update apt package listsapt update
Install MariaDB serverapt install mariadb-server
Check MariaDB versionmysql --version
Run the mysql_secure installation script and make these changes to secure MariaDB:
mysql_secure_installation
Enter current password for root (enter for none) - press enter
Switch to unix_socket authentication [Y/n] n
Change the root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]:Y
Reload privilege tables now? [Y/n]:Y
Connect to MariaDB
sudo mysql -u root -p
Exit MariaDB
quit
Reference:
MariaDB - mysql_secure_installation
by Author
https://mariadb.com/kb/en/mysql_secure_installation
Comments