I formatted my System (C:)in which my database files are stored unfortunately my database backup have lost.I used recovering tools to recover my database files as dump file.when i tried to restore my dump file its displaying error as i mentioned below,
18:00:34 Restoring E:\pos1.sql
Running: mysql.exe --defaults-file="c:\users\ashfaq\appdata\local\temp\tmpdi5lll.cnf" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "E:\pos1.sql"
ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: ''.
Operation failed with exitcode 1
18:00:36 Import of E:\pos1.sql has finished with 1 errors
any help will be appreciated...
Related
I have 29GB magento db .sql file that need to be imported into mysql database, I am using Ubuntu 22.04 operating system
I import into database using command line as below
mysql -u root -p
mysql > USE magento_project1
mysql > source db_dump.sql
The import seems to be working fine at first, but after a few hours of importing error as below comes out
ERROR at line 44259: ASCII '\0' appeard in the statement, but this is not alllowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: '
Attached the image of the error
I noticed the query stopped when at the part it need to insert data into sales_order_payment table
I have try
rename the db_dump.sql file to db_dump.sql.gz
based on solution given here
import using command mysql -u root -p -f -D database_name < db_dump.sql.gz
when create database, create charset as utf8mb4, collation utf8mb4_general_ci
import using command mysql -u root -p -h localhost -D database_name --binary-mode -o < db_dump.sql
based on solution given here
When i write command file db_dump.sql.gz I get the result as below
db_dump.sql.gz: ASCII text, with very long lines (37268)
My ubuntu is already sudo apt-update and sudo apt-upgrade with mysql, php, nginx and elasticsearch installed and enabled
But none of the solution above fix the issue I am having
Able to fix the issue by dumping new database from magento cloud using command below
magento-cloud db:dump
0 -> Staging -> 0 ( database )
then import the db into local using command below
mysql -u root -p -f -D local_db < dumped_db.sql
Not sure what cause the error above on the first place, might be the db corrupted somewhere during transfer between pendrive ?
I want to export from my live server pc the databses for my web apps and site,but I get the following errors:
14:18:07 Dumping ct (all tables)
Running: mysqldump.exe --defaults-file="c:\users\admini~1\appdata\local\temp\tmphnpsqu.cnf" --user=root --host=localhost --protocol=tcp --port=3306 --default-character-set=utf8 --routines --skip-triggers "ct"
Error executing task: 'ascii' codec can't encode character u'\xe4' in position 6: ordinal not in range(128)
Error executing task [Error 32] The process cannot access the file because it is being used by another process: 'c:\users\admini~1\appdata\local\temp\tmphnpsqu.cnf'
14:18:08 Export of C:\Users\Administrator\Documents\dumps\Dump20210825 (2).sql has finished
Open the task manager (ctrl+alt+delete) then go to processes, look for the process that's using the file and end it. After this, try exporting your schema again.
I recently backed up a MySQL database in anticipation of a hardware swap out. After installing MySQL on the new hardware I attempted to import the database via MySQL WorkBench. All the tables imported correctly from the complete dump until it hit the Results file – this file contains a number of large BLObs. The preceding Random file which contains smaller BLObs imported correctly. After a number of failures I went to an older dump of individual files with the following result:-
17:35:20 Restoring /media/Week 1/MySQL/Dump20141112/Physio_Results.sql
Running: mysql --defaults-extra-file="/tmp/tmpydQEsK/extraparams.cnf" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "/media/Week 1/MySQL/Dump20141112/Physio_Results.sql"
ERROR 2006 (HY000) at line 51: MySQL server has gone away
Operation failed with exitcode 1
17:35:21 Import of /media/Week 1/MySQL/Dump20141112/Physio_Results.sql has finished with 1 errors
17:36:11 Restoring /media/Week 1/MySQL/Dump20141112/Physio_Session.sql
Running: mysql --defaults-extra-file="/tmp/tmpnAksEb/extraparams.cnf" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "/media/Week 1/MySQL/Dump20141112/Physio_Session.sql"
17:36:12 Import of /media/Week 1/MySQL/Dump20141112/Physio_Session.sql has finished
So obviously the larger BLObs are causing an issue but how do I overcome this? The documentation I looked at only says:-
Error Code: 2006 MySQL server has gone away
which adds nothing!
After increasing maxallowedpacket and netbufferlength I got slightly further, see below. I am unsure where to go next as I seem unable to restore data that I was allowed to export!
16:19:45 Restoring Physio (Results)
Running: mysql --defaults-extra-file="/tmp/tmpyme2U4/extraparams.cnf" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "/home/mjh/Desktop/Dump20141112/Physio_Results.sql"
ERROR 1118 (42000) at line 53: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
Operation failed with exitcode 1
16:19:54 Import of /home/mjh/Desktop/Dump20141112 has finished with 1 errors
I successfully created a mysqldump file myDump.sql of a myDb1 database using guidelines from this thread. Also I created a second database myDb2, navigated to the directory containing myDump.sql and trying to restore it into the new database myDb2 but failing, Two methods I tried:
> mysql -u root -p myDb2 < myDump.sql;
> -- entered password
and:
> mysql -u root -p
mysql> -- entered password
mysql> USE myDb2;
mysql> SOURCE myDump.sql;
Both have the same error message:
ERROR:
ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in
non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: ' ■-'.
I'd also like to know if I need to use the same database name as the old db for the new one. I tried with a different and same names, but with this same result error.
This is probably caused by coding systems.
My dump file is generated using redirection (">") in powershell and I encountered the same problem. The output redirection generated a file with UTF-16 Little endian.
However, this can be solved by converting the dumpfile into utf-8. This can be done in emacs as:
M-x set-buffer-file-coding-system
Then save the file and import again.
The coding system of a file can be detected using GNU "file" utility, and it also available in windows and can be found here: http://gnuwin32.sourceforge.net/packages/file.htm
For future use, a better dump command like:
mysqldump <dbname> -r <filename>
Check the myDump.sql file, it maybe a coding error in the file. These garbage characters cause this problem. Delete the garbage characters to solve the issue.
Open with Sequel Pro shows this
`í}k¯]ÇÝçðWÜ?øy«««_%c�sè;¶`Ìô hãEE¤"8Áü÷ô>ûqzW¯:êmX0`²¸yyëÔºµë¹êGw?û+þ{ð£»g¯ÿçw¯¿ºû/ß¾¹{ö/ï^}÷§oªô__ûöË7_ß'éÁªà¿¿{÷ÍÇ}ôý÷ßOo/ãoßL_¼ùÓG×?ûâÍ«×Óß¼ùãW¯/òÍGË?`
I'm on a japanese system using xampp. This is the line I use to dump my database.
c:\xampp\mysql\bin>mysqldump.exe -uroot wp_newsja > dump.sql
Then I create a database on another server.
c:\xampp\mysql\bin>mysqladmin -uroot create db
But when I try to execute the sql...
c:\xampp\mysql\bin>mysql -uroot db < dump.sql
... I get the following error.
ERROR at line 145: Unknown command '¥''.
On a japanese computer windows path slashes / are represented with "¥". Which leads me to believe this is an utf8 issue. Maybe there is a way I can mysqldump with some utf8 flag? Thanks for any assistance! The exported sql is here: http://goo.gl/7MPVG - Error at line 145:
edit: Problem solved:
mysql --default-character-set=utf8 db < dump.sql
Sorry if I wasted anyone's time.
mysql --default-character-set=utf8 db < dump.sql
You can add this argument --default-character-set=utf8 in the command:
mysql -u USERNAME -p my_database --default-character-set=utf8 < "C:/My Document Names Have Spaces/my_dump.sql"
I've finally found this solution and it works fine with my new installed WampServer 2.5. I've also tried to add the default character setting in my.ini, but it's useless. Until I've tried the above argument added in my DOS batch file.
My batch file execute the command, like this way:
7zip x -so %1.%2.7z|%mysql% -uxxxx -pyyyyy %2 --default-character-set=utf8
For example, the 7zip filename is 20141231.google.7z, which contains "google.sql", and the database name is google
My backup process on Linux system was a 7zip compressed. In Winodws, I used an automatic batch file to restore the same contents, so that I can share the same database in my biz trip and work offline from the server.
Hope this method is helpful to you.