![]() Here we convert the file dump.sql from UTF-8 to latin1 (ISO-8859-1) and write the data into a new file named iso_dump.sql: If you no longer have access to the old database for making this kind of dump, you may try to directly convert the old dump's character set with the iconv command line program. $ mysqldump refbase -u root -p -opt -default-character-set=latin1 > refbase.sql Example: assuming your refbase latin1-based database is named refbase and with root being the authorized user, your mysqldump statement would read: And if you use an older MySQL version you may also need to use the -compatible flag. So, if you're using a different character set (such as latin1), you must specify the -default-character-set=WHAT_YOU_FIND_UNDER_character_set_server_ABOVE flag. The regular mysqldump statement (without any flags) may not work correctly, because mysqldump will, by default, output data using the UTF-8 character set. As an example, using MySQL 4.1.11 on Mac OS X 10.4, the following settings are recognized in the MySQL config file for latin1 (ISO-8859-1):Ĭ) Next you need to "properly" dump the data from your original database, which can be achieved by use of the mysqldump command line program. Note that for some MySQL systems/versions, some variable names seem to use underscores instead of hyphens. #init-connect = 'SET CHARACTER SET latin1' Here's an example for a latin1-based database: This can be done by adding two lines to the "" section of the MySQL config file ( my.cnf) and restarting your MySQL server. Mysqladmin variables | grep "character\|collation"ī) If you see discrepancies between the two database installations with respect to these variables, it is better that they coincide. Mysql> SHOW VARIABLES LIKE '%collation%' Īnother possibility is to issue following command from the command line shell: Mysql> SHOW VARIABLES LIKE '%character%' login and click on "Show MySQL system variables"Ĭollation connection utf8_general_ci latin1_general_ciĬollation database latin1_general_ci latin1_general_ciĬollation server latin1_general_ci latin1_general_ciĮnter the MySQL command line interpreter, select your refbase MySQL database, and execute following commands:.Use either phpMyAdmin or the MySQL command line interpreter. Otherwise you will end up with garbled and strange characters when viewing what was once nice accented characters or "umlauts" (like norwegian å, æ, ø, or the german ä, ö, ü or swedish ø).Ī) To solve the problem, you need to first check that the character sets used on the two database installations are the same. You need to be very careful about the character sets and MySQL versions you're using. To migrate your refbase installation from one computer to another, MySQL migration and character set problems
0 Comments
Leave a Reply. |