Compile and install MySQL 5.5.x in CentOS 5

Source: Internet
Author: User
Tags forum software

Oracle said that, according to internal standards, on Linux, the read/write speed of MySQL 5.5 is 5.1 higher than that of MySQL 360%. On Windows Server, the performance has been improved by more than 1500%.

And our Discuz! And Discuz! The X series can be perfectly compatible with MySQL 5.5 and will not report TYPE errors like any other forum software.

Since the program is compatible and the performance is improved so much, we should select Version 5.5 when installing PHP + MySQL, however, the installation of Version 5.5 on Linux is different from that on other versions of version 5.0.

The following are the recommendation steps in CentOS 5.

1. Install bison and cmake
Tip: the installation of MySQL 5.5 requires the two software. bison can be directly installed with the convenient yum, and cmake can be compiled and installed.
Yum install bison
Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
Tar zxvf cmake-2.8.4.tar.gz
Cd cmake-2.8.4/
./Configure
Gmake
Gmake install

2. Download MYSQL 5.5.13
: Http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.13.tar.gz/from/http://mysql.ntu.edu.tw/
If the download speed is too slow, can you open the http://dev.mysql.com/downloads/mirror.php? Id = 402746
Click No thanks, just take me to the downloads!
The download point list is displayed.

3. Install
Tip: If your MySQL version already exists on the machine, you 'd better uninstall it first to avoid confusion in future use.
Uninstall command: yum remove mysql
If you are not sure whether the machine has MySQL, you can run the uninstall command.

/Usr/sbin/groupadd mysql (if a prompt is displayed, it is not an error)
/Usr/sbin/useradd-g mysql (if a prompt already exists, it is not an error)
Mkdir-p/data/mysql
Chown-R mysql: mysql/data/mysql
Tar zxvf mysql-5.5.13.tar.gz
Cd mysql-5.5.13
Cmake.-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/data/mysql-DSYSCONFDIR =/etc/
Make
Make install

4. Set

Cd/usr/local/mysql
Cp./support-files/my-huge.cnf/etc/my. cnf

Edit/etc/my. cnf
Add in [mysqld]
Datadir =/data/mysql
Wait-timeout = 30
Max_connections = 512
Max_connect_errorrs = 10000000
Default-storage-engine = MyISAM
Modify in the [mysqld] Section
Max_allowed_packet = 16 M

./Scripts/mysql_install_db -- user = mysql
Cp./support-files/mysql. server/etc/rc. d/init. d/mysqld
Chmod 755/etc/rc. d/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig -- level 3 mysqld on

Compile/etc/rc. d/init. d/mysqld
Edit basedir = to basedir =/usr/local/mysql
Edit datadir = to datadir =/data/mysql


Service mysqld start
Bin/mysqladmin-u root password 'password _ for_root'
The enclosed password_for_root is the root password to be set.
Service mysqld restart

Now MySQL 5.5 is installed.

Related Article

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.