从http://dev.mysql.com/downloads/mysql/为您的平台下载所需的MySql通用二进制文件,
然后使用简单的linux脚本(从/ share目录中运行的安装二进制文件运行)进行安装,请参阅以下有关我使用的脚本的信息多年,工作了5.1,5.5,5.6
注意:1.MySql 5.6没有默认的“ my.cnf”,因此请小心2.确保卸载任何现有的MySql安装程序
例如
#!/bin/sh
DOWNLOAD_DIR="/share"
ZIP_FILE=mysql-enterprise-5.1.55-linux-x86_64-glibc23.tar.gz
MYSQL_DIR=mysql-enterprise-5.1.55-linux-x86_64-glibc23
if test -f $DOWNLOAD_DIR/mysql-enterprise-5.1.55-linux-x86_64-glibc23.tar.gz; then
echo "Starting MySql 64 bit install..."
elif test -f $DOWNLOAD_DIR/mysql-enterprise-5.1.55-linux-i686-glibc23.tar.gz; then
echo "Starting MySql 32 bit install..."
ZIP_FILE=mysql-enterprise-5.1.55-linux-i686-glibc23.tar.gz
MYSQL_DIR=mysql-enterprise-5.1.55-linux-i686-glibc23
else
echo "installation tar.gz not found, quitting..."
exit 2
fi
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip < $DOWNLOAD_DIR/$ZIP_FILE | tar xf -
ln -s /usr/local/$MYSQL_DIR mysql
cd mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
# bin/mysqld_safe --user=mysql &
cp /usr/local/$MYSQL_DIR/support-files/mysql.server /etc/init.d/mysql
#cp $DOWNLOAD_DIR/mysql-cnf.txt /etc/my.cnf
chmod 755 /etc/init.d/mysql
cp support-files/mysql-log-rotate /etc/logrotate.d
update-rc.d mysql defaults
/etc/init.d/mysql start
# create path links for most commonly used executables
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/mysqladmin
ln -s /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump
/usr/local/mysql/bin/mysqladmin -u root password 'xxxxx'
echo "Done"
exit 0