日期:2014-05-16  浏览次数:20715 次

Linux 从二进制版安装 MySQL 5
http://wangyan.org/blog/install-mysql-from-binaries.html

mysql_install.sh

source config.sh 

groupadd mysql
useradd -g mysql mysql

cd $SRC

tar zxvf mysql5.tar.gz -C /usr/local/

mv  /usr/local/mysql-5.1.60-linux-x86_64-glibc23/ /usr/local/mysql

cd /usr/local/mysql

mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak

cd mysql

chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql

chown -R root .

chown -R mysql data

mkdir /etc/mysql

cp support-files/my-medium.cnf /etc/mysql/my.cnf

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

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

chkconfig --add mysql

cd /usr/local/mysql/

bin/mysqladmin -u root -p password "123456"