时间:2021-07-01 10:21:17 帮助过:16人阅读
cmake 版本:cmake-3.1.1。
1、下载地址:http://www.cmake.org/files/v3.1/cmake-3.1.1.tar.gz
$ wget http://www.cmake.org/files/v3.1/cmake-3.1.1.tar.gz
2、解压安装包
$ tar zxvf cmake-3.1.1.tar.gz
3、进入安装包目录
$ cd cmake-3.1.1
4、编译安装
$ ./bootstrap
$ make && make install
MySQL版本:mysql-5.6.15。
1、下载地址: http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.15.tar.gz
$ wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.15.tar.gz
2、解压安装包
$ tar zxvf mysql-5.6.15.tar.gz
3、进入安装包目录
$ cd mysql-5.6.15
4、编译安装
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql/ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_INNODB_MEMCACHED=1 -DWITH_DEBUG=OFF -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DENABLED_PROFILING=ON -DMYSQL_MAINTAINER_MODE=OFF -DMYSQL_DATADIR=/usr/local/webserver/mysql/data -DMYSQL_TCP_PORT=3306
$ make && make install
5、查看mysql版本:
$ /usr/local/webserver/mysql/bin/mysql --version
到此,mysql安装完成。
1、创建mysql运行使用的用户mysql:
$ /usr/sbin/groupadd mysql
$ /usr/sbin/useradd -g mysql mysql
2、创建binlog和库的存储路径并赋予mysql用户权限
$ mkdir -p /usr/local/webserver/mysql/binlog /www/data_mysql
$ chown mysql.mysql /usr/local/webserver/mysql/binlog/ /www/data_mysql/
3、创建my.cnf配置文件
将/etc/my.cnf替换为下面内容
$ cat /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
replicate-ignore-db = mysql
replicate-ignore-db = test
replicate-ignore-db = information_schema
user = mysql
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /www/data_mysql
log-error = /usr/local/webserver/mysql/mysql_error.log
pid-file = /usr/local/webserver/mysql/mysql.pid
open_files_limit = 65535
back_log = 600
max_connections = 5000
max_connect_errors = 1000
table_open_cache = 1024
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 1M
join_buffer_size = 1M
thread_cache_size = 600
#thread_concurrency = 8
query_cache_size = 128M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
default-tmp-storage-engine=MYISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 128M
max_heap_table_size = 128M
log-slave-updates
log-bin = /usr/local/webserver/mysql/binlog/binlog
binlog-do-db=oa_fb
binlog-ignore-db=mysql
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 1G
relay-log-index = /usr/local/webserver/mysql/relaylog/relaylog
relay-log-info-file