Can'tconnecttolocalMySQLserverthroughsocket'/var/lib/mysql/mysql.sock'(2)

白及88發表於2016-03-09
[root@t1 /]#  innobackupex –user=root –password=123456 /mydata/data

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

160309 07:01:49  innobackupex: Executing a version check against the server…
160309 07:01:49  innobackupex: Connecting to MySQL server with DSN `dbi:mysql:;mysql_read_default_group=xtrabackup` as `root`  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3011
main::mysql_connect(`abort_on_error`, 1) called at /usr/bin/innobackupex line 1551
innobackupex: Error: Failed to connect to MySQL server: DBI connect(`;mysql_read_default_group=xtrabackup`,`root`,…) failed: Can`t connect to local MySQL server through socket `/var/lib/mysql/mysql.sock` (2) at /usr/bin/innobackupex line 2995
160309 07:01:49  innobackupex: Connecting to MySQL server with DSN `dbi:mysql:;mysql_read_default_group=xtrabackup` as `root`  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3011
main::mysql_connect(`abort_on_error`, 1) called at /usr/bin/innobackupex line 1570
innobackupex: Error: Failed to connect to MySQL server: DBI connect(`;mysql_read_default_group=xtrabackup`,`root`,…) failed: Can`t connect to local MySQL server through socket `/var/lib/mysql/mysql.sock` (2) at /usr/bin/innobackupex
line 2995
[root@t1 /]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
ln: creating symbolic link `/var/lib/mysql/mysql.sock`: No such file or directory

解決:

[root@t1 /]# mkdir /var/lib/mysql/

[root@t1 /]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
[root@t1 /]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock


相關文章