Compile and install MySQL 5.x series in CentOS 4.8

Source: Internet
Author: User

1. Compile MySQL5.0
#. /Configure -- prefix =/usr/local/mysql -- localstatedir =/usr/local/mysql/data -- enable-thread-safe-client -- enable-local-infile -- enable-validator -- enable-community-features -- enable-profiling -- with-client-ldflags =-all-static -- with-mysqld-ldflags =-all-static -- with-charset = utf8 -- -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-example -- with-csv-storage-engine -- with-blackhole-storage-engine -- with-federated-storage- engine

Configuration after compilation (operations in other versions are similar)
# Cd/usr/local/mysql
# Cp share/mysql/my-medium.cnf/etc/my. cnf
# Mkdir etc
Install database files
#./Bin/mysqld_install_db
# Chown-R mysql: mysql.
#./Bin/mysqld_safe -- user = mysql &

Ii. Compile MySQL5.1
#. /Configure -- prefix =/usr/local/mysql5.1 -- localstatedir =/usr/local/mysql5.1/data -- enable-thread-safe-client -- enable-local-infile -- enable-encryption er -- enable-community-features -- enable-profiling -- with-client-ldflags =-all-static -- with-mysqld-ldflags =-all-static -- with-charset = utf8 -- -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

To compile innodb_plugin, You need to upgrade the gcc version.
# 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-validator -- enable-community-features -- enable-profiling -- with-charset = utf8 -- with-collation = utf8_general_ci -- with-extra-charsets = all -- with-mysqld-user = mysql -- -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

To use innodb_plugin, edit the configuration file my. cnf and add the following content:
# Disable old innodb
Ignore_builtin_innodb
# Enable innodb plugin
Plugin_load = innodb = ha_innodb_plugin.so
# Set a new data file format and support table data and index compression
Innodb_file_format = barracuda
# Using independent tablespaces
Innodb_file_per_table
# Strict check Mode
Innodb_strict_mode = 1

Iii. Compile MySQL5.5
MySQL5.5 uses CMake for compilation. It is a cross-platform compilation tool.
# Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/usr/local/mysql/data-DSYSCONFDIR =/usr/local/mysql/etc-DDEFAULT_CHARSET = utf8-character = /usr/local/mysql/etc/mysql. sock

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.