Get a VPS server with a 15% discount
Sale ends in
00Days
:
00Hours
:
00Minutes
:
00Seconds

MySQL installation

MySQL is a free relational database management system.

First, update the system package and repository lists:

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

 

Add the MariaDB repository:

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

 

Install MariaDB:

sudo apt-get -y install mariadb-server

 

Next, start the client using the following command:

mysql -u root -p
 

Select the MySQL system database:

USE mysql;

 

Create the first user:

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

 

Now create a database:

CREATE DATABASE server;

 

Use the following two commands to grant the user access to the database:

GRANT ALL PRIVILEGES ON server.* TO 'spacecore'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
 
Opening the database for external access:

If you need to connect to MySQL from a host other than localhost, edit /etc/mysql/my.cnf and find the bind-address line so that it looks as follows:

#bind-address = 127.0.0.1

 

Restart MySQL:

service mysql-server restart