MARIADB binary Semi-automatic installation script
System Environment: CENTOSX86_64
MARIADB version: mariadb-5.5.36-linux-x86_64
#!/bin/bash
#auth: Code7
#description: auto-mariadb
#version: 1.0
Groupadd-r-G 306 MySQL
Useradd-r-G 306-u 306 MySQL
#创建mysql的组和用户
TAR-XVF mariadb-5.5.36-linux-x86_64.tar.gz-c/usr/local
Cd/usr/local
#把mariadb的安装包解压到/usr/local, and enter this directory
LN-SV Mariadb-5.5.36-linux-x86_64/mysql
#创建mariadb-5.5.36-linux-x86_64 Soft-connect MySQL
Cd/usr/local/mysql
Chown-r mysql:mysql./*
#进入mysql目录, modify the files in this directory to the owner and owner group of MySQL
Mkdir-pv/mydata/data chown Mysql:mysql/mydata/data
#创建mysql的数据目录 and modify this directory to MySQL's owner and owner Group
scripts/mysql_install_db--datadir=/mydata/data --user=mysql
#执行mysql_install_db script, set data directory and user
CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
Chkconfig--add mysqld
#将mysql服务添加到系统启动服务中
Mkdir/etc/mysql
CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MYSQL/MY.CNF
#配置mysql默认 (maximum) configuration file
Author something: 1. This script needs to be in the same directory or file as the installation package
2, why is said to be a semi-automatic installation package, this script cannot determine whether the installation of the server is already Mysql,id 306 is occupied by other users.
This article is from the "12136188" blog, please be sure to keep this source http://code7.blog.51cto.com/12136188/1859628
MARIADB binary Semi-automatic installation script