由于MySQL已經(jīng)有閉源的趨勢州藕,所以大部分系統(tǒng)已經(jīng)不建議使用MySQL纽门,Mariadb是MySQL之父創(chuàng)建的一個MySQL分支項(xiàng)目,使用起來幾乎一模一樣输钩。
1.安裝MariaDB
# yum install MariaDB-server MariaDB-client
2.運(yùn)行數(shù)據(jù)庫
# systemctl start mariadb
3.進(jìn)入數(shù)據(jù)庫并創(chuàng)建一個production數(shù)據(jù)庫
# mysql
# MariaDB [(none)]> create database production;
# MariaDB [(none)]> use production;
# MariaDB [(none)]> flush privileges;
4.為production數(shù)據(jù)庫創(chuàng)建一個遠(yuǎn)程登陸的用戶
# MariaDB [(none)]> create user 'test1'@'%' identified by 'test1';
# MariaDB [(none)]> grant all privileges on production.* to test1 identified by 'test1';
# MariaDB [(none)]> flush privileges;
5.使用test1用戶連接數(shù)據(jù)庫
# mysql -u test1 -p
Enter password: test1
6.登陸成功豺型!
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 214
Server version: 5.5.52-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>