Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:25:13+00:00 2026-06-13T20:25:13+00:00

Importing UTF8-encoded data into mysql is not working for me. UTF8 characters are corrupted.

  • 0

Importing UTF8-encoded data into mysql is not working for me. UTF8 characters are corrupted. For example Nöthnagel is displayed as Nöthnagel

I have created a sql dump file to do the importing which contains UTF-8 encoded data. For example:

INSERT INTO `users` VALUES(1, 'Fred','Nöthnagel');

The sequence of bytes representing ö in the file is c3 b6 which I believe is correct, as it displays correctly in vim and in my bash shell which has these environment variables set:

$ env | grep -i utf
LANG=en_US.UTF-8
XTERM_LOCALE=en_US.UTF-8

The mysql db was created as follows:

mysql> CREATE DATABASE mydb CHARACTER SET utf8;

The mysql table was created so:

CREATE TABLE `users` (  
    `id` int(11) NOT NULL AUTO_INCREMENT,  
    `first_name` varchar(30) NOT NULL,  
    `last_name` varchar(30) NOT NULL,
    PRIMARY KEY (`id`),  
    UNIQUE KEY `last_name` (`last_name`)  
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;  

I am importing the dump file like so:

 mysql -u root -psecret mydb < mydump.sql

Please tell me what is missing from the above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:25:14+00:00Added an answer on June 13, 2026 at 8:25 pm

    I think it might have something to do with collation as well, but I’m not sure. In my case it certainly did, since I had to support cyrillic.
    Try this, worked for me:

    1. Set initial collation while creating the target database to utf8_unicode_ci

    2. Add SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'; to the top of your sql file

    3. Run mysql -u root -p --default-character-set=utf8 yourDB < yourSQLfile.sql

    One more thing, in order to properly get the UTF-8 data form your database, you’ll have to modify your connection string as well. For example:

    mysql.url=jdbc:mysql://localhost:3306/nbs?useJvmCharsetConverters=false&useDynamicCharsetInfo=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&useEncoding=true

    Additionally, take a look at what my problem was.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am importing data from MySQL to PowerPivot. I have all of the relevant
I am importing data from outside into my database MYSQL using PHP Scripts. Encoding
We are importing data from .sql script containing UTF-8 encoded data to MySQL database:
Importing a Maven project into Eclipse has brought up the error: Plugin execution not
I am importing a database from outside which have unicode characters as 我的上网主页 and
I'm working with a remote db for importing data to my Django proyect's db.
I've a problem importing data into a sqlite database. I go like this: I
To illustrate my problem I will give you an example: I have UTF-8 encoded
I'm importing big csv file into my rails app, but i have trouble with
Currently I have perforce that I am importing my project into eclipse from. After

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.