mydumper 官网:https://launchpad.net/mydumper

下载之后,安装报错:

  1. [root@localhost local]# cd mydumper-0.6.2
  2. [root@localhost mydumper-0.6.]#
  3. [root@localhost mydumper-0.6.]# ls
  4. binlog.c CMakeCache.txt common.h docs g_unix_signal.h myloader.c Processing server_detect.c
  5. binlog.h CMakeFiles config.h Finished mydumper.c myloader.h README server_detect.h
  6. cmake CMakeLists.txt config.h.in g_unix_signal.c mydumper.h Package Running
  7. [root@localhost mydumper-0.6.]# cmake .
  8. -- The CXX compiler identification is GNU 4.4.
  9. -- Check for working CXX compiler: /usr/bin/c++
  10. -- Check for working CXX compiler: /usr/bin/c++ -- works
  11. -- Detecting CXX compiler ABI info
  12. -- Detecting CXX compiler ABI info - done
  13. -- Using mysql-config: /usr/local/mysql/bin/mysql_config
  14. -- Found MySQL: /usr/local/mysql/include, /usr/local/mysql/lib/libmysqlclient.so;/usr/lib/libpthread.so;/usr/lib/libm.so;/usr/lib/librt.so;/usr/lib/libdl.so
  15. -- checking for one of the modules 'glib-2.0'
  16. CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake: (message):
  17. None of the required 'glib-2.0' found
  18. Call Stack (most recent call first):
  19. cmake/modules/FindGLIB2.cmake: (pkg_search_module)
  20. CMakeLists.txt: (find_package)
  21.  
  22. -- checking for one of the modules 'gthread-2.0'
  23. CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake: (message):
  24. None of the required 'gthread-2.0' found
  25. Call Stack (most recent call first):
  26. cmake/modules/FindGLIB2.cmake: (pkg_search_module)
  27. CMakeLists.txt: (find_package)
  28.  
  29. CMake Warning at docs/CMakeLists.txt: (message):
  30. Unable to find Sphinx documentation generator
  31.  
  32. -- ------------------------------------------------
  33. -- MYSQL_CONFIG = /usr/local/mysql/bin/mysql_config
  34. -- CMAKE_INSTALL_PREFIX = /usr/local
  35. -- BUILD_DOCS = ON
  36. -- WITH_BINLOG = OFF
  37. -- RUN_CPPCHECK = OFF
  38. -- Change a values with: cmake -D<Variable>=<Value>
  39. -- ------------------------------------------------
  40. --
  41. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  42. Please set them or make sure they are set and tested correctly in the CMake files:
  43. GLIB2_LIBRARIES (ADVANCED)
  44. linked by target "mydumper" in directory /usr/local/mydumper-0.6.
  45. linked by target "myloader" in directory /usr/local/mydumper-0.6.
  46. GTHREAD2_LIBRARIES (ADVANCED)
  47. linked by target "mydumper" in directory /usr/local/mydumper-0.6.
  48. linked by target "myloader" in directory /usr/local/mydumper-0.6.
  49.  
  50. -- Configuring incomplete, errors occurred!
  51. See also "/usr/local/mydumper-0.6.2/CMakeFiles/CMakeOutput.log".
  52. See also "/usr/local/mydumper-0.6.2/CMakeFiles/CMakeError.log".

cmake .  报错:

  1. None of the required 'glib-2.0' found
  2. None of the required 'gthread-2.0' found

网上搜索,没有找到解决办法,于是只好去官网寻找方法:

https://answers.launchpad.net/mydumper/+faq/349

  1. Run:
  2. cmake .
  3. make
  4.  
  5. One needs to install development versions of required libaries (MySQL, GLib, ZLib, PCRE):
  6. NOTE: you must use the correspondent mysql devel package.
  7.  
  8. * Ubuntu or Debian: apt-get install libglib2.-dev libmysqlclient15-dev zlib1g-dev libpcre3-dev libssl-dev
  9. * Fedora, RedHat and CentOS: yum install glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel
  10. * openSUSE: zypper install glib2-devel libmysqlclient-devel pcre-devel zlib-devel
  11. * MacOSX: port install glib2 mysql5 pcre pkgconfig cmake
  12. (You may want to run 'port select mysql mysql5' afterwards)
  13.  
  14. One has to make sure, that pkg-config, mysql_config, pcre-config are all in $PATH
  15.  
  16. Binlog dump is disabled by default to compile with it you need to add -DWITH_BINLOG=ON to cmake options
  17.  
  18. Obviously you need compiler and make packages too :)

