安装包:
mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz
yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel
libmcrypt* libtool-ltdl-devel* make cmake curl curl-devel libaio
useradd -s /sbin/nologin mysql
tar -xf mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.28-linux-glibc2.5-x86_64 /opt/mysql
chown -R mysql.mysql /opt/mysql
cd /opt/mysql
./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/data
vim /etc/my.cnf
[mysqld] skip-host-cache skip-name-resolve #skip-grant-tables port = 3306 innodb_flush_log_at_trx_commit=0 lower_case_table_names=1 character-set-server=utf8mb4 max_connections=1000 innodb_flush_log_at_trx_commit=0 max_allowed_packet = 20M slow_query_log = ON slow_query_log_file = /opt/mysql/data/slow-query.log long_query_time = 2 log-queries-not-using-indexes log-slow-admin-statements log-slow-slave-statements log_queries_not_using_indexes = OFF # Disabling symbolic-links is recommended to prevent assorted security risks # symbolic-links=0 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] general_log=1 general_log_file=/var/log/mysqld.log log-error=/var/log/mysqld.error.log slow_query_log=1 slow_query_log_file=/var/log/mysqld.slow.log long_query_time=2 log_output='FILE' pid-file=/var/run/mysqld/mysqld.pid
vim /etc/profile
export PATH=$PATH:/opt/mysql/bin
source /etc/profile
cp -rp support-files/mysql.server /etc/init.d/mysqld
vim /etc/init.d/mysqld
basedir=/opt/mysql
datadir=/opt/mysql/data
OK完成