|
上一篇文章centos编译安装nginx+php前端,独立mysql中,mysql的版本是5.1.63,这篇文章要给大家演示怎么把mysql 5.5.x的只安装客户端.
系统:centos 5.9 64位
需要的软件:libiconv-1.14.tar.gz mysql-5.5.25a.tar.gz
1.安装前的准备
安装前的准备,可以去看这篇文章centos编译安装nginx+php-fpm+mysql
2.安装libiconv
1 | ./configure --prefix=/usr/local/libiconv |
3.只安装mysql客户端
1 | cmake . && make mysqlclient libmysql |
这样就只安装了mysql客户端,然后可以输入whereis mysql来查看mysql安装位置.
whereis mysql

好了,可以看到跟yum安装的差不多.
4.安装php
以前mysql是5.1的时候,只需要加上--with-mysql=mysql客户端安装目录就可以了,但在mysql 5.5.x这个参数就要改变下了,下面是php的编译参数:
1 | ./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --with-fpm-log=/var/log/php-fpm.log --with-fpm-conf=/etc/php-fpm.conf \ |
2 | --with-fpm-pid=/var/run/php-fpm.pid --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d \ |
3 | --with-openssl --with-zlib --enable-bcmath --with-bz2 --with-curl --enable-ftp \ |
4 | --with-gd --enable-gd-native-ttf --with-jpeg-dir --with-png-dir --with-gettext --with-mhash \ |
5 | --enable-mbstring --with-mcrypt --enable-soap --enable-zip --with-iconv=/usr/local/libiconv \ |
6 | --with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config |
大家可以看最后一行,--with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config这就是跟以前不同的行.好了,剩下的就不写了,跟以前差不多.
本文摘自:http://blog.slogra.com/post-372.html
|
|