markzzz
markzzz

Reputation: 47955

Problem exporting-importing table

I have this kind of table on my Database MySql :

CREATE TABLE `users` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`surname` VARCHAR(255) NOT NULL,
`nickname` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`mail` VARCHAR(255) NOT NULL,
`country` VARCHAR(255) NOT NULL,
`birthday` VARCHAR(255) NOT NULL DEFAULT '0000-00-00',
`accessres` TINYINT(11) UNSIGNED NOT NULL DEFAULT '0',
`admin` TINYINT(11) UNSIGNED NOT NULL DEFAULT '0',
`datereg` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`forum_ban` TINYINT(11) UNSIGNED NOT NULL DEFAULT '0',
`last_access` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
ROW_FORMAT=DEFAULT
AUTO_INCREMENT=209

How you can see, collate is utf8_general_ci. The problem is when I export-import this table using HeidiSQL (6.0)-phpMYADMIN.

For example, if I have data such as Krüger, it is exported-imported as Krüger! My whole application is on utf8, so on DB Krüger is really written as Krüger.

So there are some wrong in the export. What can I do? I think the problem is phpMyAdmin, because if I try to import the table again on HeidiSQL, the text are correct.

Upvotes: 0

Views: 1683

Answers (4)

Ólafur Waage
Ólafur Waage

Reputation: 70001

Do you see the issue when you open the exported file or import it back into a database. If you are seeing the error when importing with phpMyAdmin, you might need to import via the command line and use the flag.

--default-character-set=utf8

Ive run into these issues as well and importing via the command line and using this flag has worked.

If you have a file exported from phpMyAdmin, you can import it by doing this on the command line.

mysql -u USER -p DATABASENAME --default-character-set=utf8 < dumpfile.sql

Upvotes: 2

ajreal
ajreal

Reputation: 47321

try not use any mysql GUI clients/web interface,
mysqldump , mysqlimport is more than what you need

if you insists,
check on the encoding setting on HeidiSQL clients to make sure is set to UTF-8

Upvotes: 1

Sushant Prasad
Sushant Prasad

Reputation: 122

Use SQLyog MySQL GUI software.

Upvotes: 1

Vineet1982
Vineet1982

Reputation: 7918

This problem only happens when you export the database through phpMYAdmin and import database through mysql command line or vice versa. You either export or import through phpMyAdmin or through command line and you will not face the problem

Upvotes: 1

Related Questions