Dump File MySQL 5.6.10 - mysql
I was trying to create a dump file from my MySQL database, but when I try it always gives me this error
Operation failed with exitcode 2
16:06:07 Dumping proactivetraindb (userstate)
Running: mysqldump.exe --defaults-extra-file="h:\docume~1\anarita\locals~1\temp\tmpde5rwy.cnf" --user=root --max_allowed_packet=1G --host=localhost --port=3306 --default-character-set=utf8 "proactivetraindb" "userstate"
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)
The version of MySQl is 5.6.10 but the version of MySQLDump is 5.5.16
Does someone know how to solve this?
As outlined by a previous answer, but just to clarify further: This is for MySQL in Windows.
I was having the exact same issue while trying to dump data out of a table on a local test server, and based on the previous answer, this is how I did it.
Find your mysql original download folder, and look in the /bin folder, there should be a mysqldump.exe.
Go into Workbench Preferences: Edit -> Preferences -> Administrator -> Path to mysqldump Tool, and enter in the path to the mysqldump.exe that you found.
Save by pressing "OK" and restarting Workbench.
Open up terminal, but typing in cmd in the Search area of the start menu (Windows 7), and find the sql folder you found in step 1, and cd into bin. It should look like C:\...\bin>. Here, type in mysqldump -t -u [username] -p [database name] [tablename]. This should dump the data from the [tablename] table into the dump folder as designated in Workbench.
Hope this helps!
I had the same error in MySQL Workbench.
Find out where is the mysqldump tools provided by your install of MySQL 5.6. On my mac it was at "usr/local/mysql-5.6.10-osx10.7-x86_64/bin/mysqldump".
Then I set up this path in MySQL Workbench/Preferences/Administrator/Path to mysqldump Tool
Give MySQL Workbench a restart.
It should work.
The reason for this is that MySQL 5.6 has removed support for "SET OPTION" and your mysql client tools are probably on older version. Most likely 5.5 or 5.1. There is more info about this issue on MySQL bugs website.
The quickest solution is to update your mysql client tools to 5.6 and your problem will be solved. If you are on Linux platform, here is a solution that worked great for me:
http://www.markomedia.com.au/mysqldump-mysql-5-6-problem-solved/
You must use mysqldump 5.6.x to be able to dump mysql 5.6 database, because MySQL 5.6 discontinued and removed support for SET OPTION syntax.
Under 32/64bit Windows you must do:
1.1. (32bit win) Download Windows (x86, 32-bit), ZIP Archive 5.6.19 212.3M http://dev.mysql.com/downloads/mysql/ (direct link http://dev.mysql.com/downloads/file.php?id=452188)
1.2. (64bit win) Download Windows (x86, 64-bit), ZIP Archive 5.6.19 217.2M http://dev.mysql.com/downloads/mysql/ (direct link http://dev.mysql.com/downloads/file.php?id=452189)
2. Extract mysqldump.exe from just downloaded file mysql-5.6.19-win32(64).zip (from /mysql-5.6.19-win32(64)/bin/mysqldump.exe)
3. Replace this just extracted file with your already installed mysqldump.exe file (instalation dir/mysql/bin/mysqldump.exe)
Using Windows 7, a far easier solution for me was to find mysqldump.exe from; C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe
copy it and then replace the MySQL workbench mysqldump.exe which is located in the root of workbench C:\Program Files\MySQL\MySQL Workbench CE 5.2.47\mysqldump.exe
Restart MySQL workbench and all should work fine.
You are probably using Amazon RDS, right?
You can just get the newer version of mysqldump, v5.6 and use it instead.
Download the portable zip here and extract just the mysql\mysqldump.exe there.
http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.8.3/
I tried it just now and it worked fine for me.
If you are using Window 10. Your Mysql server would have been installed in C:\Program Files\MySQL directory and rest all components are installed in C:\Program Files (x86)\MySQL.
Go to MySql Workbench>Edit>Preferences. A window will open, click the Administrator tab and mention the path of your mysqldump.exe (which is present in C:\Program Files\MySQL). Restart your workbench.
Thanks, Happy coding!!
In Workbench look for Preferences: Edit -> Preferences -> Administrator -> Path to the mysqldump Tool. Browse your MySQL folder inside the bin folder and look for mysqldump.exe.
I had this problem on the Amazon EC2 acessing a RDS Mysql 5.6 database. I just ran
sudo apt-get upgrade
It didn't update mysql client to 5.6, but mysqldump now is working fine.
For Mac it depends on your installation.
If you used a dmg file to install it, you need to find the bin directory.
mine was under /usr/local/mysql/bin
You will find mysqldump file under this folder.
Now provide this location in your
Preferences -> Administrator -> Path to mysqldump Tool as /usr/local/mysql/bin/mysqldump
You should be good to export now.
If you are on Linux, update mysql-client to latest version. On Ubuntu:
sudo apt-get upgrade mysql-client
did the job for me.
Setting up mysql-client-5.5 (5.5.43-0ubuntu0.12.04.1) ...
Mine got updated to 5.5 and mysqldump now works for me. This is on Amazon RDS with MySQL 5.6.x
If you're on a linux machine, this is provided by the mysql-client package. Installing that fixed the problem for me.
For compatibility, I needed MySQL 5.6.41 on my Windows 10 machine, so I used the 5.6.41 MySQL installer to install "All" (My Workbench, MySQL, connectors, etc).
Even though I used the installer for version 5.6.41, it installed Workbench 8.0, as well as version 8.0 of the various connectors, etc.
So of course, I got a similar error.
There seems to be no easy way to force lower version of MySQL Workbench to be installed instead (On my previous machine, before workbench 8.0, did NOT have this conflict when installed).
Solution that worked for me:
Find the version of mysqldump.exe that matches the version of MySQL you're using:
From Windows Explorer, I searched my machine for all versions of mysqldump.exe
Right-clicked each mysqldump.exe it found -> Properties -> Details tab.
Found the version 5.6.41 (matching the MySQL version I'm running)
Clicked back to the General tab, to see the folder path that that version of mysqldump.exe was installed in
C:\Program Files\MySQL\MySQL Server 5.6\bin, in my case
(version 8.0 was installed in C:\Program Files\MySQL\MySQL Workbench 8.0 CE)
Now open MySQL Workbench..
Edit -> Preferences -> Administration -> Path to mysqldump Tool
Paste in the file path for the appropriate version of mysqldump.exe (including the file name!)
Click OK
Restart MySQL Workbench
This worked for me. However, I have no idea how to make this work if you have two versions of MySQL on your machine, say MySQL 5.6 and 5.7, or 8.0.
So when I upgrade (any/some/all of) my cloud servers to version 5.7, this looks to be another challenge to overcome. Since Workbench only allows a single mysqldump.exe file, to be used no matter which version of my local MySQL server is running... Or perhaps manually change the path location, each time open a connection that uses the Port to the other MySQL version (and remember to change it back after?).
For this reason, I Removed MySQL 5.7 completely, and will hence keep all cloud (and my local) servers at 5.6 for the time being - a Project for another day.
For Ubuntu users to save your time, mysqldump is in "mysql-community-client_5.7.26-1ubuntu16.04_i386.deb " package
I just had the same problem and I put a couple of different answers together.
The pro for me was, that I could switch easily between 5.6, 8, ... without having to up/downgrade ubuntu dependencies each time.
The easiest way for me on Ubuntu was to just download the 5.6 (or 5.7, whatever you want) mysqldump binary and change that in workbench.
Everything went well after that:
go to https://downloads.mysql.com/archives/community/ and download the correct version you want (for me: 5.6.47 for 64x)
Unpack the archive somewhere, you can find later
Change the mysqldump binary in mysql workbench: Edit -> Preferences -> Administrator -> "Path to mysqldump Tool" to {{YOUR_UNPACKED_FOLDER}}/bin/mysqldump
Save it with Ok
Now you should be able to just export and it will use mysqldump 5.x.
I have Mysql 5.6.12 version. SET SQL_QUOTE_SHOW_CREATE=1 is working fine in my machine.
now i am able to take a dump of sql.
mysql> SET SQL_QUOTE_SHOW_CREATE=1; Query OK, 0 rows affected (0.00
sec)
worked for me.
Related
Mysql Server not start after Migration Assistant in MacOs
I Used Migration Assistant from ios to put my things in another mac. But, after that, my MySQL Server does not run! In System Preferences, my computer say: the mysql server instance is not running Whats happing? I try this: brew services start mysql#5.7 And receive: Error: Formula `mysql#5.7` is not installed.
I do not know why, but my system automatically renamed the MySQL directory during the migration process. I identified that the usr/local/mysql/ directory was now called usr/local/mysql-5.7.21-macos10.13-x86_64/ What I did that solved the problem, was to create a symbolic link sudo ln -s mysql-5.7.21-macos10.13-x86_64 mysql I rebooted my mac, and everything worked correctly. you will probably need to identify the new directory name with the command ls usr/local
How to disable column-statistics in MySQL 8 permanently?
Since MySQL 8 the column-statistics flag is enabled by default. So if you try to dump some tables with MySQL Workbench 8.0.12, you get this error message: 14:50:22 Dumping db (table_name) Running: mysqldump.exe --defaults-file="c:\users\username\appdata\local\temp\tmpvu0mxn.cnf" --user=db_user --host=db_host --protocol=tcp --port=1337 --default-character-set=utf8 --skip-triggers "db_name" "table_name" mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'db_name' AND TABLE_NAME = 'table_name';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109) Operation failed with exitcode 2 14:50:24 Export of C:\path\to\my\dump has finished with 1 errors Is there any way in MySQL (Workbench) 8 to disable column-statistics permanently? Workaround 1 An annoying workaround is doing it by hand via: mysqldump --column-statistics=0 --host=... Workaround 2 rename mysqldump create a shell script (or batch on Windows) call the renamed mysqldump with the --column-statistics=0 argument within this script save it as mysqldump Workaround 3 download MySQL 5.7 extract mysqldump use this mysqldump For example in MySQL Workbench: Edit / Preferences... / Administration / Path to mysqldump Tool Thanks in advance!
Workaround for me: Create file named mysqldump.cmd with contents: #echo off "c:\Program Files\MySQL\MySQL Workbench 8.0 CE\mysqldump.exe" %* --column-statistics=0 (replace path to mysqldump.exe if necessary) Open MySQL Workbench and go to Edit > Preferences > Administration, change path to mysqldump tool and point it to mysqldump.cmd
Easiest Work Around When using Mysql Workbench 8.0 Open the "Data Export" Tab Click Advanced Options Under the Other heading, set column statistics to 0 Export again Best of luck!
I have download the version 8.0.16, still the same issue. At data export advanced options I didn't saw any option about "statistics"! I have add at my.ini at [mysqldump] quick max_allowed_packet = 16M column-statistics=0 Doesn't solve the issue I have been googling but I couldn't find the solution. I find a of companions who are strugling with this but not anyone with the solution at least for me. At the end I have changed at MySQL Workbench file c:\Program Files\MySQL\MySQL Workbench 8.0 CE\modules\wb_admin_export.py: skip_column_statistics = True #if get_mysqldump_version() > Version(8, 0, 2) and self.owner.ctrl_be.target_version < Version(8, 0, 0) else False I have made comment of if get_mysqldump... I know this is not the way, but I can't find now another better solution. For me is this at least weird and strange. If anyone has a better solution let me know! P.S. Restart Workbench after change has been made
The idea is this: each server version has a dedicated mysqldump version. Not ideal and certainly not very backwards compatible, but that's the situation. MySQL Workbench can only include one mysqldump binary, so the latest one is used. The approach to download the MySQL 5.7 zip and use mysqldump from there is a good workaround without many side effects. You only have to be careful which server you dump with which dump version. If you like to have that column stat flag automatically applied by MySQL Workbench please file a bug report at https://bugs.mysql.com. Update Meanwhile a bug report has been created for this issue: https://bugs.mysql.com/bug.php?id=91640
WINDOWS USERS I have MySQL Workbench 8.0CE and Xampp v3.2.3 and this worked for me: Open xampp, and open mysql config > my.ini // add: column-statistics = 0 so: [mysqldump] quick max_allowed_packet = 16M column-statistics = 0 Save and close, reboot xampp mysql server. (just in case) in Workbench: Edit > Preferences > Administration In Mysqldump route put your mysqldump route of xampp, in my case: C:\xampp\mysql\bin\mysqldump.exe This worked for me!
There may be another workaround if you are running an OS that supports mysqldump (i.e. Linux). Set the path to the mysqldump binary in the preferences and include the --column-statistics=0 argument in the path, in: Edit >> Preferences >> Administration >> path to MysqlDump Tool
From Mysql-workbench version 8.0.14 you don't have the option to disable column-statistics. But you have an option to do it by enabling delete-master-logs: https://stackoverflow.com/a/64855306/10747412
Download the last version of Mysql Workbench 8.0.16 and no more problems. https://dev.mysql.com/downloads/workbench/ No option to check !
Open MySQL Workbench Preferences and choose Path to mysqldump Tool accordiing to your xampp / mysql server path MySQL Workbench Edit > Preferences > Administration C:\xampp\mysql\bin\mysqldump.exe that's it
I am using Ubuntu 16.04, MySql Workbench 6.3.6, MySql 8.0.25, MySqlDump 8.0.25. My workaround is as follows: Open /usr/lib/mysql-workbench/modules/wb_admin_export.py Replace s = re.match(".*Distrib ([\d.a-z]+).*", output) with s = re.match(".*mysqldump Ver ([\d.]+).*", output) Replace cmd = subprocess.list2cmdline(args) with args.append("--column-statistics=0") cmd = subprocess.list2cmdline(args)
Linux users Same idea as the other answer above on Windows, here is a way to globally change the mysql settings on Linux so that you do not need to write mysqldump --column-statistics=0 anymore. Quote from Server Fault Stack Exchange at mysqldump throws: Unknown table 'COLUMN_STATISTICS' in information_schema (1109), highly upvoted there: To disable column statistics by default, you can add [mysqldump] column-statistics=0 to a MySQL config file. Go to /etc/my.cnf, ~/.my.cnf, or directly to /etc/mysql/mysql.cnf. I recommend changing it directly in the /etc/mysql/mysql.cnf.
I fixed this by amending the MySQL Workbench config file wb_admin_export.py. See my answer here.
[![Export From DBEAVER with extra command][1]][1] For me, I just added an extra command and it worked for me! [1]: https://i.stack.imgur.com/9iBvO.png
Mac user: /Applications/MySQLWorkbench.app/Contents/Resources/plugins Update file wb_admin_export.py to skip_column_statistics in all cases. skip_column_statistics = True # if get_mysqldump_version() > Version(8, 0, 2) and self.owner.ctrl_be.target_version < Version(8, 0, 0) else False
How can I change MariaDB to MySQL in XAMPP?
A. First things first: Mr. Google hasn't helped me to found any reply to my question above Yes, I have read a solution to the opposite question here How to upgrade MySQL to MariaDB in XAMPP in 5 minutes on Windows (and it hasn't helped me: MySQL simply doesn't start) I don't expect replies like 'MariaDB is better, - stop your silly exercises'. B. I am working with MySQL Workbench and because of that don't want to face any incompatibilities either now or in future. C. Can someone share their experience (if any) in solving this problem?
Running XAMPP with MySQL Here are exact step by step instructions for truly integrating MySQL into XAMPP on Windows. This has been successfully tested with Windows 10 and XAMPP 7.3.11 for both MySQL 8.0.18 and 5.7.28. Stop MySQL (which actually is MariaDB) in the XAMPP Control Panel. Download the MySQL community server as zip archive (Windows 64 bit version) Rename C:\xampp\mysql to C:\xampp\mariadb Extract the downloaded zip archive to C:\xampp\mysql. Make sure you extract the folder level which has the subfolders bin, include, lib etc. Copy C:\xampp\mariadb\bin\my.ini to C:\xampp\mysql\bin Open C:\xampp\mysql\bin\my.ini in an editor and comment out the line starting with key_buffer= in the [mysqld] section. Open a command prompt and run the following commands: For MySQL 8.0.18: cd C:\xampp\mysql bin\mysqld --initialize-insecure start /b bin\mysqld bin\mysql -u root CREATE USER pma#localhost; SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql; GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma#localhost; ALTER USER root#localhost IDENTIFIED WITH mysql_native_password BY ''; ALTER USER pma#localhost IDENTIFIED WITH mysql_native_password BY ''; \q bin\mysqladmin -u root shutdown For MySQL 5.7.28: cd C:\xampp\mysql bin\mysqld --initialize-insecure --log_syslog=0 start /b bin\mysqld --log_syslog=0 bin\mysql -u root CREATE USER pma#localhost; SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql; GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma#localhost; \q bin\mysqladmin -u root shutdown Start Apache and MySQL in the XAMPP Control Panel. Go to http://localhost/phpmyadmin and verify that your database server is now reported as MySQL Community Server.
You can use the following way. Stop MariaDB in Xampp which show as mysql running... Download the installer for windows mysql Installer Follow the instruction. Now start Apache2 and clear cookie in your browser. Now you can see phpmyadmin and workbench showing Server type: MySQL If you want to stick to MariaDB then you can use sqlyog also. Hope it answer your question
You have to do little adjustment with xampp in order to use MySQL instead of MariaDB . I just did following and its worked , i think it may helpful to others also. Download and install mysql installer. 2.stop xampp and rename the mysql folder inside the xampp directory(may be its not necessary! ) 3.just start Apache only from xampp control panel . No need to start mysql. 4.Last step . Make sure your running MySQL in your system . That's it .. Check php admin panel there you can see Server type: MySQL instead of MariaDB ... Thanks..
I just upgraded XAMPP because of PHP 7. I am also using mysql workbench. I want to be as close to production as I can, but my webhoster supports only mysql. These where my reasons to switch back from mariadb to mysql I followed these steps: (also max 5min) https://gist.github.com/odan/c799417460470c3776ffa8adce57eece
MySQL Dump Not Working In MySQL
I just installed a new Windows 7 Professional machine with MySQL 5.6.22. When trying to run the mysqldump command, I get the following: E:>mysqldump -u root -p world > world.sql mysqldump: unknown option '--no-beep' Mysqldump works fine on my other machines running 5.16.15 and 5.5.xx. Unfortunately, the msi installer for MySQL 5.6.15 will not work as some packages cannot be found. Oracle, it seems, will not support previous editions of 5.6. On top of that, the MySQL installer for 5.6.23 only installs 5.6.22 in a round about way. The MSI installer has issues. Can anyone shed light on mysqldump not working in 5.6.22? Thanks!
I think you need to run the mysqldump command from the path it is installed, first cd into the folder and then run the command like this C:\MySQL\MySQL Server 5.6\bin>mysqldump -u root -p -B database>name_of_backup_file.sql
I had the same issue. Search your active my.ini for the [client] section. Likely you will find the following: [client] no-beep Comment or delete no-beep. It solves the 'no-beep' issue (now I have a new annoying error, hooray!). Be carefully checking whats your active my.ini because you might have some on different places. Edit: Now, as I can call mysqldump w/o error, option --help tells me the follwing: Default options are read from the following files in the given order: C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf [Your Server DIR]\my.ini [Your Server DIR]\my.cnf
anyone get mysql workbench 5.2 to work with mamp?
i cannot get mysql workbench 5.2 to work. i have mamp and mamp pro installed and running and no matter what type of connection i try it just wont connect. what can i do? i have a mac with snow leopard
In MySQL workbench use Connection Method: Local Connection/Pipe and in the setting Socket/Pipe path enter: /Applications/MAMP/tmp/mysql/mysql.sock then enter your root username/password.
There are two tasks that need to be fixed to get MySQL Workbench working with a MAMP installation: 1) The Start/Stop/Status commands for the MySql server need to changed from the Server Instance configuration to the following: Set the Start MySQL command to: /Applications/MAMP/bin/startMysql.sh Set the Stop MySQL command to: /Applications/MAMP/bin/startMysql.sh Set the Check MySQL Status command to: ps xa | grep "/Applications/MAMP/Library/bin/[m]ysqld" 2) The my.cnf file needs to be created manually and the appropriate permissions given through a terminal window: Utilities -> Terminal sudo touch /etc/my.cnf sudo chown joeb /etc/my.cnf Changed joeb with your username. If you want a more detailed guide, see MAMP, MySQL Workbench, WordPress installation and setup guide for MAC.
I follwed these instructions and got it to work: http://chrischarlton.us/tip/using-mysql-workbench-mamp-pro