Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-statistics domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-pagenavi domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114
Les commandes MariaDB - Plessy

Les commandes MariaDB

Un petit pense-bête concernant les principales commandes MariaDB pour gérer vos BDD MYSQL:

Se connecter à MariaDB:

sudo mariadb -u $USERNAME -p$PASSWORD

Créer une BDD:

CREATE DATABASE $NomDeLaBDD;

Supprimer une BDD:

DROP DATABASE $NomDeLaBDD;

Supprimer une colonne:

USE $NomDeLaBDD;
ALTER TABLE $NomDeLaTable DROP COLUMN $NomDeLaColonne;

Exporter une base de données:

mysqldump -u $USERNAME -p$PASSWORD $NomDeLaBDD > $NomDeLaBDD.sql

Importer une base données:

sudo mysql -u $USERNAME -p$PASSWORD
CREATE DATABASE $NomDeLaBDD;
FLUSH PRIVILEGES;
QUIT ;
mysql -u $USERNAME -p$PASSWORD $NomDeLaBDD < $NomDeLaBDD.sql
OU
mysql> use db_name;
mysql> source backup-file.sql;

Lister les utilisateurs Mariadb:

SELECT User FROM mysql.user;

Créer un utilisateur Mariadb:

CREATE USER '$USERNAME'@'localhost' IDENTIFIED BY '$PASSWORD';

Changer de mot de passe:

SET PASSWORD FOR '$USERNAME'@'localhost' = PASSWORD('$PASSWORD');

Ajouter des privilèges:

GRANT ALL PRIVILEGES ON *.* TO '$USERNAME'@'localhost' WITH GRANT OPTION;

Enlever des privilège:

REVOKE ALL PRIVILEGES, GRANT OPTION FROM '$USERNAME'@'localhost';

Supprimer un utilisateur:

DROP USER '$USERNAME'@'localhost';

Quitter MariaDB:

FLUSH PRIVILEGES;
QUIT ;