首页 > 其他 > 详细

解决xtrabackup备份时出现的socket报错

时间:2017-11-20 19:00:16      阅读:392      评论:0      收藏:0      [点我收藏+]

    今天为公司新建的uat数据库备份时,出现了报错,将解决方法整理、做一下备忘:

    服务器系统:

[root@uat-mysql-master tmp]# cat /etc/redhat-release
 CentOS Linux release 7.3.1611 (Core) 
mysql版本号:


报错如下:
[root@uat-mysql-master tmp]# innobackupex  --defaults-file=/etc/my.cnf --user=backup --password=****** --stream=tar /home/backup/ | gzip >/home/backup/`date +%F_%H-%M-%S`.tar.gz
171120 17:10:42 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".
    171120 17:10:42  version_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup‘ as ‘backup‘  (using password: YES).
Failed to connect to MySQL server: DBI connect(‘;mysql_read_default_group=xtrabackup‘,‘backup‘,...) failed: Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2) at - line 1314.
171120 17:10:42 Connecting to MySQL server host: localhost, user: backup, password: set, port: not set, socket: not set
Failed to connect to MySQL server: Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2).

解决办法:

在命令行中添加 

--host=127.0.0.1

参数;

备注:网上有的说,通过

# find / -name "mysql.sock"

查到socket参数,然后在配置文件中修改,但测试后,不一定能解决问题。

本文出自 “莲池管俊涛的51cto博客” 博客,谢绝转载!

解决xtrabackup备份时出现的socket报错

原文:http://9285090.blog.51cto.com/9275090/1983554

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!