浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
yum install gcc
yum install gcc-c++

groupadd mysql
useradd --shell /sbin/nologin -g mysql mysql
tar zxvf mysql-5.1.51.tar.gz
cd mysql-5.1.51

./configure --prefix=/usr/local/mysql \
            --localstatedir=/usr/local/mysql/data \
            --with-charset=utf8 \
            --with-collation=utf8_general_ci \
            --with-extra-charsets=gb2312,gbk \
            --with-plugins=max-no-ndb \
            --with-unix-socket-path=/tmp/mysql.sock \
            --enable-local-infile \
            --enable-assembler \
            --with-client-ldflags=-all-static \
            --with-mysqld-ldflags=-all-static \
            --enable-thread-safe-client

make
make install

cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
chmod u+x /etc/init.d/mysql

cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root  .
chown -R mysql data
chgrp -R mysql .

chkconfig --add mysql
chkconfig --level 345 mysql on
bin/mysqld_safe --user=mysql &
service mysql restart

ln -s /usr/local/mysql/bin/mysql /sbin/mysql
ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin
mysqladmin -uroot password "yourpassword"



reference:
http://www.sqlstudy.com/article/mysql-compile-install-under-linux-centos-5.html
posted on 2012-02-26 12:05  lexus  阅读(168)  评论(0编辑  收藏  举报