1. 程式人生 > >mysql5.6安裝部署

mysql5.6安裝部署

storage 配置 CM bst tex x86_64 linu mysqld engine

添加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


mysql5.6安裝部署