-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Vianney Veremme edited this page May 30, 2024
·
12 revisions
Install the package:
sudo apt install mariadb-serverEnsure that MariaDB is running with the systemctl start command.
sudo mysql_secure_installationNo need to set root password, then I recommend choosing yes to all the following options.
sudo mariadbGRANT ALL ON *.* TO '<username>'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;FLUSH PRIVILEGES;exitLogin with the following command:
mysql -u <username> -pFrom 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> -puse <db_name>;source <filename.sql>;mysqldump -u <username> -p <db_name> > <db_backup_name>.sqlgunzip <db_backup_name>.sql | mysqldump -u <username> -p <db_name>mysqldump -u <username> -p <table1_name> <table2_name> | gzip > <table_backup_name>.sql.gzgunzip < <table_backup_name>.sql.gz | mysql -u <username> -p <table_name>