商务合作加Q:411239339

mysql-5.1 编译参数优化

浏览:254次阅读
没有评论

共计 1890 个字符,预计需要花费 5 分钟才能阅读完成。

-static  13% 
   --with-client-ldflags=-all-static
   --with-mysqld-ldflags=-all-static
静态链接提高 13% 性能

Unix Socket  7.5%
--with-unix-socket path=/usr/local/mysql/tmp/mysql.sock

使用 unix 套接字链接提高 7.5% 性能,所以在 windows 下 mysql 性能肯定不如 unix 下面

--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-tables option, 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 支持从本地文件 导入数据库
 load 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 存储引擎
 Mysql5.1 开始,编译添加 innodb 插件就从 --with-innodb 改成了 --with-plugins=innobase
 
--with-plugins=PLUGIN[[[,PLUGIN..]]] 
                                                     Plugins to include in mysqld. (default is : none) 
                                                     Must be a configuration name or a comma separated 
                                                     list of plugins. 
                                                     Available configurations are: none max max-no-ndb 
                                                     all. 
                                                     Available plugins are: partition daemon_example 
                                                     ftexample archive blackhole csv example federated 
                                                     heap innobase myisam myisammrg ndbcluster
  如果多个插件, 可以写成:--with-plugins=partition,blackhole,heap,innobase,myisam,ndbcluster 用逗号分开
 
实例:

./configure –prefix=/usr/local/mysql --enable-assembler --with-unix-socket-path=/tmp/mysql.sock --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static  --with-extra-charsets=gbk,gb2312,utf8 --enable-thread-safe-client --with-big-tables --enable-local-infile --with-ssl

make && make install

 

正文完
扫码赞助
post-qrcode
 0
果子
版权声明:本站原创文章,由 果子 于2014-08-27发表,共计1890字。
转载说明:除特殊说明外本站文章皆由果较瘦原创发布,转载请注明出处。
评论(没有评论)