mysql5.5.20源码安装

rpm -qa|grep  bison
rpm -qa|grep ncurses-devel
yum install bison
yum install ncurses-devel.x86_64

http://www.cmake.org/cmake/resources/software.html
下载cmake-2.8.7.tar.gz
从mysql.com
下载Source Code package : mysql-5.5.20.tar.gz

安装cmake
# tar zxvf cmake-2.8.7.tar.gz
# cd cmake-2.8.7
# ./bootstrap
# gmake
# gamke install

安装mysql
tar zxvf mysql-5.5.20.tar.gz
cd mysql-5.5.20

cmake -DCMAKE_INSTALL_PREFIX=/data/mysql \
-DMYSQL_UNIX_ADDR=/data/mysql/data/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=gbk \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_DATADIR=/data/mysql/data \
-DSYSCONFDIR=/data/mysql \
-DMYSQL_TCP_PORT=3306

# make
# make install

# groupadd mysql
# useradd -r -g mysql mysql
# chown -R mysql:mysql /home/mysqldata/

cp /mysqlfile/mysql-5.5.20/support-files/my-large.cnf /data/mysql/my.cnf
cp /mysqlfile/mysql-5.5.20/support-files/mysql.server /etc/init.d/mysqld
chown mysql:mysql /data/mysql/my.cnf
chown mysql:mysql /etc/init.d/mysqld
chmod 744 /etc/init.d/mysqld

chmod +x scripts/mysql_install_db

scripts/mysql_install_db \
--defaults-file=/data/mysql/my.cnf \
--basedir=/data/mysql/ \
--datadir=/data/mysql/data/ \
--user=mysql \
--skip-name-resolve

#增加PATH设置
PATH=$PATH:/data/mysql/bin
# . ~/.bash_profile

# chkconfig --add mysqld
###### chkconfig --level 345 mysqld on

# /etc/init.d/mysqld start OR mysqld_safe & OR service mysqld start
###### mysqld_multi

#修改密码
# mysqladmin -uroot password "xxxxxx"

参数配置:
[mysqld]
server_id=1
federated

datadir=/data/mysql/data
tmpdir=/data/mysql/tmp

skip-external-locking
key_buffer_size = 256M
myisam_sort_buffer_size = 64M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 24

back_log = 1024
max_connections = 1200
table_definition_cache=120000 
table_open_cache =120000    
max_connect_errors = 300

max_allowed_packet = 24M
read_rnd_buffer_size = 4M
read_buffer_size = 4M
join_buffer_size = 4M
sort_buffer_size = 2M
query_cache_limit = 2M

query_cache_size = 1024M
query_cache_min_res_unit=2k
thread_cache_size = 1200
thread_stack = 128K
tmp_table_size = 256M
max_tmp_tables = 256
bulk_insert_buffer_size = 4M
binlog_cache_size = 2M
max_binlog_size = 128M
max_binlog_cache_size= 512M

# log
log-error=/data/mysql/log/log
log-bin=/data/mysql/log/mysql-bin

slow-query-log
slow-query-log-file=/data/mysql/log/slow.log
long_query_time=1
log-queries-not-using-indexes

# innodb
innodb_buffer_pool_size = 20480M
innodb_data_home_dir = /data/mysql/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table= 1
innodb_log_group_home_dir = /data/mysql/log
innodb_log_files_in_group=3
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
#innodb_file_io_threads = 4
innodb_thread_concurrency = 24
innodb_lock_wait_timeout = 100
innodb_flush_method = 'O_DIRECT'
innodb_max_dirty_pages_pct = 75
# innodb_flush_log_at_trx_commit=2

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/756652/viewspace-715414/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/756652/viewspace-715414/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值