Compiling and constructing php + mysql + nginx in Linux (2)

Source: Internet
Author: User
Web servers have always been built with one click, but the environment built with one click is relatively old. If you want to use a new environment, especially the official server, you must manually compile and build it (the following is a linuxcentos6.532-bit server ). 2. Install mysql and go to the installation directory: Cdopt download and unzip: wgeth

Web servers have always been built with one click, but the environment built with one click is relatively old. If you want to use a new environment, especially the official server, you must manually compile and build it (the following is a 32-bit linux centos6.5 server ). 2. Install mysql and go to the installation directory: Cd/opt download and unzip: wget h

Web servers have always been built with one click, but the environment built with one click is relatively old. If you want to use a new environment, especially the official server, you must manually compile and build it (the following is a 32-bit linux centos6.5 server ).

Ii. Install mysql
Go to the installation directory:

 
 
  1. Cd/opt

Download and unzip:

 
 
  1. wget http://downloads.mysql.com/archives/mysql-5.0/mysql-5.5.30.tar.gz
  2. tar -zxf mysql-5.5.30.tar.gz

Compile and install:

 
 
  1. cmake \
  2. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
  3. -DMYSQL_DATADIR=/usr/local/mysql/data \
  4. -DSYSCONFDIR=/etc \
  5. -DWITH_MYISAM_STORAGE_ENGINE=1 \
  6. -DWITH_INNOBASE_STORAGE_ENGINE=1 \
  7. -DWITH_MEMORY_STORAGE_ENGINE=1 \
  8. -DWITH_READLINE=1 \
  9. -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
  10. -DMYSQL_TCP_PORT=3306 \
  11. -DENABLED_LOCAL_INFILE=1 \
  12. -DWITH_PARTITION_STORAGE_ENGINE=1 \
  13. -DEXTRA_CHARSETS=all \
  14. -DDEFAULT_CHARSET=utf8 \
  15. -DDEFAULT_COLLATION=utf8_general_ci
  16. make && make install

Add users and modify permissions:

 
 
  1. groupadd mysql
  2. useradd -g mysql mysql
  3. chown -R mysql:mysql /usr/local/mysql

Enter the installation path and execute the initialization configuration script to create the database and table that comes with the system.

 
 
  1. cd /usr/local/mysql
  2. scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql

Add the service, copy the service script to the init. d directory, and set the startup to start:

 
 
  1. Cp support-files/mysql. server/etc/init. d/mysql
  2. Chkconfig mysql on
  3. Service mysql start -- start MySQL

You can set the PATH to directly call mysql (modify the/etc/profile file and add it at the end of the file ):

 
 
  1. PATH=/usr/local/mysql/bin:$PATH
  2. export PATH

Close the file and run the following command to make the configuration take effect immediately

 
 
  1. source /etc/profile

In addition, mysql5.5 supports cmake. Differences between the two:
./Configure is to execute the script named configure under your current directory, which generates Makefile. With Makefile, You can compile it through make and install make install.
Cmakeword is a compilation tool that is at the same level as makefiles. It only relies on the compilation rules instead of makefiles, and is compiled by cmakelists.txt.
Cmake control: http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html

Which has reference: http://www.cnblogs.com/xiongpq/p/3384681.html


More: http://www.webyang.net/Html/web/article_128.html

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.