可以看到需要安装依赖:

Fedora, RedHat and CentOS: yum install glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel

于是按照说明进行安装:

  1. [root@localhost mydumper-0.6.]# yum install glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel
  2. Loaded plugins: fastestmirror, refresh-packagekit, security
  3. Setting up Install Process
  4. Loading mirror speeds from cached hostfile
  5. * c6-media:
  6. Package mysql-devel-5.1.-.el6_5.i686 already installed and latest version
  7. Package zlib-devel-1.2.-.el6.i686 already installed and latest version
  8. Package pcre-devel-7.8-.el6.i686 already installed and latest version
  9. Package openssl-devel-1.0.1e-30.el6.i686 already installed and latest version
  10. Resolving Dependencies
  11. --> Running transaction check
  12. ---> Package glib2-devel.i686 :2.28.-.el6 will be installed
  13. --> Finished Dependency Resolution
  14.  
  15. Dependencies Resolved
  16.  
  17. ==========================================================================================================================================
  18. Package Arch Version Repository Size
  19. ==========================================================================================================================================
  20. Installing:
  21. glib2-devel i686 2.28.-.el6 c6-media k
  22.  
  23. Transaction Summary
  24. ==========================================================================================================================================
  25. Install Package(s)
  26.  
  27. Total download size: k
  28. Installed size: 1.5 M
  29. Is this ok [y/N]: y
  30. Downloading Packages:
  31. Running rpm_check_debug
  32. Running Transaction Test
  33. Transaction Test Succeeded
  34. Running Transaction
  35. Installing : glib2-devel-2.28.-.el6.i686 /
  36. Unable to connect to dbus
  37. Verifying : glib2-devel-2.28.-.el6.i686 /
  38.  
  39. Installed:
  40. glib2-devel.i686 :2.28.-.el6
  41.  
  42. Complete!

再来编译安装 mydumper:

  1. [root@localhost mydumper-0.6.]# cmake .
  2. -- Using mysql-config: /usr/local/mysql/bin/mysql_config
  3. -- Found MySQL: /usr/local/mysql/include, /usr/local/mysql/lib/libmysqlclient.so;/usr/lib/libpthread.so;/usr/lib/libm.so;/usr/lib/librt.so;/usr/lib/libdl.so
  4. -- checking for one of the modules 'glib-2.0'
  5. -- checking for one of the modules 'gthread-2.0'
  6.  
  7. CMake Warning at docs/CMakeLists.txt: (message):
  8. Unable to find Sphinx documentation generator
  9.  
  10. -- ------------------------------------------------
  11. -- MYSQL_CONFIG = /usr/local/mysql/bin/mysql_config
  12. -- CMAKE_INSTALL_PREFIX = /usr/local
  13. -- BUILD_DOCS = ON
  14. -- WITH_BINLOG = OFF
  15. -- RUN_CPPCHECK = OFF
  16. -- Change a values with: cmake -D<Variable>=<Value>
  17. -- ------------------------------------------------
  18. --
  19. -- Configuring done
  20. -- Generating done
  21. -- Build files have been written to: /usr/local/mydumper-0.6.
  22. [root@localhost mydumper-0.6.]# echo $?
  23.  
  24. [root@localhost mydumper-0.6.]# make
  25. Scanning dependencies of target mydumper
  26. [ %] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
  27. [ %] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
  28. [ %] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
  29. Linking C executable mydumper
  30. [ %] Built target mydumper
  31. Scanning dependencies of target myloader
  32. [%] Building C object CMakeFiles/myloader.dir/myloader.c.o
  33. Linking C executable myloader
  34. [%] Built target myloader
  35. [root@localhost mydumper-0.6.]# make install
  36. [ %] Built target mydumper
  37. [%] Built target myloader
  38. Install the project...
  39. -- Install configuration: ""
  40. -- Installing: /usr/local/bin/mydumper
  41. -- Removed runtime path from "/usr/local/bin/mydumper"
  42. -- Installing: /usr/local/bin/myloader
  43. -- Removed runtime path from "/usr/local/bin/myloader"

