Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2011

    Unanswered: Importing data to mysql that contains foreign charecters


    I have a .sql file created in notepad which I need to populate my database with. Up until now I was simply using

    mysql -u root -p testdb < test.sql

    However, I noticed that foreign charecters like or for example were not being converted properly. They showed as weird squiggles when I looked in the mysql client at the data.

    The line I used to create the database included collation and character set information:

    CREATE DATABASE testdb CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    and then no other collation and chareceter set information i.e for the tables.

    The or type charecters show fine in the mysql client if I input them directly though the client.

    However I can't load the data in directly through the client becuase there is too much data !

    I tried using :

    mysql -u root -p testdb --default-character-set=utf8 < test.sql

    No errors were given at the command line, but the foreign charecters still show as weird squiggles in the mysql client, albeit different weird squiggles.

    Any help would be great.


    Last edited by ed65; 07-09-11 at 13:33.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts