Installing and configuring MARIADB
It seems that later have to use the MARIADB database, early familiar;
[1] Install Mariadb for Epel
Yum-y Install Mariadb-server
Installed:
Mariadb-server.x86_64 1:5.5.37-1.el7_0
[2] Start Mariadb & boot up
[[email protected] ~]# systemctl start mariadb[[email protected] ~]# systemctl enable Mariadbln-s '/usr/lib/systemd/syste M/mariadb.service '/etc/systemd/system/multi-user.target.wants/mariadb.service '
[3] Configure Mariadb
[Email protected] ~]# Mysql-urootwelcome to the MariaDB Monitor. Commands End With; MariaDB Connection ID is 2Server version:5.5.37-mariadb MariaDB servercopyright (c) \g.your, Oracle, Monty Program Ab and others. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
#show Info
mariadb [(None)]> select user,host,password from mysql.user;+------+-------------- ----+----------+| user | host | password |+------+------------------+----------+| root | localhost | | | root | mariadb.carso.cn | | | root | 127.0.0.1 | | | root | ::1 | | | | localhost | | | | mariadb.carso.cn | |+------+------------------+----------+6 rows in set (0.00 sec)
#设置root Password
MariaDB [(none)]> set password for [email protected]=password (' 123.com '); Query OK, 0 rows Affected (0.00 sec) MariaDB [(none)]> set password for [email protected]=password (' 123.com '); Query OK, 0 rows Affected (0.00 sec) MariaDB [(none)]> set password for [email protected]=password (' 123.com '); Query OK, 0 rows Affected (0.00 sec)
#::1 This is a IPv6 user, if not used can be deleted
MariaDB [(none)]> Delete from mysql.user where user= ' root ' and host= ':: 1 '; Query OK, 1 row Affected (0.00 sec)
#安全考虑, delete anonymous users
MariaDB [(none)]> Delete from mysql.user where user= '; Query OK, 2 rows affected (0.01 sec)
#show Info
mariadb [(None)]> select user,host,password from mysql.user;+------+-------------- ----+-------------------------------------------+| user | host | password |+------+------------------+---------------------------- ---------------+| root | localhost | * ac241830ffddc8943ab31cbd47d758e79f7953ea | | root | mariadb.lisys.cn | *ac241830ffddc8943ab31cbd47d758e79f7953ea | | root | 127.0.0.1 | * ac241830ffddc8943ab31cbd47d758e79f7953ea |+------+------------------+------------------------------------ -------+3 rows in set (0.00 SEC)
[4] Validation settings
MariaDB [(none)]> Exitbye
[Email protected] ~]# Mysql-uroot-penter password:welcome to the MariaDB Monitor. Commands End With; MariaDB Connection ID is 5Server version:5.5.37-mariadb MariaDB servercopyright (c) \g.your, Oracle, Monty Program Ab and others. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. MariaDB [(none)]> Exitbye
This article is from the "Siberian Wolf" blog, please make sure to keep this source http://kernal.blog.51cto.com/8136890/1531271