/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
在mysql安装路径根目录执行:
chown -R mysql:mysql .
centos安装mysql