我从 repo 5.0.77 安装了...包括 PowerDNS 的设置(以及 MySQL 的后端)。我尝试从我的主服务器(即 MySQL 5.1.53)设置复制,但它没有工作,即使没有错误,也没有复制任何东西。
所以最后的办法是在主服务器和从服务器上尝试相同的 MySQL 版本(注意,只有从服务器安装了 pdns)
我该如何安装 MySQL 5.1.53?我尝试从 MySQL 下载 rpm(显然是错误的,甚至没有包含进入数据库的 mysql 命令),但反过来搞砸了 pdns mysql 后端的依赖关系。
我有一个原子 repo,它将安装 MySQL 5.5(在我的主服务器和从服务器上),但是我现在不想在主服务器上进行重大升级,因为它正在生产中。
希望得到一些建议!
答案1
有几种方法可以安装特定版本的 MySQL
最新版本
要安装今天的最新版本(MySQL 5.6.10),请运行以下命令:
HOWMANYBITS=64
WHATOS=5
BINARY_VERSION=000
if [ ${HOWMANYBITS} -eq 32 ] ; then BINARY_VERSION=i386 ; fi
if [ ${HOWMANYBITS} -eq 64 ] ; then BINARY_VERSION=x86_64 ; fi
MYSQL_RELEASE=`curl -L http://www.mysql.com/downloads 2> /dev/null | grep 'Current Generally Available Release' | grep 'MySQL Community Server' | sed 's/.*Available Release://' | sed 's/)/ /g' | awk '{print $1}'`
MAJOR_RELEASE="`echo ${MYSQL_RELEASE} | sed 's/\./ /g' | awk '{print $1}'`.`echo ${MYSQL_RELEASE} | sed 's/\./ /g' | awk '{print $2}'`"
OS_VERSION=000
if [ ${WHATOS} -eq 0 ] ; then OS_VERSION=linux2.6 ; fi
if [ ${WHATOS} -eq 5 ] ; then OS_VERSION=rhel5 ; fi
if [ ${WHATOS} -eq 6 ] ; then OS_VERSION=el6 ; fi
RELEASE_TAG=1
DEVEL__RPM=http://www.mysql.com/get/Downloads/MySQL-${MAJOR_RELEASE}/MySQL-devel-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
SHARD2_RPM=http://www.mysql.com/get/Downloads/MySQL-${MAJOR_RELEASE}/MySQL-shared-compat-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
SHARED_RPM=http://www.mysql.com/get/Downloads/MySQL-${MAJOR_RELEASE}/MySQL-shared-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
CLIENT_RPM=http://www.mysql.com/get/Downloads/MySQL-${MAJOR_RELEASE}/MySQL-client-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
SERVER_RPM=http://www.mysql.com/get/Downloads/MySQL-${MAJOR_RELEASE}/MySQL-server-${MYSQL_RELEASE}-${RELEASE_TAG}.${OS_VERSION}.${BINARY_VERSION}.rpm/from/http://mysql.mirrors.pair.com/
PERL_LOCATION=ftp://ftp.de.netclusive.de/pub/parallels/Plesk/Expand/2.3.1/packages
PERL_FILE=perl-DBI-1.53-2.fc7.x86_64.rpm
PERL_URL=${PERL_LOCATION}/${PERL_FILE}
cd
MYSQL_INSTALL_FOLDER=MySQL_${MYSQL_RELEASE}_Install
rm -rf ${MYSQL_INSTALL_FOLDER}
mkdir ${MYSQL_INSTALL_FOLDER}
cd ${MYSQL_INSTALL_FOLDER}
wget ${PERL_URL}
wget ${DEVEL__RPM}
wget ${SHARD2_RPM}
wget ${SHARED_RPM}
wget ${CLIENT_RPM}
wget ${SERVER_RPM}
ls -lSr *.rpm
for RPM in `ls -lSr *.rpm | awk '{print $9}'` ; do rpm -Uvh --force ${RPM} ; done
特定版本
要安装特定版本,请设置以下内容:
MYSQL_VERSION
(5.5、5.1、5.0)MYSQL_VERSION_RELNUM
例如,要获取 MySQL 5.1.66,运行以下命令:
MYSQL_VERSION=5.1
MYSQL_VERSION_RELNUM=66
MYSQL_VERSION_RELEASE=${MYSQL_VERSION}.${MYSQL_VERSION_RELNUM}
REDHAT_RELEASE=5
BINARY_VERSION=x86_64
PERL_LOCATION=ftp://ftp.de.netclusive.de/pub/parallels/Plesk/Expand/2.3.1/packages
PERL_FILE=perl-DBI-1.53-2.fc7.x86_64.rpm
PERL_URL=${PERL_LOCATION}/${PERL_FILE}
MYSQL_MIRROR=http://mysql.mirrors.pair.com/
MYSQL_MIRROR=http://mirror.trouble-free.net/mysql_mirror/
MYSQL_MIRROR=http:http://mysql.he.net/
MYSQL_MIRROR_INDEX=1
MYSQL_SHARE2_LIB=MySQL-shared-compat-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SHARED_LIB=MySQL-shared-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_DEVEL__LIB=MySQL-devel-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_CLIENT_LIB=MySQL-client-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SERVER_LIB=MySQL-server-community-${MYSQL_VERSION_RELEASE}-${MYSQL_MIRROR_INDEX}.rhel${REDHAT_RELEASE}.${BINARY_VERSION}.rpm
MYSQL_SHARE2_URL="http://dev.mysql.com/get/Downloads/MySQL-${MYSQL_VERSION}/${MYSQL_SHARE2_LIB}/from/${MYSQL_MIRROR}"
MYSQL_SHARED_URL="http://dev.mysql.com/get/Downloads/MySQL-${MYSQL_VERSION}/${MYSQL_SHARED_LIB}/from/${MYSQL_MIRROR}"
MYSQL_CLIENT_URL="http://dev.mysql.com/get/Downloads/MySQL-${MYSQL_VERSION}/${MYSQL_CLIENT_LIB}/from/${MYSQL_MIRROR}"
MYSQL_DEVEL__URL="http://dev.mysql.com/get/Downloads/MySQL-${MYSQL_VERSION}/${MYSQL_DEVEL__LIB}/from/${MYSQL_MIRROR}"
MYSQL_SERVER_URL="http://dev.mysql.com/get/Downloads/MySQL-${MYSQL_VERSION}/${MYSQL_SERVER_LIB}/from/${MYSQL_MIRROR}"
cd
MYSQL_INSTALL_FOLDER=MySQL_${MYSQL_VERSION_RELEASE}_Install
rm -rf ${MYSQL_INSTALL_FOLDER}
mkdir ${MYSQL_INSTALL_FOLDER}
cd ${MYSQL_INSTALL_FOLDER}
wget ${PERL_URL}
wget ${MYSQL_SHARE2_URL}
wget ${MYSQL_SHARED_URL}
wget ${MYSQL_DEVEL__URL}
wget ${MYSQL_CLIENT_URL}
wget ${MYSQL_SERVER_URL}
pwd
ls -l
for RPM in `ls -lSr *.rpm | awk '{print $9}'` ; do rpm -Uvh --force ${RPM} ; done
包含旧版本的存储库
如果这些不起作用,你可以使用其他存储库
您必须自己编写这些脚本。
答案2
我意识到这个问题有点老了,但如果你仍在寻找,你应该能够在这里找到你需要的包: http://olex.openlogic.com/packages/mysql/5.1.34
另外,我想您可能已经完成了大部分内容,但也许这会对其他人搜索 MySQL 复制问题有所帮助。一个好的起点是这里: http://forge.mysql.com/wiki/Replication/Tutorial