採用編譯安裝MySQL 5.1.33 ,安裝路徑手動指定
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
unzip mysql-5.1.33.zip
cd mysql-5.1.33/
./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase
make && make install
chmod +w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
cp support-files/my-medium.cnf /usr/local/webserver/mysql/my.cnf
cd ../
初始化安裝資料包中使用的一些參數
/usr/local/webserver/mysql/bin/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/webserver/mysql/ --datadir=/usr/local/webserver/mysql/data/ --user=mysql --pid-file=/usr/local/webserver/mysql/mysql.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock
啟動mysql使用的一些參數
/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --user=mysql --log-error=/usr/local/webserver/mysql/mysql.log --defaults-file=/usr/local/webserver/mysql/my.cnf &
注意查看記錄檔mysql.log 便於找到問題
解決:webserver mysql-bin.index not found errcode 13
chown -R mysql:mysql .
http://xingxing5421.blog.163.com/blog/static/1194463192010711102923695/
centos安裝mysql
http://blog.chinaunix.net/u1/37270/showart_300905.html