Mysql 5.5.* compilation and installation steps in Centos6

Source: Internet
Author: User
Tags chmod

The source code of MySQL5.5 is compiled using cmake, which is different from the previous version. The following is a complete compilation and installation process:

1. Download


Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz/from/http://cdn.mysql.com/


2. Install some tools required to compile mysql5.5


Yum install gcc-c ++ cmake ncurses-devel bison-y


3. Create a user


/Usr/sbin/groupadd mysql

/Usr/sbin/useradd-g mysql


4. Decompress, compile, and install


Tar xzvf mysql *

Cd mysql *

CFLAGS = "-O3" CXX = gcc CXXFLAGS = "-O3-felide-constructors-fno-exceptions-fno-rtti" cmake-DMYSQL_USER = mysql \

-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \

-DMYSQL_DATADIR =/var/lib/mysql \

-DMYSQL_UNIX_ADDR =/tmp/mysqld. sock \

-DEXTRA_CHARSETS = all \

-DDEFAULT_CHARSET = utf8 \

-DDEFAULT_COLLATION = utf8_general_ci \

-DWITH_INNOBASE_STORAGE_ENGINE = 1 \

-DENABLED_LOCAL_INFILE = 1 \

-DWITH_EMBEDDED_SERVER = 1 \

-DSERVER-SUFFIX = EMTXDotCom \

-DWITH_DEBUG = 0

Make & make install


5. Some appropriate settings after compilation and installation (Directory permission, startup, etc)


Chmod + w/usr/local/mysql

Chown-R mysql: mysql/usr/local/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

Cp support-files/my-huge.cnf/etc/my. cnf

/Usr/local/mysql/scripts/mysql_install_db -- user = mysql -- defaults-file =/etc/my. cnf -- basedir =/usr/local/mysql/-- datadir =/var/lib/mysql/

Echo "export PATH =/usr/local/mysql/bin: $ PATH">/etc/profile

Source/etc/profile
 

From the above, it seems that the installation and editing of mysql is much simpler than that of php, and configuring permissions is a key point of this installation, because directory operations are required.

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.