Lnmp =linux+nginx+mysql+php
In the past we have done lamp environment, and for Nginx, its performance relative to Apache improved a lot, experiments with the help of Nginx to LNMP environment, the environment to build a three-step: MySQL Green package installation, PHP source package installation, Nginx source package installation Finally Phpwind application
A installing MySQL
1.[root@localhost]# TAR-ZXVF mysql-5.5.15-linux2.6-i686.tar.gz-c/usr/local
[root@localhost local]# mv mysql-5.5.15-linux2.6-i686 MySQL
2 >mysql Configuration
Go to MySQL folder and start configuration
Note: In fact, MySQL developers in order to facilitate our control of MySQL configuration, has been the configuration of the steps to the detailed written out, we can refer to their configuration steps to configure, file name: Install-binary, you can open this file to refer to the configuration
[Root@localhost mysql]# Clear
[Root@localhost mysql]# Groupadd MySQL
[Root@localhost mysql]# useradd-r-g MySQL MySQL
[Root@localhost mysql]# chown-r MySQL.
[Root@localhost mysql]# chgrp-r MySQL.
[Root@localhost mysql]# scripts/mysql_install_db--user=mysql #初始化数据库
[Root@localhost mysql]# chown-r root.
[root@localhost mysql]# chown-r mysql data #让data目录属于用户mysql
[Root@localhost mysql]# CP support-files/my-medium.cnf/etc/my.cnf
#配置文件放在 the/etc/directory
[Root@localhost mysql]#
[Root@localhost mysql]# bin/mysqld_safe--user=mysql & #运行mysql数据库
[Root@localhost mysql]# CP Support-files/mysql.server/etc/init.d/mysqld
[root@localhost mysql]# Service mysqld start
Starting MySQL [OK]
3> into the database
Because it is the source of MySQL installed, so now can not directly use the command: MySQL to enter the MySQL database, its startup files in the/usr/local/mysql/bin directory is file: MySQL
Access to MySQL (provided it is already in the MySQL directory)
[Root@localhost mysql]# Bin/mysql
This can go into MySQL, but this method is very troublesome, every time you start MySQL to find this file, so we can do some optimization, the MySQL startup script to add to the environment variables, let us directly use the command: MySQL to access the database
[Root@localhost bin]# Vim/etc/profile
Add the following:
Path= $PATH:/usr/local/mysql/bin
[Root@localhost bin]# source/etc/profile//Make environment variable effective
Enter MySQL
[Root@localhost bin]# MySQL
[Root@localhost bin]# chkconfig--add mysqld
[Root@localhost bin]# chkconfig--list |grep mysqld
Mysqld 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
Now, although it has been able to boot up, but can not load MySQL library files and header files
Set it below
[Root@localhost ~]# CD/ETC/LD.SO.CONF.D
The suffix must be:. conf
To add code to the file:
/usr/local/mysql/lib
Apply Lib File
[Root@localhost ld.so.conf.d]# ldconfig-v |grep MySQL
/usr/local/mysql/lib:
libmysqlclient.so.18-> libmysqlclient_r.so.18.0.0
To add a boot-in-Use header path
[Root@localhost ld.so.conf.d]# cd/usr/local/include/
[Root@localhost include]# ln-s/usr/include/local/mysql/include MySQL
Do a header file for MySQL file directory path, name for MySQL