安装成功。但是执行时又报错:

  1. [root@localhost mydumper-0.6.]# mydumper --help
  2. mydumper: error while loading shared libraries: libmysqlclient.so.: cannot open shared object file: No such file or directory

解决办法:

  1. [root@localhost mydumper-0.6.]# ldd /usr/local/bin/mydumper
  2. linux-gate.so. => (0x00f91000)
  3. libmysqlclient.so. => not found
  4. libpthread.so. => /lib/libpthread.so. (0x006fc000)
  5. libm.so. => /lib/libm.so. (0x0072b000)
  6. librt.so. => /lib/librt.so. (0x00720000)
  7. libdl.so. => /lib/libdl.so. (0x00719000)
  8. libglib-2.0.so. => /lib/libglib-2.0.so. (0x00757000)
  9. libgthread-2.0.so. => /lib/libgthread-2.0.so. (0x00918000)
  10. libpcre.so. => /lib/libpcre.so. (0x021a8000)
  11. libz.so. => /lib/libz.so. (0x002ea000)
  12. libc.so. => /lib/libc.so. (0x00564000)
  13. /lib/ld-linux.so. (0x0053e000)
  14. [root@localhost mydumper-0.6.]# LD_DEBUG=libs /usr/local/bin/mydumper -v
  15. : find library=libmysqlclient.so. []; searching
  16. : search cache=/etc/ld.so.cache
  17. : search path=/lib/tls/i686/sse2:/lib/tls/i686:/lib/tls/sse2:/lib/tls:/lib/i686/sse2:/lib/i686:/lib/sse2:/lib:/usr/lib/tls /i686/sse2:/usr/lib/tls/i686:/usr/lib/tls/sse2:/usr/lib/tls:/usr/lib/i686/sse2:/usr/lib/i686:/usr/lib/sse2:/usr/lib (system s earch path)
  18. : trying file=/lib/tls/i686/sse2/libmysqlclient.so.
  19. : trying file=/lib/tls/i686/libmysqlclient.so.
  20. : trying file=/lib/tls/sse2/libmysqlclient.so.
  21. : trying file=/lib/tls/libmysqlclient.so.
  22. : trying file=/lib/i686/sse2/libmysqlclient.so.
  23. : trying file=/lib/i686/libmysqlclient.so.
  24. : trying file=/lib/sse2/libmysqlclient.so.
  25. : trying file=/lib/libmysqlclient.so.
  26. : trying file=/usr/lib/tls/i686/sse2/libmysqlclient.so.
  27. : trying file=/usr/lib/tls/i686/libmysqlclient.so.
  28. : trying file=/usr/lib/tls/sse2/libmysqlclient.so.
  29. : trying file=/usr/lib/tls/libmysqlclient.so.
  30. : trying file=/usr/lib/i686/sse2/libmysqlclient.so.
  31. : trying file=/usr/lib/i686/libmysqlclient.so.
  32. : trying file=/usr/lib/sse2/libmysqlclient.so.
  33. : trying file=/usr/lib/libmysqlclient.so.

没有找到 libmysqlclient.so.

  1. [root@localhost mydumper-0.6.]# locate libmysqlclient.so.18
  2. /usr/local/mysql-5.6.-linux-glibc2.-i686/lib/libmysqlclient.so.
  3. /usr/local/mysql-5.6.-linux-glibc2.-i686/lib/libmysqlclient.so.18.1.
  4. [root@localhost mydumper-0.6.]# ll /usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18
  5. lrwxrwxrwx. root mysql Aug : /usr/local/mysql-5.6.-linux-glibc2.-i686/lib/libmysqlclient.so. -> libmysqlclient.so.18.1.

