Home > bash, Linux, MySQL > How to compile mydumper 0.5.2 on Debian 6.0.8 and MySQL Percona Server 5.5.34-rel32.0-591.squeeze

How to compile mydumper 0.5.2 on Debian 6.0.8 and MySQL Percona Server 5.5.34-rel32.0-591.squeeze

How to start :
mydumper home page : https://launchpad.net/mydumper
how to build on Debian/Ubuntu : https://answers.launchpad.net/mydumper/+faq/349 , but there are some things missing like cmake and libpcre
Latest version is 0.5.2 released on 2012-11-19: https://launchpad.net/mydumper/0.5/0.5.2/+download/mydumper-0.5.2.tar.gz

MySQL installed version : percona-server-server-5.5 : 5.5.34-rel32.0-591.squeeze

1. get the source :

test ! -d ~/installs/ && mkdir -p ~/installs/
cd ~/installs/
wget https://launchpad.net/mydumper/0.5/0.5.2/+download/mydumper-0.5.2.tar.gz
tar xvf mydumper-0.5.2.tar.gz

2. install the dev packages :

sudo apt-get install libglib2.0-dev zlib1g-dev

3. Install cmake

apt-get install cmake

4. Install percoan mysql client dev files:

apt-get install libmysqlclient-dev

5. Build it :

cd ~/installs/mydumper-0.5.2
cmake . -DCMAKE_INSTALL_PREFIX=~/bin/mydumper

in case you get PCRE not found error:
6. Install the PCRE libs:

apt-get install libpcre3-dev

In case you get no cmake errors, execute make:

make

in case you get that error :

 [ 20%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
 [ 40%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
 [ 60%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
 make[2]: *** No rule to make target `/usr/lib/libmysqlclient_r.so', needed by `mydumper'.  Stop.
 make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
 make: *** [all] Error 2

you need to fix the /usr/lib/libmysqlclient_r.so, it seems to point to non existing libmysqlclient_r.so.18  in my case

ls -lrth /usr/lib/libmysqlclient_r.so
lrwxrwxrwx 1 root root 22 Nov 18 07:24 /usr/lib/libmysqlclient_r.so -> libmysqlclient_r.so.18
cd /usr/lib/
rm libmysqlclient_r.so &&  ln -s libmysqlclient.so.18 libmysqlclient_r.so
root@www:[Sun Dec 08 22:01:19][/usr/lib]$ ls -lrt  | grep  libmysqlclient.so.18
-rw-r--r--  1 root root 3162144 Oct 25 08:35 libmysqlclient.so.18.0.0
-rw-r--r--  1 root root 3551104 Oct 25 09:04 libmysqlclient.so.18.1.0
lrwxrwxrwx  1 root root      24 Nov 18 07:20 libmysqlclient_r.so.18.0.0 -> libmysqlclient.so.18.0.0
lrwxrwxrwx  1 root root      24 Nov 18 07:24 libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0
lrwxrwxrwx  1 root root      20 Nov 18 07:24 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx  1 root root      26 Nov 18 07:24 libmysqlclient.so.18 -> libmysqlclient_r.so.18.1.0
lrwxrwxrwx  1 root root      20 Dec  7 20:41 libmysqlclient_r.so -> libmysqlclient.so.18

Then try again make
in case you get that error :

sql_common.h:26:18: fatal error: hash.h: No such file or directory

this is due to MySQL bug : #70672
in a view to fix that, get the percona source :

$ cd ~/installs/
 wget  http://www.percona.com/redir/downloads/Percona-Server-5.5/LATEST/source/Percona-Server-5.5.34-rel32.0.tar.gz
 tar xvf Percona-Server-5.5.34-rel32.0.tar.gz
 sudo cp ./Percona-Server-5.5.34-rel32.0/include/hash.h /usr/include/
 then again try to build the mydymper:
 cd ~/installs/mydumper-0.5.2
 make
 Scanning dependencies of target mydumper
 [ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
 [ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
 [ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
 [ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
 Linking C executable mydumper
 [ 80%] Built target mydumper
 Scanning dependencies of target myloader
 [100%] Building C object CMakeFiles/myloader.dir/myloader.c.o
 Linking C executable myloader
 [100%] Built target myloader
 make install
 [ 80%] Built target mydumper
 [100%] Built target myloader
 Install the project...
 -- Install configuration: ""
 -- Installing: /home/seik/bin/mydumper/bin/mydumper
 -- Installing: /home/seik/bin/mydumper/bin/myloader
 export PATH=$PATH:/home/seik/bin/mydumper/bin/
 myloader --version
 myloader 0.5.2, built against MySQL 5.6.14

seems to work :
so how to backup the database mysql:

mkdir /home/.mydumper
mydumper -o /home/.mydumper -r 100000 -c -e -m -L mysql-backup.log -u root -p mypass -h localhost -t 2 -v 3 -B mysql 
mysqldump -u root -p -d -R --skip-triggers mysql  > /home/.mydumper/mysql.schema
mysqldump -u root -p -d -t  mysql  > mysql.triggers
seik@www:[Sun Dec 08 22:28:35][/home/.mydumper]$ ls -lrth
total 260K
-rw-r--r-- 1 seik seik  250 Dec  8 04:02 mysql.db.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.columns_priv.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.event.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.general_log.sql.gz
-rw-r--r-- 1 seik seik  166 Dec  8 04:02 mysql.func.sql.gz
-rw-r--r-- 1 seik seik  614 Dec  8 04:02 mysql.help_category.sql.gz
-rw-r--r-- 1 seik seik 3.4K Dec  8 04:02 mysql.help_relation.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.plugin.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.ndb_binlog_index.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.host.sql.gz
-rw-r--r-- 1 seik seik 3.3K Dec  8 04:02 mysql.help_keyword.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.procs_priv.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.proc.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.servers.sql.gz
-rw-r--r-- 1 seik seik  173 Dec  8 04:02 mysql.proxies_priv.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.time_zone_transition_type.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.time_zone_transition.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.time_zone_name.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.time_zone_leap_second.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.time_zone.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.tables_priv.sql.gz
-rw-r--r-- 1 seik seik   78 Dec  8 04:02 mysql.slow_log.sql.gz
-rw-r--r-- 1 seik seik  539 Dec  8 04:02 mysql.user.sql.gz
-rw-r--r-- 1 seik seik 128K Dec  8 04:02 mysql.help_topic.sql.gz
-rw-r--r-- 1 seik seik   75 Dec  8 04:02 metadata
-rw-r--r-- 1 seik seik  25K Dec  8 04:08 mysql.schema
-rw-r--r-- 1 seik seik 1.3K Dec  8 04:08 mysql.triggers

Slackware4Life ! :)

About these ads
  1. December 12, 2013 at 11:07 am
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: