mysql php

yum -y install libjpeg-devel libpng-devel freetype-devel libxml2-devel libxslt-devel zlib-devel curl-devel mhash-devel openldap-devel gd-devel


最后贴下正常编译php-5.2.13时支持unixODBC的选项,以备忘
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php/etc --with-iconv=/usr/local/libiconv  --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/local/libxml2 --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-exif --enable-calendar --enable-magic-quotes --enable-wddx --enable-dba --with-qdbm  --with-pdo-mysql --enable-ftp --with-unixODBC=/usr/   &&  make && make install

 

 

 

CentOS5.6
# yum –y install gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libmcrypt* libtool*
#mkdir /var/lib/mysqldata
# groupadd mysql
# useradd -r -g mysql mysql
#chown -R mysql.mysql /var/lib/mysqldata
# wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz or yum install cmake cmake-gui
# tar zxvf cmake-2.8.5.tar.gz
# cd cmake-2.8.5
# ./configure
# make && make install
# wget http://mysql.stu.edu.tw/Downloads/MySQL-5.5/mysql-5.5.14.tar.gz
# tar zxvf mysql-5.5.14.tar.gz
# cd mysql-5.5.14.tar.gz
#md5sum mysql-5.5.14.tar.gz
#show options
#cmake . -LH or cmake .
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLE_DTRACE=1 \
-DMYSQL_DATADIR=/var/lib/mysqldata \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/var/lib/mysqldata/mysql.sock \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \



# make
# make install
#cd /usr/local/mysql
#chown -R mysql.mysql .
# cp support-files/my-medium.cnf /etc/my.cnf
# chmod 755 scripts/mysql_install_db
# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/var/lib/mysqldata
# cp support-files/mysql.server /etc/init.d/mysql
# chmod 755 /etc/init.d/mysqld
# chkconfig mysql on
# export PATH=/usr/local/mysql/bin:$PATH
# alias mysql_start="mysqld_safe &"
# alias mysql_stop="mysqladmin –u root -p shutdown"
# /etc/init.d/mysqld start
# mysql -u root –p
# /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
or # /usr/local/mysql/bin/mysqladmin -u root -h ‘hostname’ password 'new-password'

http://www.cnblogs.com/yd1227/archive/2011/06/08/2074979.html

你可能感兴趣的:(PHP,mysql,数据库,职场,休闲)