编译安装mysql-5.0.46

groupadd mysql 
useradd -g mysql mysql
tar zxvf mysql-5.0.46.tar.gz;
cd mysql-5.0.46;

./configure --prefix=/usr/local/mysql --localstatedir=/data/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-ndb-debug --without-isam

make

make install

cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

cd /usr/local/mysql 

bin/mysql_install_db --user=mysql 

chown -R root .

chown -R mysql /data/mysql

chgrp -R mysql . 

rm -f /usr/bin/mysqld_safe
rm -f /usr/bin/mysqld
rm -f /usr/bin/mysql
rm -f /usr/bin/mysqldump

ln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/mysqld_safe

ln -s /usr/local/mysql/share/mysql/mysql.server /usr/bin/mysqld 

ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

ln -s /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump
rm -rf /usr/lib/mysql
rm -rf /usr/include/mysql

ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql

ln -s /usr/local/mysql/include/mysql /usr/include/mysql

echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf

ldconfig 

cp support-files/mysql.server /etc/rc.d/init.d/mysqld

chmod 777 /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig --level 35 mysqld on


你可能感兴趣的:(mysql,编译安装)