If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Importing data to mysql that contains foreign charecters

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-11, 13:30
ed65 ed65 is offline
Registered User
 
Join Date: Jul 2011
Posts: 1
Importing data to mysql that contains foreign charecters

Hi,

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.

Thanks,

Simon.

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On