This is part of a series on hosting a website on the Raspberry Pi. Click the Raspberry Pi Webserver in the Blog Series to the right for the complete steps.

For today, we will install MariaDB, here is the command:

sudo apt install mariadb-server php-mysql -y

After installation is completed, test to make sure the insulation is ok by checking for the version.

mysql -V

Let’s make this a little more secure by executing this command:

sudo mysql_secure_installation

You will be asked some questions:
Enter current password for root (enter for none): Press Enter
Switch to unix_socket authentication? N
Change the root password? Y
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y

When completed you should see this message:

Next time the installation of a open-source content management system: WordPress

Share this content: