0

I'm trying to use mydumper to generate a dump of my mysql databases, that I could use to restore the databases later in case of disaster.

However, it just doesn't work. I use this command line:

mydumper --user remote-backup --password ******

It outputs nothing but a Segmentation fault message, after about 1s delay.

I have installed it with apt install mydumper on a debian 8.5 (jessie) machine, which installed mydumper 0.6.1, built against MySQL 5.5.35. I'm using mysqld Ver 5.7.14 for Linux on i686 (MySQL Community Server (GPL)). Do I need to rebuild mydumper against mysql 5.7?

Here is the backtrace from gdb:

(gdb) run
Starting program: /usr/bin/mydumper --user remote-backup --password ******
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
[New Thread 0xb77aab40 (LWP 3189)]
[Thread 0xb77aab40 (LWP 3189) exited]
[New Thread 0xb77aab40 (LWP 3190)]
[New Thread 0xb6dffb40 (LWP 3191)]
[New Thread 0xb63ffb40 (LWP 3192)]
[New Thread 0xb5bfeb40 (LWP 3194)]

Program received signal SIGSEGV, Segmentation fault.
0xb7912bf8 in __GI_____strtoull_l_internal (nptr=nptr@entry=0x0,
    endptr=endptr@entry=0x0, base=base@entry=10, group=group@entry=0,
    loc=loc@entry=0xb7a87400 <_nl_C_locobj>) at ./strtol_l.c:298
298     ./strtol_l.c: No such file or directory.
(gdb) backtrace
#0  0xb7912bf8 in __GI_____strtoull_l_internal (nptr=nptr@entry=0x0,
    endptr=endptr@entry=0x0, base=base@entry=10, group=group@entry=0,
    loc=loc@entry=0xb7a87400 <_nl_C_locobj>) at ./strtol_l.c:298
#1  0xb791321f in __GI___strtoull_l (nptr=0x0, endptr=0x0, base=10,
    loc=0xb7a87400 <_nl_C_locobj>) at ./strtol_l.c:556
#2  0xb7bcbdc6 in g_ascii_strtoull () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0x0804cf6a in dump_database ()
#4  0x0804ede1 in start_dump ()
#5  0x0804b595 in main ()

1 Answer 1

1

I solved this problem by rebuilding mydumper from sources.

It turns out that I was using a more recent mysqld version than the one provided by debian (jessie), and so apparently the mydumper executable provided by debian isn't compatible with it (though this is just a guess, maybe that's not the reason at all).

In order to build mydumper, you need to:

  1. Clone https://github.com/maxbube/mydumper.git
  2. Install dependencies with apt-get (see mydumper readme on github, at the time of writing this answer you need sudo apt-get install libglib2.0-dev zlib1g-dev libpcre3-dev libssl-dev)
  3. Install the libmysqlclient-dev package corresponding to the mysqld version you're using. Since in this case I'm not using the one provided by debian, I can't install the development files provided by debian either. What worked for me was to download the .deb packages from the debian sid repository (directly from ftp): libmysqlclient-dev which depends on libmysqlclient20. Download these files and then sudo dpkg -i libmysqlclient20_5.7.18-1_i386.deb libmysqlclient-dev_5.7.18-1_i386.deb
  4. Build mydumper (which will also build myloader) as explained in the readme:

    cd mydumper
    cmake .
    make
    

    You might need to install build tools such as sudo apt-get install build-essential cmake

You should now have both executables in the current directory. From this point, everything worked fine for me to generate the backup.

I also needed to build myloader from source on the target server, as the version provided by debian would also segfault, but this time it wasn't a mysql version mismatch ; so actually I have no clue why the debian executable didn't work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .