(CloudSql Import) Cannot import ERROR: ASCII '\0' .. Set --binary mode to 1

3,512 views
Skip to first unread message

Michael Chambers

unread,
May 19, 2017, 9:15:49 AM5/19/17
to Google Cloud SQL discuss
I was trying to import an sql dump file. However I have this error when I import file from 'cloud storage bucket'

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: 'xxxxxx-20170517-1803.sql'.

Then i tried using the shell instead
gcloud beta sql instances import jamsai-analytics-sql gs://xxxxxx-bucket-01/xxxxxx-20170517-1803.tar.gz --database analytics
This will then give the same error previously. So I added --binery-mode 1 to the end of the command, which turns out gcloud not supported it.

ERROR: (gcloud.beta.sql.instances.import) unrecognized arguments:
 
--binary-mode
 
1

Any suggestion method to import  the database?
Currently the import file is compressed at 5GB, It will be very trouble some to modify

Nicholas (Google Cloud Support)

unread,
May 19, 2017, 1:47:14 PM5/19/17
to Google Cloud SQL discuss
Is your file a gzipped .sql file?  Was this uncompressed file created with mysqldump?  Where did this file come from?

Michael Chambers

unread,
May 22, 2017, 1:33:37 AM5/22/17
to Google Cloud SQL discuss
The file is in .tar.gz, Yes is it created by mysqldump from mysql

Michael Chambers

unread,
May 22, 2017, 11:53:30 PM5/22/17
to Google Cloud SQL discuss
I have managed to import using another VM. Using command 

tar -xzOf data.tar.gz | mysql -u dev -pPAssword -h x.x.x.x data
Reply all
Reply to author
Forward
0 new messages