Installing MySQL
On this page
MySQL (MariaDB) - a free relational database management systemOpening the database from external sources:MySQL (MariaDB) - a free relational database management system
To start, update the system's package and repository lists:
sudo apt-get -y update && sudo apt-get -y dist-upgradeAdd the MariaDB repository:
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bashInstall MariaDB:
sudo apt-get -y install mariadb-serverNext, activate the program using the following command:
mysql -u root -pThe ";" symbol is mandatory in SQL queries!
Select MySQL:
USE mysql;Create the first user:
CREATE USER 'myfirstdb'@'localhost' IDENTIFIED BY '123456';Now, create a Database:
CREATE DATABASE server;Using two commands, grant the user access to the Database:
GRANT ALL PRIVILEGES ON server.* TO 'myfirstdb'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;Opening the database from external sources:
If you need to connect to MySQL from outside localhost, you should edit /etc/mysql/my.cnf, find the bind-address line, and make it look like this:
#bind-address = 127.0.0.1Restart MySQL:
service mysql-server restart