MARIADB and MySQL differences:
MySQL founder has sold MySQL AB to SUN company. Since then, Sun has been acquired by Oracle, and MySQL's ownership has fallen into Oracle. may face issues such as fees and copyrights. So the MySQL founder created the MariaDB on the original MySQL branch. Support MySQL function and operation mode and do the extension.
Baidu Encyclopedia: http://baike.baidu.com/link?url=B2h3aDeGJZ4foSi0muvtwtHFg0MZhx00onFQkCoMTp4__ Vcpnau7mz1kjniiapdrotugcpgm16rscokcyriyqk
MariaDB Official website: https://downloads.mariadb.org/
Binary Package Installation:
MariaDB Bag: mariadb-10.1.13-linux-x86_64.tar.gz
Official website Installation Document: https://mariadb.com/kb/zh-cn/installing-mariadb-binary-tarballs/
CentOS 7 Installation mariadb:
(1): Add system User: MySQL
~]# useradd-r MySQL
~]# ID MySQL
uid=496 (MySQL) gid=493 (MySQL) groups=493 (MySQL)
(2): Unpack the package to/usr/local/, soft connect to MySQL, change MySQL directory permissions, create MySQL database directory and Change permissions.
~]# TAR-AXF mariadb-10.1.13-linux-x86_64.tar.gz-c/usr/local/
~]# cd/usr/local/
~]# ln-s Mariadb-10.1.13-linux-x86_64/mysql
Note: ln Soft connect is used for multiple version upgrade downgrades.
~]# cd /usr/local/mysql ~]# chown -R root:mysql ./* ~]# mkdir /mysqldata # 备注:数据库存放目录。 ~]# chown -R mysql.mysql /mysqldata # 备注:修改 /mysqldata 权限便于 mysql 进程访问。
(3): Add to System boot services, environment variables, view the order of the configuration files in effect, and modify the configuration file.
~]# CP Support-files/mysql.server/etc/init.d/mysqld
~]# Ll/etc/init.d/mysqld
-rwxr-xr-x 1 root root 12559 Apr 18:12/etc/init.d/mysqld
Note to ensure that it has execute permissions
~]# chkconfig--add mysqld ~]# chkconfig--list mysqld mysqld 0:off 1: Off 2:on 3:on 4:on 5:on 6:off ~]# bin/mysqld--help--verbose | Less ... Default options is read from the following files in the given order:/ETC/MY.CNF/ETC/MYSQL/MY.CNF ~/.MY.CNF ... # Note: File order the final file configuration takes effect. (Different installation methods, the reading order is not the same, the client and the service side is not the same) ~]# Mkdir/etc/mysql ~]# CP support-files/my-large.cnf/etc/mysql/my.cnf # Note: The Support-files directory is its configuration file, divided into different levels. ~]# vi/etc/mysqld/my.cnf [mysqld] # [MYSQLD] Configuration Add this content DataDir =/mysqldata s Kip_name_resolve = on innodb_file_per_table = on ~]# vi/etc/profile.d/mysql.sh export path=/ Usr/local/mysql/bin: $PATH # Note: Add to System environment variable ~]# source/etc/profile.d/mysql.sh
(4): Initialize, log in to MySQL.
~]# scripts/mysql_install_db--user=mysql--datadir=/mysqldata
~]# mysql-uroot-hlocalhost-p
Enter Password:
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 5
Server VERSION:10.1.13-MARIADB MariaDB Server
Note: The password defaults to empty after MySQL installation is complete
~]# service mysqld (restart | start | stop | reload) # 备注:需要的时候可以这样操作它。
(5): Add the library file to the system.
~]# vi/etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib
~]# Ldconfig
#备注: Overloading
~]# Ldconfig-p | grep MySQL
libmysqld.so.18 (libc6,x86-64) =/usr/local/mysql/lib/libmysqld.so.18
Libmysqld.so (libc6,x86-64) =/usr/local/mysql/lib/libmysqld.so
libmysqlclient_r.so.16 (libc6,x86-64) =/usr/lib64/mysql/libmysqlclient_r.so.16
libmysqlclient.so.18 (libc6,x86-64) =/usr/local/mysql/lib/libmysqlclient.so.18
libmysqlclient.so.16 (libc6,x86-64) =/usr/lib64/mysql/libmysqlclient.so.16
Libmysqlclient.so (libc6,x86-64) =/usr/local/mysql/lib/libmysqlclient.so
Libgalera_smm.so (libc6,x86-64) =/usr/local/mysql/lib/libgalera_smm.so
(6): Add header files to the system
ln-sv/usr/local/mysql/include//usr/include/mysql
安装好MariaDB后,最好运行一次mysql_secure_installation,初始化MariaDB安全配置
CentOS7 Binary Package Installation mariadb