System Environment: CentOS 7 1611 (after the system installation is complete with MARIADB)
MARIADB version: mariadb-5.5.56-linux-x86_64.tar.gz (Generic Linux)
: http://mirrors.neusoft.edu.cn/mariadb//mariadb-galera-5.5.56/bintar-linux-x86_64/ Mariadb-galera-5.5.56-linux-x86_64.tar.gz
1. Download the generic binary program and expand
[Email protected] tmp]# wget http://mirrors.neusoft.edu.cn/mariadb//mariadb-galera-5.5.56/bintar-linux-x86_64/ Mariadb-galera-5.5.56-linux-x86_64.tar.gz
2. Create a directory to store the database and add MySQL users
[Email protected] tmp]# Mkdir-pv/mydata/data #创建用户存储数据存储文件的目录
[Email protected] tmp]# useradd-r MySQL #创建mysql用户为系统用户
[[email protected] tmp]# chown root:mysql/mydata/data/#更改数据存储路径属主为root, group of MySQL
3. Installation Configuration mariadb
[[email protected] tmp]# cd/usr/local/[[email protected] local]# ln-sv mariadb-5.5.56-linux-x86_64 mysql ' mysql ', ' m Ariadb-5.5.56-linux-x86_64 ' [[email protected] local]# cd/usr/local/mysql/[[email protected] mysql]# chown-r root: MySQL./* #修改/usr/local/mysql is root and belongs to group Mysql[[email protected] mysql]#./scripts/mysql_install_db--user=mysql-- Datadir=/mydata/data #指明数据库文件存储路径, and installation user [[email protected] mysql]# CP Support-files/mysql.server/etc/init.d/mysqld # Add service startup script [[email protected] mysql]# chkconfig--add mysqld #将服务启动脚本加入到开机自启
4. Provide configuration files
[[email protected] mysql]# Cp/etc/my.cnf{,.bak} #备份系统自带的mariadb配置文件 [[email protected] mysql]# CP support-files/my -LARGE.CNF/ETC/MY.CNF #添加系统配置脚本到默认位置 [[email protected] mysql]# vim/etc/my.cnf [mysqld]datadir =/mydata/data #指明数据库文件存储路径innodb_file_per_table = Onskip_name_resolve = on #跳过使用IP登陆数据库时反解域名的过程
Common binary format installed service programs its configuration file lookup order:
/ETC/MY.CNF--/ETC/MYSQL/MY.CNF----default-extra-file=/path/to/conf_file-~/.MY.CNF
Note: If the configuration file is not/etc/my.cnf, you need to indicate the configuration file path
./scripts/mysql_install_db--defaults-file=/path/to/conf_file (e.g. ~/.my.cnf)
5, installation end, so that can start the service
[[Email protected] mysql]# service mysqld start
This article is from the "7358072" blog, please be sure to keep this source http://7368072.blog.51cto.com/7358072/1924551
CentOS 7 installs mariadb in a common binary format