然后将 /usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18.1. 复制到 /usr/lib/ 木下:

  1. [root@localhost mydumper-0.6.]# cp /usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18.1.0 /usr/lib/libmysqlclient.so.18
  2. [root@localhost mydumper-0.6.]# ldd /usr/local/bin/mydumper linux-gate.so.1 => (0x00805000)
  3. libmysqlclient.so. => /usr/lib/libmysqlclient.so. (0x0019f000)
  4. libpthread.so. => /lib/libpthread.so. (0x006fc000)
  5. libm.so. => /lib/libm.so. (0x0072b000)
  6. librt.so. => /lib/librt.so. (0x00720000)
  7. libdl.so. => /lib/libdl.so. (0x00719000)
  8. libglib-2.0.so. => /lib/libglib-2.0.so. (0x0055e000)
  9. libgthread-2.0.so. => /lib/libgthread-2.0.so. (0x00918000)
  10. libpcre.so. => /lib/libpcre.so. (0x021a8000)
  11. libz.so. => /lib/libz.so. (0x0067b000)
  12. libc.so. => /lib/libc.so. (0x0091d000)
  13. libstdc++.so. => /usr/lib/libstdc++.so. (0x07b14000)
  14. libgcc_s.so. => /lib/libgcc_s.so. (0x0068f000)
  15. /lib/ld-linux.so. (0x0053e000)

测试:

  1. [root@localhost mydumper-0.6.]# mydumper --help
  2. Usage:
  3. mydumper [OPTION...] multi-threaded MySQL dumping
  4.  
  5. Help Options:
  6. -?, --help Show help options
  7.  
  8. Application Options:
  9. -B, --database Database to dump
  10. -T, --tables-list Comma delimited table list to dump (does not exclude regex option)
  11. -o, --outputdir Directory to output files to
  12. -s, --statement-size Attempted size of INSERT statement in bytes, default
  13. -r, --rows Try to split tables into chunks of this many rows. This option turns off --chunk-filesize
  14. -F, --chunk-filesize Split tables into chunks of this output file size. This value is in MB
  15. -c, --compress Compress output files
  16. -e, --build-empty-files Build dump files even if no data available from table
  17. -x, --regex Regular expression for 'db.table' matching
  18. -i, --ignore-engines Comma delimited list of storage engines to ignore
  19. -m, --no-schemas Do not dump table schemas with the data
  20. -k, --no-locks Do not execute the temporary shared read lock. WARNING: This will cause inconsistent backups
  21. --less-locking Minimize locking time on InnoDB tables.
  22. -l, --long-query-guard Set long query timer in seconds, default
  23. -K, --kill-long-queries Kill long running queries (instead of aborting)
  24. -D, --daemon Enable daemon mode
  25. -I, --snapshot-interval Interval between each dump snapshot (in minutes), requires --daemon, default
  26. -L, --logfile Log file name to use, by default stdout is used
  27. --tz-utc SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones, defaults to on use --skip-tz-utc to disable.
  28. --skip-tz-utc
  29. --use-savepoints Use savepoints to reduce metadata locking issues, needs SUPER privilege
  30. --success-on- Not increment error count and Warning instead of Critical in case of table doesn't exist
  31. --lock-all-tables Use LOCK TABLE for all, instead of FTWRL
  32. -h, --host The host to connect to
  33. -u, --user Username with privileges to run the dump
  34. -p, --password User password
  35. -P, --port TCP/IP port to connect to
  36. -S, --socket UNIX domain socket file to use for connection
  37. -t, --threads Number of threads to use, default 4
  38. -C, --compress-protocol Use compression on the MySQL connection
  39. -V, --version Show the program version and exit
  40. -v, --verbose Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2

搞定。

启发:解决问题的最好方法是到官网查看文档和说明。

