# yum install ncurses-devel -y
# yum install libaio-devel -y
注意:参考“mysql二进制包安装”这一章节
请查考MySQL系列之B------MySQL安装准备、MySQL系列之B------MySQL安装
# groupadd mysql
# useradd -s /sbin/nologin -g mysql -Mmysql
#注意:useradd命令参数简要说明
#1、-s /sbin/nologin 表示禁止该用户登录,加强安全
#2、-g 指定属于mysql组
#3、-M表示不创建用户家目录
# mkdir -p /data/{3307,3308}/data
目录解析:
/data 实例的总目录
/data/3307 3307实例的目录
/data/3308 3308实例的目录
/data/3307/data 3307实例的数据目录
/data/3308/data 3308实例的数据目录
注意:生产硬件配置:MEM 32g、双CPU8core、硬盘6*600g sas 15k/rpm 2-3个实例
# cd /mysql/mysql
# scripts/mysql_install_db--basedir=/mysql --datadir=/data/3307/data --user=mysql
# scripts/mysql_install_db--basedir=/mysql --datadir=/data/3308/data --user=mysql
1、3307配置文件/data/3307/
[client]
port=3307
socket=/data/3307/mysql.sock
prompt=\\u@hostname \\r:\\m:\\s->
[mysqld]
basedir =/mysql
datadir =/data/3307/data
port =3307
server_id =2
socket =/data/3307/mysql.sock
log-bin=/data/3307/mysql_bin
binlog_format=mixed
#binlog-do-db=
#binlog-ignore-db=
long_query_time=1
relay-log=/data/3307/relay_bin
relay-log-info-file=/data/3307/relay_log.info
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/data/3307/mysql_err.log
pid-file=/data/3307/mysql_pid.pid
2、3308配置文件/data/3308/
[client]
port=3308
socket=/data/3308/mysql.sock
prompt=\\u@hostname \\r:\\m:\\s->
[mysqld]
basedir =/mysql
datadir =/data/3308/data
port =3308
server_id =3
socket =/data/3308/mysql.sock
log-bin=/data/3308/mysql_bin
binlog_format=mixed
#binlog-do-db=
#binlog-ignore-db=
long_query_time=1
relay-log=/data/3308/relay_bin
relay-log-info-file=/data/3308/relay_log.info
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/data/3308/mysql_err.log
pid-file=/data/3308/mysql_pid.pid
本文出自 “技术博” 博客,请务必保留此出处http://hostman.blog.51cto.com/6303208/1673490
原文地址:http://hostman.blog.51cto.com/6303208/1673490