始创于2000年 股票代码:831685
咨询热线:0371-60135900 注册有礼 登录
  • 挂牌上市企业
  • 60秒人工响应
  • 99.99%连通率
  • 7*24h人工
  • 故障100倍补偿
您的位置: 网站首页 > 帮助中心>文章内容

CentOS 4.8 编译安装 MySQL 5.x 版本系列

发布时间:  2012/8/29 17:07:31

一、编译 MySQL5.0
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --enable-thread-safe-client --enable-local-infile --enable-assembler --enable-community-features --enable-profiling --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-mysqld-user=mysql --without-embedded-server  --with-big-tables --with-server-suffix=-community --with-unix-socket-path=/usr/local/mysql/etc/mysql.sock --without-debug --without-man --without-docs --without-bench --with-csv-storage-engine --with-blackhole-storage-engine --with-federated-storage-engine

编译完成后的配置(其它版本的操作类似)
# cd /usr/local/mysql
# cp share/mysql/my-medium.cnf /etc/my.cnf
# mkdir etc
安装数据库文件
# ./bin/mysqld_install_db
# chown -R mysql:mysql .
# ./bin/mysqld_safe --user=mysql &

二、编译 MySQL5.1
# ./configure --prefix=/usr/local/mysql5.1 --localstatedir=/usr/local/mysql5.1/data --enable-thread-safe-client --enable-local-infile --enable-assembler --enable-community-features --enable-profiling --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-mysqld-user=mysql --without-embedded-server  --with-big-tables --with-server-suffix=-community --with-unix-socket-path=/usr/local/mysql/etc/mysql.sock --without-debug --without-man --without-docs --with-plugins=partition,blackhole,csv,federated,heap,innobase,myisam

编译 innodb_plugin 需要升级 gcc 版本
# export CFLAGS="-O2 -DHAVE_DLOPEN=1"
# export CXXFLAGS="-O2 -DHAVE_DLOPEN=1"
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --enable-thread-safe-client --enable-local-infile --enable-assembler --enable-community-features --enable-profiling --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-mysqld-user=mysql --without-embedded-server  --with-big-tables --with-server-suffix=-community --with-unix-socket-path=/usr/local/mysql/etc/mysql.sock --without-debug --without-man --without-docs --with-plugins=partition,blackhole,csv,federated,heap,innobase,innodb_plugin,myisam --disable-static

使用 innodb_plugin 需要编辑配置文件 my.cnf 增加如下内容:
#禁用旧的 innodb
ignore_builtin_innodb
# 启用 innodb plugin
plugin_load=innodb=ha_innodb_plugin.so
# 设置新的数据文件格式,支持表数据和索引的压缩
innodb_file_format=barracuda
# 使用独立的表空间
innodb_file_per_table
# 严格的检查模式
innodb_strict_mode=1

三、编译 MySQL5.5
MySQL5.5 版本使用了CMake来编译,它是跨平台的编译工具
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data  -DSYSCONFDIR=/usr/local/mysql/etc -DDEFAULT_CHARSET=utf8 -DMYSQL_UNIX_ADDR=/usr/local/mysql/etc/mysql.sock


本文出自:亿恩科技【www.enkj.com】

服务器租用/服务器托管中国五强!虚拟主机域名注册顶级提供商!15年品质保障!--亿恩科技[ENKJ.COM]

  • 您可能在找
  • 亿恩北京公司:
  • 经营性ICP/ISP证:京B2-20150015
  • 亿恩郑州公司:
  • 经营性ICP/ISP/IDC证:豫B1.B2-20060070
  • 亿恩南昌公司:
  • 经营性ICP/ISP证:赣B2-20080012
  • 服务器/云主机 24小时售后服务电话:0371-60135900
  • 虚拟主机/智能建站 24小时售后服务电话:0371-60135900
  • 专注服务器托管17年
    扫扫关注-微信公众号
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 亿恩科技 版权所有  地址:郑州市高新区翠竹街1号总部企业基地亿恩大厦  法律顾问:河南亚太人律师事务所郝建锋、杜慧月律师   京公网安备41019702002023号
      0
     
     
     
     

    0371-60135900
    7*24小时客服服务热线