MySQL
MySQL is an open-source database management system, commonly installed as part of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.
Installation
Server
sudo apt install mysql-server
This will install MySQL, but will not prompt you to set a password or make any other configuration changes.
To check whether the MySQL server is running, type:
sudo systemctl status mysql
Client
The command-line tools allow you to interact with the server and it also allows you to run MySQL commands in shell scripts and other programs:
sudo apt install mysql-client
To install the MySQL database development files:
sudo apt install libmysqlclient-dev
Security
Run the script:
sudo mysql_secure_installation
This will take you through a series of prompts where you can make some changes to your MySQL installation's security options.
You should answer "y" (yes) to all questions.
Usage
To log in to the MySQL server as root:
sudo mysql
To stop or start the server:
sudo systemctl stop mysql.service
sudo systemctl start mysql.service