UTF-8 error importing sql file from phpMyAdmin

1,089 views
Skip to first unread message

Wonder95

unread,
May 2, 2009, 9:47:15 PM5/2/09
to Sequel Pro
I just installed Sequel Pro and created a database, and tried to
import a .sql file created using phpMyAdmin on my web server.
However, when I try to import it, I get the following error:

The file myfile.sql could not be opened using text encoding Unicode
(UTF-8).

I have imported files many times from phpMyAdmin, so I'm not sure what
the problem is. Is there something I need to do to the file or
something I need to set in phpMyAdmin when I create the file?

Thanks.

Rowan Beentje

unread,
May 3, 2009, 11:12:41 AM5/3/09
to seque...@googlegroups.com
Hi Wonder95,

Sequel Pro 0.9.5 changed a few things for SQL export and import,
defaulting to UTF8 so that encodings are correctly preserved.
However, the import code still attempts to be backwards compatible in
that it first tries UTF8 and then falls back to the old method, which
uses the current connection encoding to read/import the file.

From the error you're getting I would venture that phpMyAdmin has
exported the file in a different encoding - potentially Latin1? - and
that you're reading it in with an encoding set to UTF8, so that it
first tries the UTF8 read and then falls back to the connection
encoding - which in this case is also UTF8.

When you created the new database, did you specify the encoding, or
did you leave it at the default (which may be UTF8 for your server)?

I'd suggest trying two things:
1) To get the import working, go to the Database menu -> "View Using
Encoding" -> and choose "ISO Latin 1" (or whatever format the SQL
export is in). Then try the import again; this should allow the file
to be imported.
2) To simplify this in future, you can specify your new database to be
created as Latin1 so the connection is automatically set.

Hope that helps,
Rowan
(Sequel Pro contributor)

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Sequel Pro" group.
> To post to this group, send email to seque...@googlegroups.com
> To unsubscribe from this group, send email to sequel-pro+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sequel-pro?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

Reply all
Reply to author
Forward
0 new messages