Compile and install MySQL 5.5.10 in CentOS 5.5

Source: Internet
Author: User

Install MySQL 5.5.10 for Linux
Operating System: CentOS 5.5
MySQL: 5.5.10

Use the yum Command provided by CentOS Linux to install and upgrade the required libraries (RedHat and other Linux distributions can find the RPM packages of these libraries from the installation CD and install them on www.bkjia.com ):

Sudo-s
LANG = C
Yum-y install gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses- devel curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel openldap-devel nss_ldap openldap-clients openldap-servers

# Download cmake

Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz

# Install cmake
Tar xvzf cmake-2.8.4.tar.gz
./Configure
Make
Make install


# Create a mysql user name and group

/Usr/sbin/groupadd mysql
/Usr/sbin/useradd-g mysql

# Download the latest mysql
Wget ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/mysql-5.5.10.tar.gz

# Decompress
Tar zxvf mysql-5.5.10.tar.gz
Cd mysql-5.5.10

# Start compilation and Installation

/Usr/local/bin/cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/webserver/mysql/-DMYSQL_DATADIR =/usr/local/webserver/mysql/data-encoding = 1-bit = 3306-DMYSQL_UNIX_ADDR =/usr/local /webserver/mysql/data/mysql. sock-DMYSQL_USER = mysql-DWITH_DEBUG = 0

Make & make install
Chmod + w/usr/local/webserver/mysql
Chown-R mysql: mysql/usr/local/webserver/mysql
Cp support-files/my-small.cnf/etc/my. cnf
Chown mysql: mysql/etc/my. cnf

Execute the following
/Usr/local/webserver/mysql/scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/webserver/mysql -- datadir =/usr/local/webserver/mysql/data

Open the following InnoDB configuration in/etc/my. cnf to reduce the memory:
Default-storage-engine = MyISAM
Server-id = 1
Innodb_buffer_pool_size = 21 M
Innodb_additional_mem_pool_size = 2 M
Innodb_log_file_size = 5 M
Innodb_log_buffer_size = 8 M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50

Start: With -- user = mysql
/Usr/local/webserver/mysql/bin/mysqld_safe -- user = mysql

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.