1
votes

I'm using MySQL Workbench 6.3.6 build 511 CE (64 bits) with MySQL 5.6.25 on Windows 10 that was bundled with XAMPP 5.6.11.

It used to work fine for almost a month in this configuration. I don't recall changing any settings, but suddenly now when I want to export my db it throws this error

mysqldump: Got error: 2013: Lost connection to MySQL server at 'reading authorization packet', system error: 2 when trying to connect

Operation failed with exitcode 2

The error appears even when I try calling mysqldump myself from cmd.

The command that workbench used was this

14:23:26 Dumping invento (all tables)
Running: mysqldump.exe --defaults-file="c:\users\rog\appdata\local\temp\tmp0apjw4.cnf"  --host=127.0.0.1 --insert-ignore=TRUE --protocol=tcp --user=root --force=TRUE --port=3306 --default-character-set=utf8 --routines --events "invento"

I should add that the error doesn't always appear

1

1 Answers

0
votes

Exit code 2 usually indicates that there is a permissions problem. The most usual suspect is the lack of permissions for the LOCK TABLES command on the given database or table(s) you are trying to dump.

Make sure that the user you use to create the backup with has this permission on the given database table(s). Alternatively you can use the --skip-lock-tables mysqldump option (also see the documentation), so you'll get something like:

mysqldump.exe --defaults-file="c:\users\rog\appdata\local\temp\tmp0apjw4.cnf"
--host=127.0.0.1 --insert-ignore=TRUE --protocol=tcp
--user=root --force=TRUE --port=3306 --default-character-set=utf8
--routines --events "invento"
--skip-lock-tables