First in the new database must pay attention to generate the original database the same encoding form, if it has been generated can be used phpMyAdmin and other tools to organize again, to prevent the database encoding and table encoding is not uniform caused garbled.
method One: Solve garbled problem by adding parameter –default-character-set = UTF8
Mysql-u root-p Password < Path_to_import_file–default-character-set = UTF8
method Two: Import garbled address in command line
1. Use database_name;
2. Set names UTF8; (or other required encoding)
3. Source example.sql (SQL file storage path)
Method Three: Directly paste the code in the SQL file
1. Open the SQLyog client software;
2. Navigate to the SQL Editor and open the SQL file you just exported with Notepad;
3. Copy all the SQL statements in the file into the SQL editor and execute the SQL code;
method Four: Use Notepad or other text tools to change the encoding format of the SQL file (if the method is not three, then try Method four)
1. Use Notepad (or UE) to open the SQL file you just exported;
2. Save this file--Open the Save As dialog box, select the encoding format in the dialog box for Unicode encoding;
3. Save the file, then CTRL + A, select all;
4. Copy the SQL statement in the SQLYOG to the SQL encoder, and execute the SQL statement again;
5. After the completion of the implementation remember to refresh once, see the Chinese data table, garbled elimination, finished;
MySQL solution when importing data via SQL file