添加mysql用户
groupadd mysql
useradd mysql -g mysql -M -s /sbin/nologin
解压文件
tar –zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz -C /data/
mv /opt/mysql-5.6.33-linux-glibc2.5-x86_64 /data/mysql
创建 data、log、lib文件
mkdir -p /data/mysql/data
mkdir -p /data/mysql/var/{log,lib}
chown -R mysql:mysql /data/mysql
安装依赖包
yum -y install autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio libaio-devel bzr bison libtool perl-Module-Install.noarch
安装Mysql
/data/mysql/scripts/mysql_install_db \
--user=mysql \
--basedir=/data/mysql \
--datadir=/data/mysql/data
配置环境变量
vim /etc/profile
#**************DMP MYSQL ENV********************
export MYSQL_HOME=/data/mysql
export PATH="$PATH:$MYSQL_HOME/bin"
配置Mysql:/etc/my.cnf
[mysql]
socket = /data/mysql/var/lib/mysql.sock
default-character-set=utf8
#log_error = /data/mysql/var/log/error.log
[client]
socket=/data/mysql/var/lib/mysql.sock
default-character-set=utf8
[mysqld]
skip-name-resolve
port=3306
socket = /data/mysql/var/lib/mysql.sock
basedir = /data/mysql
datadir = /data/mysql/data
max_connections = 3000
character-set-server = utf8
default-storage-engine = INNODB
lower_case_table_names = 1
max_allowed_packet = 16M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
原文地址:http://blog.51cto.com/13833333/2132787