Chinaunix首页 | 论坛 | 博客
  • 博客访问: 549958
  • 博文数量: 76
  • 博客积分: 2990
  • 博客等级: 少校
  • 技术积分: 827
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-26 10:53
文章分类

全部博文(76)

文章存档

2011年(47)

2010年(13)

2009年(5)

2008年(11)

分类: Mysql/postgreSQL

2011-07-13 15:58:00

CenOS5.5下编译安装mysql-5.1.58

1.下载安装包
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.58.tar.gz/from/ftp://ftp.ntu.edu.tw/pub/MySQL/

2.依赖包
 yum -y install libtool.x86_64 ncurses.x86_64 ncurses-devel.x86_64  gcc-c++.x86_64

3.解压编译 
tar -zxvf mysql-5.1.58.tar.gz
cd mysql-5.1.58
./configure --prefix=/usr/local/mysql-5.1 --with-extra-charsets=complex --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
make
make install

4.配置
vim /etc/my.cnf
[client]
port            = 3306
socket          = /tmp/mysql.sock

[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
datadir = /var/lib/mysql
skip-external-locking
skip-name-resolve
key_buffer = 1024M
max_allowed_packet = 48M
max_heap_table_size = 64M
max_connect_errors = 10000
max_connections = 10000
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 32M
thread_concurrency = 8
concurrent_insert = 2
max_write_lock_count = 1
interactive_timeout = 600
wait_timeout = 600
expire_logs_days = 30
log-bin=mysql-bin
slow_query_log
long_query_time = 3
log-short-format
log-slave-updates
server-id = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

5.初始化
./bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql/ --skip-name-resolve --defaults-file=/etc/my.cnf

6.启动
/usr/local/mysql-5.1/bin/mysqld_safe --defaults-file=/etc/my.cnf &

备注:
a.  checking for termcap functions library… configure: error: No curses/termcap library found
安装   ncurses.x86_64 ncurses-devel.x86_64  

b.  make 时报错 gcc-c++
安装  gcc-c++.x86_64 ,要从头开始configure



阅读(2706) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~