2.5 KiB
MariaDB Setup on Raspberry Pi
MariaDB is a fork of MySQL and is a popular choice for database management systems. It is open-source and is widely used in web applications. MariaDB is a community-driven project and is developed by the original developers of MySQL. It is designed to be fully compatible with MySQL, meaning that it can be used as a drop-in replacement for MySQL.
In this guide, we will show you how to install MariaDB on your Raspberry Pi. This will allow you to create and manage databases on your device.
Prerequisites
Before you begin, you will need the following:
- A Raspberry Pi with Raspbian installed
- Access to the terminal on your Raspberry Pi
Installation
Step 1: Update the Package List
The first step is to update the package list on your Raspberry Pi. This will ensure that you have the latest information about available packages.
Run the following command to update the package list:
sudo apt update
Step 2: Install MariaDB
Next, you will need to install the MariaDB server on your Raspberry Pi. You can do this by running the following command:
sudo apt install mariadb-server
During the installation process, you will be prompted to set a root password for the MariaDB server. Enter a secure password and remember it, as you will need it to access the database server.
Step 3: Secure the MariaDB Installation
After installing MariaDB, you should secure the installation by running the mysql_secure_installation
script. This script will guide you through the process of securing your MariaDB installation by setting a root password, removing anonymous users, disallowing remote root login, and removing the test database.
Run the following command to start the mysql_secure_installation
script:
sudo mysql_secure_installation
Follow the prompts to secure your MariaDB installation.
Step 4: Access the MariaDB Shell
Once you have secured the MariaDB installation, you can access the MariaDB shell by running the following command:
sudo mysql -u root -p
Enter the root password that you set during the installation process. You should now be logged into the MariaDB shell.
Conclusion
You have successfully installed MariaDB on your Raspberry Pi. You can now create and manage databases using MariaDB on your device. If you have any questions or run into any issues, feel free to refer to the MariaDB documentation for more information.