CentOS 6.2 compilation and installation of MySQL5.5.25

Source: Internet
Author: User

Previously, all the systems installed in the virtual machine were Ubuntu. Later, my colleagues said that the general servers were CentOS, so they reset the centos system.

Of course, you must first build a PHP environment. The downloaded source code mysql is 5.5.25, and the latest version seems to be 5.5.4. Remember to download the Source Code. When you download the Source Code from the mysql official website, you will be prompted to select a platform and select the bottom Source Code from the drop-down menu.

After installing ubuntu, you cannot start mysql. The error code is "The server quit without updating PID file (/var/lib/mysql/CentOS. pid) ", Baidu and google both searched for some information, which is basically the same. It didn't help me, and it won't work even if they modified the information as they said. Finally, it is done successfully.

Step 1: first install the dependency library and development tools

# Dependency library and development tool 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 # Nginxyum-Y install pcre-devel zlib-Devel # Phpyum-Y install gd-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel curl-devel freetype-Devel # Mysqlyum-Y install bison gcc-c ++ autoconf automake zlib * libxml * ncurses-devel libtool-ltdl-devel * mysql-devel
Step 2: Since mysql5.5 is started, instead of using configure for installation, cmake is used. Therefore, you need to install cmake first.
wget http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gztar -zxvf cmake-2.8.6.tar.gzcd cmake-2.8.6/./configuremake && make install

Step 3: Install mysql using cmake (I have downloaded the mysql source code file, put it in a USB flash drive, and copy it to the/tmp directory)

//Go to the/tmp directoryTar-zxvf mysql-5.5.25.Tar.gz cd mysql-5.5.25Cmake \-DCMAKE_INSTALL_PREFIX =/usr/local/webserver/Mysql \-DMYSQL_DATADIR =/user/local/webserver/mysql/Data \-DSYSCONFDIR =/Etc \-DEXTRA_CHARSETS =All \-DDEFAULT_CHARSET =Utf8 \-DDEFAULT_COLLATION =Utf8_general_ci \-DWITH_INNOBASE_STORAGE_ENGINE =1\-DWITH_ARCHIVE_STORAGE_ENGINE =1\-DWITH_BLACKHOLE_STORAGE_ENGINE =1\-DWITH_FEDERATED_STORAGE_ENGINE =1\-DWITH_PARTITION_STORAGE_ENGINE =1\-DWITH_PERFSCHEMA_STORAGE_ENGINE =1\-DMYSQL_UNIX_ADDR =/tmp/Mysqld. sock \-DMYSQL_TCP_PORT =3306\-DWITH_DEBUG =0\-DENABLED_LOCAL_INFILE =1

Press enter to execute. After the execution is complete, continue to execute make & make install.

Step 4: Set mysql

# Setting Mysql # In support-There are five configuration files in the files directory (it is important to copy the corresponding cnf file based on your memory, or mysql will never start): # my-Small. cnf (memory <=64 M) # my-Medium. cnf (memory 128 M) # my-Large. cnf (memory 512 M) # my-Huge. cnf (memory 1 GB-2G) # my-Innodb-heavy-4G. cnf (memory 4 GB) cd/Usr/local/webserver/Mysqlcp.// Support-files/my-huge.cnf/etc/My. cnf vi/Etc/My. cnf # Add datadir in [mysqld]=/Data/Mysqlwait-Timeout =30Max_connections=512Default-Storage-engine =MyISAM # modify max_allowed_packet in the [mysqld] Section= 16 M
  • 1
  • 2
  • Next Page

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.