MySQL is a free and open-source relational database management system (RDBMS).


To begin, let's update the system's package lists and repositories:

sudo apt-get -y update && sudo apt-get -y dist-upgrade


Next, we'll add the MariaDB repository:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash


Now, let's install MariaDB:

sudo apt-get -y install mariadb-server


To activate the program, use the following command:

mysql -u root -p

The ";" symbol is mandatory in SQL queries!


Choose MySQL:

USE mysql;


Create the first user:

CREATE USER 'spacecore'@'localhost' IDENTIFIED BY '123456';


Now, let's create a database:

CREATE DATABASE server;


Grant the user access to the database using two commands:

GRANT ALL PRIVILEGES ON server.* TO 'spacecore'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;


If you need to connect to MySQL from outside localhost, you'll need to edit /etc/mysql/my.cnf and find the bind-address line, which should look like this:

#bind-address = 127.0.0.1


Restart MySQL:

service mysql-server restart