Install and compile MySQL5.5.28 and compile mysql5.5.28

Source: Internet
Author: User

Install and compile MySQL5.5.28 and compile mysql5.5.28
Zookeeper

This section briefly introduces the compilation and Installation Process of MySQL5.5.28. MySQL does not use the Classic./configure make install trilogy during compilation and installation after MySQL 5.5. The specific steps are cmake make install.

Download mysql-5.5.28.tar.gz and decompress it in linux.

Tar-xvf MySQL-5.5.28.tar.gz

② Preparations before installation.

Yum-y install cmake

Yum-y install ncurses-devel

Yum-y install bison

Yum-y install gcc

Yum-y install gcc-c ++

Groupadd mysql

Useradd-r-g mysql-s/sbin/nologinmysql // create a mysql user and a mysql Group

Mkdir-p/data/mydata // MySQL directory

Chown-R mysql. mysql/data/mydata/* // change the owner group of files in the data directory to mysql

 

Enter the MySQL directory for compilation.

Cd mysql-5.5.28

Cmake.-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/data/mydata

-DSYCONFDIR =/etc-DWITH_INNOBASE_STORAGE_ENGINE = 1

-DWITH_ARCHIVE_STORAGE_ENGINE = 1-DWITH_BLACK_STORAGE_ENGINE = 1

-DWITH_SSL = system-DWITH_UNIX_ADDR =/tmp/mysql. sock-DDFAULT_CAHRSET = UTF8

-- DDFAULT_COLLATON = utf8_general_ci

If the corresponding dependency problem is not solved during compilation, an error occurs. If an error occurs, re-compile the text, delete cmakecache.txt manually, and re-compile the text.

Then make & make install

Initialize data after compilation

Cd/usr/local/msyql

Scripts/msyql_install_db // initialize the mysql database

Cp/cp my-huge.cnf/etc/my. cnf // copy the configuration file

Cp mysql. server/etc/init. d/mysqld // copy the system configuration file as the default startup script

Chkconfig-add mysqld

Vi/etc/profile. d/mysqld. sh

Export PATH = $ PATH:/usr/local/mysql/bin // Add the installation directory PATH of mysql to the system PATH.

Execute the script sh mysqld. sh, and the system path configuration will take effect.

The following problems occur during compilation.

MySQL server PID file cocould not be found! [Failed]

Starting MySQL... The server quit withoutupdating PID file

If such an error occurs, there are many solutions on the Internet. My problem is:

I. Open the configuration file and check whether the data directory path is added to the configuration file on the [mysqld] server. If not, add

Datadir =/data/mydata

 

II. View mysql logs. If not specified, the default location is/mysql/ocalhost. localdomain. err in the/data directory. Note that the owner Group of the data directory must be changed to the mysql user and mysql group. Otherwise, the corresponding PID alarm information is displayed.

③ If the installation is correct, you can start the mysql service. Servicemysqld start and chkconfig mysqld on are finished.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.