分享我自己mysql 5.1安装时的编译参数详解

-with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
一般来说,用静态库比用动态库要快,手册上也是这么说的。

--enable-thread-safe-client
这个呢,我怎么感觉更像是说使线程安全(thread-sa

--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
一般来说,用静态库比用动态库要快,手册上也是这么说的。

--enable-thread-safe-client
这个呢,我怎么感觉更像是说使线程安全(thread-safe)?
而且看手册,似乎只对 C 有效?因为它在 C API 章节中详细提到,而且说除了 mysql_real_connect() 这个函数,其他都是 thread-safe 的。
这个不懂。

还无意中发现手册上说如果机器的 cpu 是奔腾的话,用 pgcc 代替 gcc,那样编译出来的系统性能会再好上 10%。

---------------------------------------------------------------------------------------------------------------

# ./configure --prefix=/usr/local/mysql   //*指定安装目录

--without-debug    //*去除debug模式

--with-charset=gb2312   //*添加gb2312中文字符支持

--enable-assembler    //*使用一些字符函数的汇编版本

--without-isam    //*去掉isam表类型支持 现在很少用了 isam表是一种依赖平台的表

--without-innodb //*去掉innodb表支持 innodb是一种支持事务处理的表,适合企业级应用

--with-pthread    //*强制使用pthread库(posix线程库)

--enable-thread-safe-client   //*以线程方式编译客户端

--with-client-ldflags=-all-static

--with-mysqld-ldflags=-all-static   //*以纯静态方式编译服务端和客户端

----------------------------------------------------------------------------------------------------------------

#!/bin/bash

#wirte by badb0y

wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.31.tar.gz/from/http://mysql.easynet.be/
tar -zxvf mysql-5.1.31.tar.gz
cd mysql-5.1.31
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all --enable-assembler --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile

./configure --prefix=/usr/local/mysql --datadir=/mydata --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-ssl --with-embedded-server --enable-local-infile --enable-assembler --with-plugins=innobase --with-plugins=partition

#适合目前我自己使用的配置
make;make install

groupadd mysql
useradd -g mysql mysql
cp /usr/local/src/software/mysql-5.1.36/suppor-files/my-large.cnf /etc/my.cnf
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql(如果要修改datadir,请在修改完my.cnf再运行这句)
chmod +w /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
service mysql start
----------------------------------------------------------
原文地址:http://blog.chinaunix.net/u/249/showart_1842843.html

./configure --prefix=/usr/local//mysql/

--enable-assembler

The --enable-assembler options of configure allows for
compiling in x86 (and sparc) versions of common string
operations, which should result in more performance.
汇编x86的普通操作符,可以提高性能

--with-extra-charsets=complex字符支持

--enable-thread-safe-client #Compile the client with threads. 也就是让客户端支持线程的意思

--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-tablesoption, the row limitation is increased to (232)2 (1.844E+19) rows

--with-ssl

--with-embedded-server   #编译成embedded MySQL library (libmysqld.a),

--enable-local-infile #让mysql支持从本地文件 导入数据库

(l> oad data local infile '/usr/test' into table test fields terminated by ' ';
ERROR 1148 (42000): The used command is not allowed with this MySQL version)

--with-plugins=innobase存储引擎

posted @ 2012-09-12 22:51  luoxiake  阅读(209)  评论(0编辑  收藏  举报