I am using a webserver that is administered by someone else. The version of mysqldump on this server is from 2011:

$ mysqldump --help mysqldump Ver 10.13 Distrib 5.1.63, for debian-linux-gnu (x86_64) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

As a result, when I try to do a database dump, I get this output:

mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)

According to this link I need to upgrade mysqldump.

I asked my sysadmin to do it, and got generic non-helpful responses. I doubt I will be able to convince them to do the upgrade. Moving to a new server is not an option at the moment.

Is there some way I can download and compile a local version in my home directory (without having to compile a gazillion dependencies)? If so, would you mind pointing me in the right direction?



Your link also contains the quickest solution:

Andre Couture • 3 years ago

Hi, I had the same issue trying to mysqldump a 5.6 database in order to downgrade. I took a slightly different approach as I did not had the luxury to install mysql-client5.6

I simply did a copy of /usr/bin/mysqldump, vi -b mysqldump look for SET OPTION ( use the '/' command) replace the first character by # in order to read "#ET OPTION" (use the 'r' command) save and ran my dump ( ESC :x )

Now you have a version of mysqldump that can connect and dump data from mysql5.6

Worked like a charm for me

  • Wow, that may be the dirtiest solution I've ever seen for a problem like this. Thanks for pointing it out. :-D
    – JoshuaD
    Dec 11 '16 at 22:35
  • 1
    Hahaha that's pretty evil, in a good way. The problem, though, is that this only gives you a version that isn't obviously broken. There are changes in 5.6, like global transaction identifiers (GTID) which, if enabled, wouldn't result in a thoroughly valid dump file. Dec 11 '16 at 23:36
  • 1
    another quick'n dirty solution: github.com/divinity76/static_bin/tree/static_mysqldump
    – hanshenrik
    Mar 6 '20 at 18:48

Check the server's hard drive, first. If they're running a newer version of MySQL, the correct version of mysqldump really should be there... maybe they just don't have it in the search path, or the old one is higher up in the search sequence.

Otherwise... nust find a copy of the executable from a similar machine, and sftp it over. There are pre-built binaries in tarballs on the official download site look for the "Linux Generic Compressed TAR" 32 or 64 bit version as appropriate. There should be no need to compile anything or "install" anything. The file will be in the bin/ directory. That should be all you need. I'm reasonably sure it's entirely self-contained.

Or copy it from your machine. They're pretty painlessly portable.

But also... you do know that there's no need to run mysqldump on the server machine, right? It doesn't care where it is running. It doesn't read anything from the server's hard drive. It uses an ordinary client connection, through the unix socket locally or to TCP port 3306 otherwise, and all the data flows over that connection... which... if that's not directly open to you, you can usually manage to transport across a tunnel riding free with your ssh shell session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.