关于mysqlhotcopy安装在网上找了很多参考,总结安装mysqlhotcopy前需先安装perl-DBI 和 perl-DBD-MySQL,否则在运行mysqlhotcopy时会报错
[root@hadoop02 temp]# mysqlhotcopy fluxdb /home/01/temp/ccc
Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/bin/mysqlhotcopy line 25.
BEGIN failed--compilation aborted at /usr/bin/mysqlhotcopy line 25.
[root@hadoop02 temp]# cd /usr/local/lib64/perl5
-bash: cd: /usr/local/lib64/perl5: No such file or directory
[root@hadoop02 temp]# cd /usr/local/lib64
[root@hadoop02 lib64]# ls
[root@hadoop02 lib64]# ls
--说明perl没有安装
安装方法:
[root@localhost ~]# yum install perl-DBD* -y
但是当我执行上面这一步的时候却提示:No package perl-DBD* available.
[root@hadoop02 software]# yum install perl-DBD* -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
No package perl-DBD* available.
Error: Nothing to do
(what are you 弄啥呢?
难道是我的资料找的不对?
翻来覆去差不多都是这样下载安装的应该没问题
麻蛋我又去问百大爷No package perl-DBD* available.
居然奇迹的发现有铁!于是我按帖子内容操作了如下一番:)
No package perl-DBD available.解决办法:*
我的Linux版本是Linux version 2.6.32-573.el6.x86_64
依次执行下面命令解决
cd /home
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
[root@hadoop02 home]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
--2020-04-21 21:18:18-- http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Resolving dl.fedoraproject.org... 209.132.181.23, 209.132.181.24, 209.132.181.25
Connecting to dl.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-rpm]
Saving to: “epel-release-6-8.noarch.rpm”
100%[===================================>] 14,540 7.27K/s in 2.0s
2020-04-21 21:18:21 (7.27 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]
[root@hadoop02 software]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
再次执行yum install命令
[root@hadoop02 software]# yum install perl-DBD* -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
(卧槽,这次报错居然不一样了 ,说我路径不对
再次陷入懵逼中(请恕我菜),继续找百大爷,咋感觉百大爷比我亲爹还亲-.-!
功夫不负有心人!有铁!)
yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again
(心里再次默念:感谢大佬这种共享精神,才能让我这种小白苟延残喘)
解决方法: 一句话:把/etc/yum.repos.d/epel.repo,文件第3行注释去掉,把第四行注释掉。具体如下:
打开/etc/yum.repos.d/epel.repo,将
1.[epel]
2.name=Extra Packages for Enterprise Linux 6 - $basearch
3.#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
4.mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
修改为
1.[epel]
2.name=Extra Packages for Enterprise Linux 6 - $basearch
3.baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
4.#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
再清理源,重新安装
yum clean all
yum install -y 需要的包
(走到这心里默默的祈祷,别再出岔子了,哥快秃顶了!)
再次执行 yum install
[root@hadoop02 software]# yum install -y perl-DBD* -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
epel | 4.7 kB 00:00
epel/primary_db | 6.1 MB 00:01
Resolving Dependencies
--> Running transaction check
---> Package perl-DBD-AnyData.noarch 0:0.09-5.el6 will be installed
--> Processing Dependency: perl(AnyData) for package: perl-DBD-AnyData-0.09-5.el6.noarch
(奇迹出现了!内心澎湃啊,但是帅不过三秒,随之而来还有一堆Error,当场吐晕在厕所。。。谁来扶我一下啊-.-、我特么是踩屎坑里了)
---> Package perl-Text-CSV_XS.x86_64 0:0.85-1.el6 will be installed
--> Finished Dependency Resolution
Error: Package: perl-DBD-SQLite2-0.33-12.el6.x86_64 (epel)
Requires: perl(DBI)
Error: Package: perl-DBD-XBase-0.241-9.el6.noarch (epel)
Requires: perl(DBI)
Error: Package: perl-AnyData-0.10-8.el6.noarch (epel)
Requires: perl(XML::Twig)
Error: Package: perl-SQL-Statement-1.27-1.el6.noarch (epel)
Requires: perl(Params::Util)
Error: Package: perl-DBD-CSV-0.22-8.el6.noarch (epel)
Requires: perl(DBD::File)
Error: Package: perl-DBD-ODBC-1.50-3.el6.x86_64 (epel)
Requires: perl(DBI)
Error: Package: perl-SQL-Statement-1.27-1.el6.noarch (epel)
Requires: perl(Clone)
Error: Package: perl-AnyData-0.10-8.el6.noarch (epel)
Requires: perl(CGI)
Error: Package: perl-DBD-ODBC-1.50-3.el6.x86_64 (epel)
Requires: unixODBC
Error: Package: perl-DBD-Firebird-1.31-1.el6.x86_64 (epel)
Requires: perl(DBI) >= 1.41
Error: Package: perl-DBD-Firebird-1.31-1.el6.x86_64 (epel)
Requires: perl(DBI)
Error: Package: perl-DBD-ODBC-1.50-3.el6.x86_64 (epel)
Requires: libodbc.so.2()(64bit)
You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of mysql-libs
(我已经无力再为自己的无知吐槽了。。。继续百度)
yum报错: You could try using --skip-broken to work around the problem
解决办法:
一般都是用
yum install *** --skip-broken
后来在网上找到了解决方案:
1、将/etc/yum.repos.d文件夹下所有repos文件转移,然后把用的那个repo拷贝回来(保证repo所在目录只有你的那1个文件) 2、yum clean all
3、再yum install安装看看
我采用了yum install *** --skip-broken方法跳过了重复的包
[root@hadoop02 home]# yum install -y perl-DBD* -y --skip-broken
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
Packages skipped because of dependency problems:
firebird-libfbclient-2.5.7.27050.0-1.el6.x86_64 from epel
firebird-libfbembed-2.5.7.27050.0-1.el6.x86_64 from epel
perl-AnyData-0.10-8.el6.noarch from epel
perl-DBD-AnyData-0.09-5.el6.noarch from epel
perl-DBD-CSV-0.22-8.el6.noarch from epel
perl-DBD-Firebird-1.31-1.el6.x86_64 from epel
perl-DBD-ODBC-1.50-3.el6.x86_64 from epel
perl-DBD-SQLite2-0.33-12.el6.x86_64 from epel
perl-DBD-XBase-0.241-9.el6.noarch from epel
perl-SQL-Statement-1.27-1.el6.noarch from epel
perl-Text-CSV_XS-0.85-1.el6.x86_64 from epel
安装到这先看看能不能用吧,希望这一天不要白瞎忙活
(瞎白忙活了后面补上太晚了,我特么明天还能活着起来吗-.-!)