Chinaunix首页 | 论坛 | 博客
  • 博客访问: 290386
  • 博文数量: 49
  • 博客积分: 4776
  • 博客等级: 中校
  • 技术积分: 486
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-02 10:42
文章分类

全部博文(49)

文章存档

2010年(6)

2009年(8)

2008年(20)

2007年(10)

2006年(2)

2005年(3)

分类: Mysql/postgreSQL

2008-11-20 15:36:13

我的环境:
我的主机是CentOS5.2,已经安装了默认自带的mysql5045,现在想安装最新的5129和607来做测试
 
安装注意事项:
配置时的路径如下填写
./configure --with-tcp-port=5506 --with-unix-socket-path=/opt/MySQL5129 --prefix=/opt/MySQL5129
 
./configure --with-tcp-port=5507 --with-unix--socket-path=/opt/MySQL607 --prefix=/opt/MySQL607
 
 
--with-unix-socket-path这个参数可以不要,最后在my.cnf里面指定socket文件存放在什么路径
 
make
make install
这两步就没有什么好说的了
 
安装后的配置:
初始化数据库权限表
./mysql_install_db --basedir=/opt/MySQL5129 --datadir=/opt/MySQL5129/var --user=mysql

./mysql_install_db --basedir=/opt/MySQL607 --datadir=/opt/MySQL607/var --user=mysql
配置/etc/my.cnf参数文件:
[mysqld5129]
port=5506
socket=/tmp/mysql5129.sock
basedir=/opt/MySQL5129
datadir=/opt/MySQL5129/var
user=mysql
log-error=/var/log/mysqld5129.log
pid-file=/tmp/mysqld5129.pid

[mysqld607]
port=5507
socket=/tmp/mysql607.sock
basedir=/opt/MySQL607
datadir=/opt/MySQL607/var
user=mysql
log-error=/var/log/mysqld607.log
pid-file=/tmp/mysqld607.pid
 
 
启动数据库:
/opt/MySQL5129/bin/mysqld_multi start|stop  5129
/opt/MySQL607/bin/mysqld_multi start|stop  607
 
 
连接数据库:
mysql --socket=/tmp/mysql5129.sock
mysql --socket=/tmp/mysql607.sock
 
 
CU的yejr也推荐用mysqlmanager来管理mysql
有时间安装mysqlmanager来看看
 
 
 
常见的编译参数:
--without-debug
--with-low-memory
--with-charset=cp1251(gbk,gb2312,utf8)
--with-collation=cp1251_general_ci(gbk,gb2312,utf8)
--with-extra-charset=all
--with-plugins
--with-mysqld-ldflags=-all-static
 
 
mysqlperformanceblog在Freebsd平台上编译客户端的一个示例
./configure
'--localstatedir=/var/db/mysql'
'--without-debug'
'--without-readline'
'--without-libedit'
'--without-bench'
'--without-extra-tools'
'--with-libwrap'
'--with-mysqlfs'
'--with-low-memory'
'--with-comment=FreeBSD port: mysql-client-5.0.67_1'
'--enable-thread-safe-client'
'--with-charset=cp1251'
'--with-collation=cp1251_general_ci'
'--with-extra-charset=all'
'--with-named-thread-libs=-pthread'
'--without-server'
'--prefix=/usr/local'
'--mandir=/usr/local/man'
'--infodir=/usr/local/info/'
'--build=amd64-portbld-freebsd7.0'
'CC=cc' 'CFLAGS=-O2 -mmmx -msse -msse2 -msse3 -pipe -march=nocona  -fno-strict-aliasing'
'CXXFLAGS=-O2 -mmmx -msse -msse2 -msse3 -pipe -march=nocona -fno-strict-aliasing -O2 -mmmx -msse -msse2 -msse3 -pipe -march=nocona  -fno-strict-aliasing -felide-constructors -fno-rtti -fno-exceptions'
'CXX=c++'
'build_alias=amd64-portbld-freebsd7.0'
 
 
 
linux平台下的一个示例
./configure --prefix=/usr/local/mysql
--with-charset=utf8                     
--with-collation=utf8_general_ci  
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--enable-assembler
--enable-thread-safe-client
–without-debug
--enable-local-infile
--with-big-tables
--with-ssl
--without-readline
--with-plugins=innodb,partition
--with-fast-mutexes
--with-zlib-dir=bundled
--with-××ded-server
--with-pthread
 
CFLAGS="-O3" CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
./configure
--prefix=/usr/local/mysql
--localstatedir=/data/mysql/data
--enable-assembler
--with-charset=utf8
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--with-innodb
--with-plugins=partition
 
mysql编译参数详解


./configure \
--prefix=/usr/local/mysql \
--enable-assembler \
--without-debug \
--with-charset=utf8 \
--with-extra-charsets=all \
--with-pthread \
--enable-thread-safe-client \
--enable-local-infile \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--with-big-tables \
--without-innod \
--without-isam 2;
--with-ssl \
--with-embedded-server \


--enable-assembler \使用一些字符函数的汇编版本
--without-debug \去除debug模式
--with-charset=utf8 \
--with-extra-charsets=complex字符支持
--with-pthread \强制使用pthread库(posix线程库)
--enable-thread-safe-client \以线程方式编译客户端
--with-client-ldflags=-all-static \以纯静态方式编译客户端
--with-mysqld-ldflags=-all-static \以纯静态方式编译服务端
--with-big-tables
There is a limit of 232 (~4.295E+09) rows in a MyISAM table. If you build MySQL with the --with-big-tables option, the row limitation is increased to (232)2 (1.844E+19) rows
--without-innodb \去掉innodb表支持,innodb是一种支持事务处理的表,适合企业级应用
--enable-local-infile #让mysql支持从本地文件 导入数据库
--without-isam \去掉isam表类型支持,现在很少用了,isam表是一种依赖平台的表
--with-embedded-server #编译成embedded MySQL library (libmysqld.a)

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