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
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
Related
I have even switched to the \sql mode.
I have tried \connect root#localhost;
I have tried with mysql --host=localhost --port=3306 --user=root -p;
I am new to this . I installed the entire .msi package too.
If i run the MySql Command Line Client, everything works.
This brings me to another doubt. What is the purpose of MySQl shell?
This is the first time I use MySQL Workbench 6.3, but now I'm facing an error when I export my database. This is the error I get:
Running: mysqldump.exe --defaults-file="c:\users\chamro~1\appdata\local\temp\tmp7p3dqt.cnf" --delayed-insert=TRUE --protocol=tcp --allow-keywords=TRUE --default-character-set=utf8 --host=127.0.0.1 --insert-ignore=TRUE --user=root --complete-insert=TRUE --replace=TRUE --port=3306 --skip-triggers --no-data --no-create-db --no-create-info --routines "loansystem"
mysqldump: [ERROR] unknown variable 'delayed-insert=TRUE'
Operation failed with exitcode 7
08:18:23 Export of D:\user\Database\Loan Export has finished with 47 errors
I've searched a lot but cannot find any help that solves my problem.
The delayed-insert option has been removed from mysqldump and is no longer accepted. In the latest version of MySQL Workbench (6.3.6 at the time of this writing) this problem is solved.
I am trying to restore a mysql db using a .sql.gz file. I am using mySql console to run a command because file size is too large for phpMyAdmin. Command I am using is
gunzip C:/Vik/Gya/Source/beed_2013-04-06.sql.gz | mysql -u root -p bd
where root is the user id. There is no password for root. bd is the database to which I am trying to import. mysql is running on my local machine (Windows 8). I have a wamp setup.
This is the error I am getting:
ERROR 1064 (42000): 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 'gunzip
C:/Vikalp/Gyankosh/Source/beedictionary_2013-04-06.sql | mysql -u root
-p' at line 1.
You need -c option (output to stdout)
gunzip -c xxx.sql.gz |mysql -u root -p
While Kisoft´s answer is the correct one, I just wanted to point out that you don´t need the -c, it works just fine as it is.
this command will unzip the database dump and import it into the database at the same time.
gunzip < output.sql.gz | mysql -u <username> -p<password> <database>
If you type gunzip and you get a SQL syntax error that complaints about gunzip, you are already logged into the mysql console. The mysql console is not a general purpose shell!
You are using Windows and I suspect you haven't installed gzip in your computer (it isn't a builtin utility). It's a classical Unix tool but you can find binaries for Windows. Install it and run your original command with a couple of tweaks:
Make sure you're in Windows prompt (C:\>)
Redirect gunzip result to stdout rather than a file:
gunzip --stdout C:/Vik/Gya/Source/beed_2013-04-06.sql.gz | mysql -u root -p bd
Alternatively, you can run the dump from within MySQL promt (mysql>) if you uncompress it first (you don't need specifically command-line gzip, most GUI archivers such as 7-Zip support this format):
mysql> \. C:/Vikalp/Gyankosh/Source/beedictionary_2013-04-06.sql
you do not need to gunzip
just:
zcat myfile.gz | mysql -uuser -ppassword mydatabase
it is faster this way
Your answer is already here
phpMyAdmin: Can't import huge database file, any suggestions?
Under php.ini file, normally located in c:\xampp\php or wampp whatever you called
post_max_size=128M
upload_max_filesize=128M
Changing value there will get you what you want.Good luck
Dont forget to restart , apache and mysql .
Try this following steps to restore db using .gz files:
1. Run command : gunzip C:/Vik/Gya/Source/beed_2013-04-06.sql.gz
This will uncompress the .gz file and will just store beed_2013-04-06.sql in the same location.
2. Type the following command to import sql data file:
mysql -u username -p bd < C:/Vik/Gya/Source/beed_2013-04-06.sql
Does mysqldump utility requires any seperate client ??
I'm using MYSQL5.5 command line client for windows..
I'm writing query
mysqldump -u root -p pwd** my_db > mydb.sql
I'm getting the error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax t
The problem is that you're running the command in the MySQL command line client. Run it from a shell instead, not inside of the client.
In other words, open a normal shell (cmd.exe if using Windows), and run: (your path to mysqldump.exe will no doubt differ)
C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump -u root -ppwd** my_db > mydb.sql
Do not open up the MySQL command line client and run that command inside of there. That client is for executing SQL; the mysqldump.exe program is completely separate and runs on its own.
> not <
You're dumping the file mysql.sql INTO mysqldump, not out of it
mysqldump -u root -p pwd** my_db > mydb.sql
When i try do database backup in Linux i got this error,
"Got error: 1296: Got error 157 'Unknown error code' from NDBCLUSTER when using LOCK TABLE"
can someone please guide me what i have to do to solve this error.
Thanks.
Execute the following from the linux shell to make a database dump (backup)
mysqldump -p -u[username] --no-lock-tables [database]>dumpfile.sql
replace [username] and [database] with the appropriate credentials of yours, like:
mysqldump -p -uroot --no-lock-tables mydb>dumpfile.sql