官方网站
http://www.mysql.com/
下载
downloads(GA)--> MySQL Community Edition (GPL)
安装依赖
centos
yum install gcc gcc-c++ ncurses-devel zip make cmake
ubuntu
apt-get install gcc g++ cmake make libncurses5-dev bison zip
解压缩
tar -zxvf mysql-5.6.14.tar.gz
注意:
源码目录和安装目录不要使用同一目录!
清理环境
rm -rf /etc/my.cnf
userdel mysql
groupdel mysql
安装mysql
cmake -DCMAKE_INSTALL_PREFIX=/application/search/mysql/mysql-5.6.14 \
-DMYSQL_DATADIR=/data0/search/mysql/data \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1
注:如果想重新cmake,则需要删除目录下的 rm -rf CMakeCache.txt
make -j16 && make install -j16
=====================================================
修改配置文件 /application/search/mysql/mysql-5.6.14/tmp/my.cnf
配置文件是5.5和5.6最关键的区别
=====================================================
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
# 用户客户端bin目录下直接登录使用
[client]
port = 3306
socket = /application/search/mysql/mysql-5.6.14/tmp/mysql.sock
[mysql]
default-character-set=utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 1024M
innodb_data_file_path = ibdata1:64M:autoextend
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 0
innodb_use_sys_malloc = 0