Following the steps to import .sql file using MySQL Workbench suggested on Import an SQL file in MySQL (Using CMD or Powershell) - QA With Experts I get the following ERROR: ‘utf-8’ codec can’t decode byte 0xe4 in position 27: invalid continuation byte
01:39:58 Restoring C:\Users\msw1d\Desktop__MACOSX\SQL Course Materials._create-db-store.sql
Running: mysql.exe --defaults-file=“C:\Users\msw1d\AppData\Local\Temp\tmprj6mo71c.cnf” --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=mysql < “C:\Users\msw1d\Desktop\__MACOSX\SQL Course Materials\._create-db-store.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: ‘’.
WHAT AM I DOING WRONG ?
are you sure you are importing the right file?
._create-db-store.sql
- this is MACOSX meta data file and should not be imported, it should be the actual script to import, so something like create-db-store.sql
Thank You Lucidlear for your quick reply. When I import the file create-databases.sql I get the following error: Dump file not found. File C:\Users\msw1d\Desktop\Mosh SQL_MACOSX\SQL Course Materials\create-databases.sql doesn’t exist.
So I am still doing something wrong.
can you try File > Run SQL Script in workbench and browse to the file location for create-db-store.sql
and run it like that
Thanks again lucidlear:
Hears what I get following your suggestion: Run SQL Script
‘charmap’ codec can’t decode byte 0x81 in position 229: character maps to
If your sure its the right file, then it looks like an encoding issue. In MySQL Workbench, go to: Edit > Preferences > SQL Editor > Encoding
Make sure its set to UTF-8
Then make sure the script is encoded with UTF-8 also, you may need to copy the contents of the script and paste and resave it in an editor with the encoding set to UTF-8