MariaDb

MariaDb (license-safe Mysql)

How To Install MariaDB on Debian 11

apt install mariadb-server

mysql_secure_installation

systemctl status mariadb

systemctl enable mariadb

mariadb -u root -p

MariaDB Database Level Commands

SHOW DATABASES;

CREATE DATABASE [IF NOT EXISTS] database_name [CHARACTER SET charset_name] [COLLATE collation_name];

MariaDB User Level Commands

SELECT user FROM mysql.user;

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'password';

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'new_password' PASSWORD EXPIRE;

CREATE USER 'jeffrey'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'new_password' PASSWORD EXPIRE INTERVAL 180 DAY FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 2;

MariaDB Rights

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'host';

FLUSH PRIVILEGES;

MariaDB Backup and Restore

mysql -u [username] -p [database_name] < [dumpfile.sql]

Comments

Log in to leave a comment.

Comments (0)

No comments yet. Be the first to comment!