Install and configure MariaDB on Debian 11
How to install and configure MariaDB (MySQL) database server on Debian 11
Install MariaDB database server
Update apt package listsapt update
Install MariaDB serverapt install mariadb-server
Check MariaDB versionmysql --version
Configure MariaDB
Run the mysql_secure installation script and make these changes to secure MariaDB:
- set a root password
- remove anonymous users
- disable remote root login
- remove test databases
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