MySQL (pronounced My Sequel or My S-Q-L) is a popular database engine. Like PHP, its overwhelming presence on web servers enhanced its popularity. This is why projects like WordPress use it, and why those projects are so popular.
Install the MySQL Server and PHP-MySQL packages by entering the following command into the terminal:
sudo apt install mysql-server php-mysql
Answer yes to all the questions.
When installing MySQL you will be asked for a root password. Set it to ‘raspberry’. You’ll need to remember this password to allow your website to access the database.
Now restart Apache:
sudo service apache2 restart
Source: https://www.raspberrypi.org/learning/lamp-web-server-with-wordpress/worksheet/