下載:wget http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.33.zip
安裝:
unzip mysql-5.1.33.zip
cd mysql-5.1.33.zip
./configure --prefix=/usr/local/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
useradd mysql -d /data/mysql -s/sbin/nologin
/usr/local/mysql/bin/mysql_install_db--user=mysql
cd /usr/local/mysql
chown -R root:mysql .
mkdir -p /data/mysql/data
chown -R mysql /data/mysql/data
cp share/mysql/my-huge.cnf /etc/my.cnf
cp share/mysql/mysql.server/etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysql
service mysqld start
當重新啟動時候總 報以下錯誤:
ERROR! MySQL manager or server PID file could not be found!
Starting MySQL. ERROR! Manager of pid-file quit without updating file.
解決辦法:
MySQL編譯安裝,初始化資料庫的時候出現:
unknown option '--skip-federated' 錯誤。
#vi /etc/my.cnf
#skip-federated 將此行注釋掉即可。或者編譯的時候加上如下參數:--with-plugins=all
如果還是不行的話那麼就是因為您在配置的時候沒有添加datadir,
#vi /etc/my.cnf
添加以下語句:
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql/data
datadir是新加的