Centos5.5 compile and install mysql5.5.9

Source: Internet
Author: User
Centos5.5 compile and install mysql5.5.9 CentOS

Create a mysql User [root@xuhost opt]# useradd -g mysql mysql3307 -s /bin/nologin -d /usr/local/mysql3307 Create a data directory [root@xuhost opt]# mkdir /mysqldata/dirdata/mysql3307 [root@xuhost opt]# chown mysql.mysql -R /mysqldata/dirdata/mysql3307 Install cmake

[root@xuhost opt]# wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz

[root@xuhost opt]# tar zxvf cmake-2.8..tar.gz

[root@xuhost opt]# ./Configure

[root@xuhost opt]# cd cmake-2.8.

[root@xuhost cmake-2.8.]# make install

Install mysql5.5.

[root@xuhost opt]# tar zxvf mysql-5.5..tar.gz

[root@xuhostopt]# cd mysql-5.5.

[root@xuhost mysql-5.5.]# cmake . /

-DCMAKE_INSTALL_PREFIX=/mysqldata/mysql3307/ /

-DMYSQL_DATADIR=/mysqldata/dirdata/mysql3307/

-DWITH_INNOBASE_STORAGE_ENGINE= /

-DENABLED_LOCAL_INFILE= /

-DMYSQL_TCP_PORT= /

-DEXTRA_CHARSETS=all / -DDEFAULT_CHARSET=utf8 / -DDEFAULT_COLLATION=utf8-general_ci /

-DMYSQL_UNIX_ADDR=/mysqldata/dirdata/mysql3307/mysql.sock /

-DMYSQL_USER=mysql3307 /

-DWITH_DEBUG=

[root@xuhost mysql-5.5.]# make

[root@xuhost mysql-5.5.]# make install

Copy the configuration file

[root@xuhost mysql-5.5.]# cp support-files/my-medium.cnf /etc/my.cnf

Copy the startup script

[root@xuhost mysql-5.5.]# cp support-files/mysql.server /etc/init.d/mysqld

[root@xuhost mysql-5.5.]# chmod /etc/init.d/mysqld

Initialize the database (go to the installation directory)

[root@xuhost mysql5.5.9]# ./scripts/mysql_install_db –user=mysql –ldata=/var/mysql

START database

[root@xuhost mysql5.5.9]# /etc/init.d/mysqld start

Myslq 5.5.Summary of errors during compilation of the above versions:

CMake Warning: The variable, 'MYSQL_USER', specified manually, was not used during the generation.

You need to remove MYSQL_USER from the pre-compilation to make the pre-compilation successful!

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.