|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
Hopefully you have a good dump before changes are applied.
You can try to convert the dump with iconv. Dump the tables without data $> mysqldump -d --database SourceDB -u YourMySQLAdmin -p > SourceDB_tables.dump Dump the data only $> mysqldump -n -t --database SourceDB -u YourMySQLAdmin -p > SourceDB_data.dump Replace the encoding in the SourceDB_tables.dump file with new encoding and create a new database to test the next steps with this file. To see all encodings that can be used with iconv $> iconv -l Now convert the data to the new encoding. $> cat SourceDB_data.dump | iconv -f US-ASCII -t UTF-8 > SourceDB_data.utf8 Now import the converted data to the new database, if all went OK you are fine. I cannot describe the exact steps for the ex/import since i don't use MySQL but i hope the way is clear now. |
|
||||
Thanks for the reply ohauer. Sorry if it took some time for me to answer.
I followed your steps and understood the explanations. Thanks, it was very clear. However, I get the following error message when running "cat db.sql | iconv -f US-ASCII -t UTF-8 > db-utf8.sql": Quote:
Thank you very much.
__________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." |
|
|||
The error is about a sign that is not in US-ASCII table and iconv cannot translate it.
error is at line: 40, row 531 Take a look at this sign with your favor editor, maybe it is ISO-... or someting else. Since you will transfer from a database witch has french chars, try the following if it works. Code:
iconf -f ISO-8859-1 -t UTF-8 < source_dump.sql > target_dump.utf8 |
|
||||
Thanks for the solution ohauer, however, it looks like some part of the database is encoded two to three times or with another encoding. I had to rewrite the accents one by one in the DB.
__________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." |
|
||||
This is an application level encoding problem. In no way related to the underlaying OS.
Tables can be encoded in any code-page you may wish, either locally, or per users, or per table, or system wide. Answers on http:://mysql.org
__________________
da more I know I know I know nuttin' |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Read Excel Data and store into Mysql Database using PHP | cksraj | Programming | 2 | 3rd June 2009 12:09 PM |
Encoding issue with GNU Screen | TerryP | General software and network | 3 | 28th December 2008 07:04 AM |
Roundcube Mail Can't Connect to MYSQL Database | jrs665 | OpenBSD Packages and Ports | 1 | 17th November 2008 03:54 PM |
PHP database interfaces | TerryP | Programming | 6 | 11th September 2008 01:03 PM |
Slocate database coverage | ivanatora | FreeBSD General | 2 | 4th August 2008 08:51 AM |