Copyright statement: This article is an original article by Shaon Puppet. Please indicate the original address for reprinting. Thank you very much. https://blog.csdn.net/wh211212/article/details/53129488
[ root@linuxprobe~]# yum -y install mariadb-server
[ root@linuxprobe~]# vi /etc/my.cnf
# add follows within [mysqld] section
[ mysqld]
character-set-server=utf8
[ root@linuxprobe~]# systemctl start mariadb
[ root@linuxprobe~]# systemctl enable mariadb
ln -s '/usr/lib/systemd/system/mariadb.service''/etc/systemd/system/multi-user.target.wants/mariadb.service'
[ root@linuxprobe~]# mysql_secure_installation #Same as MySQL, all the way y
[ root@linuxprobe ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with; or \g.
Your MariaDB connection id is 1023
Server version:5.5.50-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)]> select user,host,password from mysql.user;+-----------+-----------+-------------------------------------------+| user | host | password |+-----------+-----------+-------------------------------------------+| root | localhost |*F1DAE8BCDFCA7A57F246E0F834AC35830A3D640E || root |127.0.0.1|*F1DAE8BCDFCA7A57F246E0F834AC35830A3D640E || root |::1|*F1DAE8BCDFCA7A57F246E0F834AC35830A3D640E |+-----------+-----------+-------------------------------------------+5 rows inset(0.00 sec)
MariaDB [(none)]> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema |+--------------------+5 rows inset(0.05 sec)
MariaDB [(none)]> exit;
Bye
# Client settings
[ root@vdevops ~]# firewall-cmd --add-service=mysql --permanent
success
[ root@vdevops ~]# firewall-cmd --reload
success
The premise is to install the web server and php, refer to the following:
http://blog.csdn.net/wh211212/article/details/52982917http://blog.csdn.net/wh211212/article/details/52994505
# install from EPEL
[ root@linuxprobe~]# yum --enablerepo=epel -y install phpMyAdmin php-mysql php-mcrypt
[ root@linuxprobe~]# vi /etc/httpd/conf.d/phpMyAdmin.conf
# line 17: IP address you permit to access
Require ip 127.0.0.110.1.1.0/24
# line 34: IP address you permit to access
Require ip 127.0.0.110.1.1.o/24[root@linuxprobe ~]# systemctl restart httpd
MariaDB master-slave replication is the same as MySQL master-slave replication, please move to: http://blog.csdn.net/wh211212/article/details/53105335
[ root@linuxprobe ~]# yum --enablerepo=centos-sclo-rh -y install rh-mariadb101-mariadb-server
[ root@linuxprobe ~]# scl enable rh-mariadb101 bash
[ root@linuxprobe ~]# mysql -V
mysql Ver 15.1 Distrib 10.1.14-MariaDB,forLinux(x86_64) using EditLine wrapper
[ root@linuxprobe ~]# which mysql
/opt/rh/rh-mariadb101/root/usr/bin/mysql
[ root@linuxprobe ~]# vi /etc/profile.d/rh-mariadb101.sh
# create new
#! /bin/bash
source /opt/rh/rh-mariadb101/enable
export X_SCLS="`scl enable rh-mariadb101 'echo $X_SCLS'`"
[ root@linuxprobe ~]# mysql_secure_installation
Recommended Posts