Trouble importing a database

I have a website hosted on DreamHost that I’d like to run from Local. I’ve created an archive of the site using Duplicator, but when importing the archive into Local I run into a database error. This is what appears in the logs:

"stack":"Error: ERROR at line 24: 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.

When I’ve looked up the issue, I mainly see people recommending to unzip the file before importing, but as far as I can tell that does not seem to work for running on Local. Is there something else that can be done? Where would I set --binary-mode in the first place?

Hey @nightmaresinclr – Welcome to the Local community!

That error does seem to indicate that the data in the database is of an older format and may be causing issues when importing into Local.

In terms of how to manually install a WordPress site within Local, we have this help doc which goes over that process:

The main difference would be that instead of the wpcli command in the help doc, I think you’ll need to use the raw MySQL command, using the DB_NAME, DB_USER, and DB_PASSWORD that are set in the wp-config.php file. By default, Local sites use local, root and root for those values, so instead of:

wp db import your-database-filename.sql

I think you’d want something like this (using the actual name of the sql file):

mysql --binary-mode -uroot -proot local < database-dump.sql

Hope that helps give you a little direction! Let us know how it goes!

I imported manually and it looks good! Thanks so much for the direction!

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.