mydumper 安装报错处理的更多相关文章

  1. MSSQL 2012安装报错之0x858C001B

    之前安装 Microsoft Sql Server 2012 R2 的时候总是报这样的错误: SQL Server Setup has encountered the following error: ...

  2. linux -小记(2)问题:yum 安装报错"Another app is currently holding the yum lock; waiting for it to exit... ...: yum Memory : 26 M RSS (868 MB VSZ) Started: Wed Oct 26 22:48:24 2016 - 0"

    yum 安装报错 "Another app is currently holding the yum lock; waiting for it to exit... The other ap ...

  3. office2010安装报错

    有没有童鞋,在第一次安装office 2010的时候,中途不管是何原因导致中断或者未安装成功的 然后从第二次开始就一直安装报错??? 哈哈,我最近就遇到了 其他很简单,网上有很多方法,也有很多步骤,包 ...

  4. yum安装报错有冲突file /usr/lib64/php/modules/fileinfo.so conflicts between

    yum安装报错有冲突file /usr/lib64/php/modules/fileinfo.so conflicts between attempted installs of php-pecl-f ...

  5. 关于eclipse(64位)下aptana插件安装报错问题解决

    最近一直没有写过js,换了新电脑以后,eclipse下的aptana插件也没有装过,这几天要写js想重新把aptana装上,但是不知怎的,link方式.在线安装方式还有离线包下载下来利用eclipse ...

  6. 使用pip安装报错的处理方法

    在新的机子上使用pip安装程序一直报错: Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connect ...

  7. Python——pip安装报错:is not a supported wheel on this platform

    pip安装报错:is not a supported wheel on this platform 可能的原因1:安装的不是对应python版本的库,下载的库名中cp35代表python3.5,其它同 ...

  8. Scrapy安装报错

    python3 pip 安装Scrapy在win10 安装报错error: Microsoft Visual C++ 14.0 is required. Get it with "Micro ...

  9. Maven的安装、配置及使用入门+maven安装报错:JAVA_HOME【申明:来源于网络】

    Maven的安装.配置及使用入门+maven安装报错:JAVA_HOME[申明:来源于网络] Maven的安装.配置及使用入门:http://www.cnblogs.com/dcba1112/arch ...

随机推荐

  1. Java基础复习笔记系列 八 多线程编程

    Java基础复习笔记系列之 多线程编程 参考地址: http://blog.csdn.net/xuweilinjijis/article/details/8878649 今天的故事,让我们从上面这个图 ...

  2. Verilog学习笔记简单功能实现(七)...............接口设计(并行输入串行输出)

    利用状态机实现比较复杂的接口设计: 这是一个将并行数据转换为串行输出的变换器,利用双向总线输出.这是由EEPROM读写器的缩减得到的,首先对I2C总线特征介绍: I2C总线(inter integra ...

  3. Node.JS模块系统

    1.什么是模块? 为了让Node.js的文件可以相互调用,Node.js提供了一个简单的模块系统. 模块是Node.js 应用程序的基本组成部分,文件和模块是一一对应的.换言之,一个 Node.js ...

  4. 通过angularjs的directive以及service来实现的列表页加载排序分页

    前两篇:(列表页的动态条件搜索,我是如何做列表页的)分别介绍了我们是如何做后端业务系统数据展示类的列表页以及动态搜索的,那么还剩下最重要的一项:数据展示.数据展示一般包含三部分: 数据列头 数据行 分 ...

  5. java中set接口的用法

    java中的set接口有如下的特点: 不允许出现重复元素: 集合中的元素位置无顺序: 有且只有一个值为null的元素. 因为java中的set接口模仿了数学上的set抽象,所以,对应的数学上set的特 ...

  6. ImFire即时通讯系统构建(架构)

    msgServer集群(ms) 设计作用: 该服务主要提供客户端的接入服务.每个ms维护当前接入用户的用户状态和心跳,每个ms地位是对等的. 设计考虑: ms之间不会直接交互,减少交互的复杂度.在用户 ...

  7. Use a cache

    To create high-performance systems, sometimes you need to cache data. Play has a cache library and w ...

  8. 为Apple Push开发的PHP PEAR 包:Services_Apple_PushNotification

    Apple Push Notification Service:通过苹果服务器向app用户推送消息,无需启动app. 苹果官方文档:http://developer.apple.com/library ...

  9. WPF实现炫酷Loading控件

    Win8系统的Loading效果还是很不错的,网上也有人用CSS3等技术实现,研究了一下,并打算用WPF自定义一个Loading控件实现类似的效果,并可以让用户对Loading的颗粒(Particle ...

  10. Unicode Character Table – Unicode 字符大全

    Unicode(统一码.万国码.单一码)是一种在计算机上使用的字符编码.它为每种语言中的每个字符设定了统一并且唯一的二进制编码,以满足跨语言.跨平台进行文本转换.处理的要求.Unicode Chara ...