There was an error while loading. Please reload this page.
Install the package:
sudo apt install mariadb-server
Ensure that MariaDB is running with the systemctl start command.
systemctl start
sudo mysql_secure_installation
No need to set root password, then I recommend choosing yes to all the following options.
yes
sudo mariadb
GRANT ALL ON *.* TO '<username>'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Login with the following command:
mysql -u <username> -p
From a remote location:
mysql -u <username> -p -h <ip_adress>
All the databases:
SHOW DATABASES;
Only the created (unrequired) databases:
SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys');
CREATE DATABASE <db_name>;
USE <database>;
Tables list:
SHOW tables;
Table configuration:
DESCRIBE <table_name>
mysql -u <username> -p < <filename.sql>
OR
myslq -u <username> -p
use <db_name>;
source <filename.sql>;
mysqldump -u <username> -p <db_name> > <db_backup_name>.sql
gunzip <db_backup_name>.sql | mysqldump -u <username> -p <db_name>
mysqldump -u <username> -p <table1_name> <table2_name> | gzip > <table_backup_name>.sql.gz
gunzip < <table_backup_name>.sql.gz | mysql -u <username> -p <table_name>