mysqlhotcopy是由perl写的脚本,我们如果想用mysqlhotcopy来备份数据库的话,还需要安装两样东西
- yum install perl-DBI perl-DBD-MySQL
安装完毕之后,如果我们遇到下面的问题
install_driver(mysql) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15 无法打开共享对象文件: 没有那个文件或目录 at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /home/admin/local/BackupMasterDB.pl line 51
上面错误一看是找不到libmysqlclient
.so
.15 ,先find吧
- #find /usr/ -name "libmysqlclient.so*"
- /home/mysql/lib/mysql/libmysqlclient.so.15.0.0
- /home/mysql/lib/mysql/libmysqlclient.so.15
- /home/mysql/lib/mysql/libmysqlclient.so
解决方法:
- # echo "/home/mysql/lib/mysql/" >> /etc/ld.so.conf
- # ldconfig
如果还继续提示上面的错误,那安装:
yum install mysql-d
如果遇到下面的问题
- DBI connect(';host=localhost;mysql_read_default_group=mysqlhotcopy','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at ./mysqlhotcopy line 180
在mysqlhotcopy内也找不到重新指定mysql.sock位置内容,一般地mysql.sock随mysql启动后都会在/tmp下,看来只能创建个链接过去了:
- ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
阅读(2066) | 评论(1) | 转发(1) |