1 minute reading time (186 words)

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 lists
apt update

Install MariaDB server
apt install mariadb-server

Check MariaDB version
mysql --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
https://mariadb.com/kb/en/mysql_secure_installation

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Saturday, 23 September 2023
You can help support this website by buying me a coffee!
Buy Me A Coffee