in Raspberry Pi by

Install MariaDB server

As said in the introduction, MariaDB is available in the Raspberry Pi OS repository, so the installation is straightforward. Open a terminal (or connect via SSH) and follow the instructions:

  • As always, start by updating your system:
    sudo apt update
    sudo apt upgrade
  • Then you can install MariaDB with this command:
    sudo apt install mariadb-server
  • Type “Y” and Enter to continue.
    After a few seconds, the installation process is complete and MariaDB is almost ready to use.

If you’ve noticed it, the installation of MariaDB has also installed the MariaDB client.
This will allow you to connect from the command line with:
    mysql

Root access

Here is how to define the password for the root user and start to use MariaDB:

  • Enter this command:
    sudo mysql_secure_installation
  • Press enter to continue (no password by default).
  • Press “Y” to switch to unix_socket authentication.
  • Then type “Y” to set a new password, and enter the password of your choice.
  • Now, press “Y” three more times 
  • Remove anonymous users.
  • Disallow root login remotely.
  • Remove the test database.
  • And finally, press “Y” again to reload the privileges.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

9 questions

0 answers

0 comments

1 user

Welcome to Asky Q&A, where you can ask questions and receive answers from other members of the community.
...
Total PHP MySQL Other RAM
Time (ms) % Time (ms) % File count Time (ms) % Query count Time (ms) % Amount %
Setup 20.8 13% 14.4 9% 19 6.6 4% 2 0.0 0% 111k 50%
Control 68.7 43% 22.9 14% 10 52.7 33% 12 0.0 0% 34k 15%
View 29.2 18% 27.9 17% 19 1.9 1% 1 0.0 0% 40k 17%
Theme 20.7 13% 20.7 13% 2 0.0 0% 0 0.0 0% 31k 14%
Stats 18.5 11% 2.2 1% 0 17.2 10% 2 0.0 0% 4k 1%
Total 158.2 100% 88.2 55% 50 78.4 49% 17 0.0 0% 222k 100%