Not the answer you need?
Register and ask your own question!

use innobackupex for backup faild, code /usr/bin/innobackupex line 3003,1539,2987

nemrrynemrry EntrantInactive User Role Beginner
Hi Masters

I'm a new guy just begin to study mysql, but recently i met a issue but do know how to fix it, appreciated if somebody could
help me about it, maybe a stupid mistake, but i can't find out, pls see below

[[email protected] ~]# innobackupex --user=root --password=mysql /root/backup/

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

150405 19:55:23 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 3003.
main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1539
innobackupex: Error: Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup','ro ot',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /usr/bin/innobackupex line 2987.
[[email protected] ~]# rpm -qa |grep xtrabackup
percona-xtrabackup-2.2.10-1.el7.x86_64
percona-xtrabackup-debuginfo-2.2.10-1.el7.x86_64
[[email protected] ~]# cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)

i have already install perl-DBD-MySQL-4.023-5.el7.x86_64, i have searched around, but still not find the solution,
pls help to give some advices


Thanks & best regards


newbie nemrry

Comments

  • nemrrynemrry Entrant Inactive User Role Beginner
    may i think it's version not compatible?
  • jriverajrivera Percona Support Engineer Percona Staff Role
    Try to use the --socket option with innobackupex or check your my.cnf file and add a socket=/path/to/mysql.sock under [client] or [mysql] option group.
  • nemrrynemrry Entrant Inactive User Role Beginner
    jrivera wrote: »
    Try to use the --socket option with innobackupex or check your my.cnf file and add a socket=/path/to/mysql.sock under [client] or [mysql] option group.
    Hi Jrivera

    thanks for your advice, but i have tried before, it's not work, pls ref the below
    [[email protected] ~]# cd /var/lib/mysql/
    [[email protected] mysql]# ll
    total 0
    lrwxrwxrwx 1 mysql mysql 15 Apr 5 21:42 mysql.sock -> /tmp/mysql.sock
    [[email protected] mysql]# cd
    [[email protected] ~]# cat /etc/my.cnf
    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.6/...-defaults.html
    # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
    # *** default location during install, and will be replaced if you
    # *** upgrade to a newer version of MySQL.

    [mysqld]

    # Remove leading # and set to the amount of RAM for the most important data
    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    # innodb_buffer_pool_size = 128M

    # Remove leading # to turn on a very important data integrity option: logging
    # changes to the binary log between backups.
    log_bin=/usr/local/mysql/mysql_bin_log/mysqlbin.log
    log_bin_index=/usr/local/mysql/mysql_bin_log/mysqlbin.index

    # These are commonly set, remove the # and set as required.
    # basedir = .....
    datadir = /data/mydata
    # port = .....
    # server_id = .....
    socket =/tmp/mysql.sock

    # Remove leading # to set options mainly useful for reporting servers.
    # The server defaults are faster for transactions and fast SELECTs.
    # Adjust sizes as needed, experiment to find the optimal values.
    # join_buffer_size = 128M
    # sort_buffer_size = 2M
    # read_rnd_buffer_size = 2M

    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLE S

    [[email protected] ~]# innobackupex --user=root --password=mysql --socket=/tmp/mysql.sock /root/backup/

    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

    150406 14:25:26 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;my sql_socket=/tmp/mysql.sock' as 'root' (using password: YES).
    innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3003.
    main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1539
    innobackupex: Error: Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;mysq l_socket=/tmp/mysql.sock','root',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/bin/innobackupex line 2987.

    [[email protected] ~]# service mysqld status
    SUCCESS! MySQL running (2822)
    [[email protected] ~]# mysql
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 2
    Server version: 5.6.22-log Source distribution

    Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> show variables like 'socket';
    +
    +
    +
    | Variable_name | Value |
    +
    +
    +
    | socket | /tmp/mysql.sock |
    +
    +
    +
    1 row in set (0.01 sec)

    mysql>


    this issue still exist, i don't know why for innobackupex can't connect to the MySQL server, but MySQL server is running normally,appreciated you could help me to find out the root cause, thanks!
  • nemrrynemrry Entrant Inactive User Role Beginner
    Can some one help me to find out what's wrong here? thanks!
  • mirfanmirfan Database Administrator Inactive User Role Beginner
    Can you please add [client] section in my.cnf as below.
    [client]
    socket =/tmp/mysql.sock

    If it still doesn't work please provide @datadir output.
    mysql> SHOW GLOBAL VARIABLES LIKE '%datadir%';
  • sandy27sandy27 Entrant Current User Role Beginner
    Hi
    ,

    Hope the issue got resolved for you.can you please provide the solution for this?
  • sandy27sandy27 Entrant Current User Role Beginner
    we are facing the same error. this error?
  • StHavenStHaven Entrant Current User Role Beginner
    So here is the issue...
    You need to look for the files:
    /usr/lib64/libmysqlclient_r.so.16.0.0
    /usr/lib64/libmysqlclient.so.16.0.0

    You also need to be sure that there are soft links there...
    [email protected]# ls -al /usr/lib64/libmysqlclient*16*
    lrwxrwxrwx. 1 root root 26 Feb 12 16:44 /usr/lib64/libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
    -rwxr-xr-x. 1 root root 1509288 Jul 28 2014 /usr/lib64/libmysqlclient_r.so.16.0.0
    lrwxrwxrwx. 1 root root 24 Feb 12 16:44 /usr/lib64/libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
    -rwxr-xr-x. 1 root root 1499400 Jul 28 2014 /usr/lib64/libmysqlclient.so.16.0.0

    Once you have these in place you run the following test:
    --Show correct versions of dbd is installed for mysql to work
    [email protected]# perl -MDBD::mysql -e 'print $DBD::mysql::VERSION'
    OUTPUT:
    4.013

    Now you should be able to make innobackupex script work as designed.

    Here are my current percona RPMs and DBD rpms
    [email protected]# rpm -qa | grep -i percona
    Percona-Server-shared-compat-51-5.1.73-rel14.12.624.rhel6.x86_64
    percona-xtrabackup-2.2.11-1.el6.x86_64
    Percona-Server-shared-55-5.5.44-rel37.3.el6.x86_64
    Percona-Server-server-55-5.5.44-rel37.3.el6.x86_64
    percona-toolkit-2.2.14-1.noarch
    Percona-Server-client-55-5.5.44-rel37.3.el6.x86_64
    [email protected]# rpm -qa | grep -i dbd
    perl-DBD-MySQL-4.013-3.el6.x86_64
    perl-DBD-SQLite-1.27-3.el6.x86_64

    This worked for me - good luck!
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.