centos6.x源码编译安装mysql5.6

yum install gcc gcc-c++ ncurses-devel perl

wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz   
tar -xzvf cmake-2.8.10.2.tar.gz   
cd cmake-2.8.10.2   
./bootstrap
make && make install

wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install
groupadd mysql 
adduser -g mysql mysql
chown -R mysql.mysql /usr/local/mysql/ 

cd /usr/local/mysql-5.5
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1
make && make install

cd /usr/local/mysql
scripts/mysql_install_db --user=mysql --datadir=/usr/local/data 
/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql --collation-server=utf8_general_ci

cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf 
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

vi /etc/my.ini
[mysqld]
datadir = /data/mysql
socket = /tmp/mysql.sock
pid-file = /data/logs/mysql/mysql.pid
user = mysql
port = 3306
default_storage_engine = InnoDB
# InnoDB
#innodb_buffer_pool_size = 128M
#innodb_log_file_size = 48M
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
# MyISAM
#key_buffer_size = 48M
# character-set
character-set-server=utf8
collation-server=utf8_general_ci
# name-resolve
skip-host-cache
skip-name-resolve
# LOG
log_error = /data/logs/mysql/mysql-error.log
long_query_time = 1
slow-query-log
slow_query_log_file = /data/logs/mysql/mysql-slow.log
# Others
explicit_defaults_for_timestamp=true
#max_connections = 500
open_files_limit = 65535
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[client]
socket = /tmp/mysql.sock
port = 3306

vi /etc/profile
PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH  
service mysqld start

chkconfig --level 35 mysqld on

grant all privileges on *.* to root@"%" identified by '123456' with grant option;
flush privileges;

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...