Method 1: Solve the Problem of mysql garbled by adding the parameter-default-character-setutf8 mysql-uroot-ppasswordpath_to_import_file-default-character-setutf8 Method 2: mysql in the command line to import garbled 1. usedatabase_name; 2. setnamesutf8; (or other required encoding)
Method 1: add the parameter-default-character-set = utf8 to solve the mysql garbled problem mysql-u root-p password path_to_import_file-default-character-set = utf8 Method 2: mysql can solve the problem by importing garbled characters in the command line. use database_name; 2. set names utf8; (or other required Encoding
Method 1:Mysql garbled by adding the parameter-default-character-set = utf8
Mysql-u root-p password <path_to_import_file-default-character-set = utf8
Method 2:Mysql command line import garbled
1. use database_name;
2. set names utf8; (or other required encoding)
3. source example. SQL (SQL file storage path)
Method 3:Directly paste the code in the SQL File
1. Open the SQLyog client software;
2. Locate the SQL editor and use NotePad to open the exported SQL file;
3. Copy all SQL statements in the file to the SQL editor and execute the SQL code;
Method 4:Use notepad or other text tools to change the encoding format of the SQL file (if method 3 fails, try Method 4)
1. Use notepad (or UE) to open the exported SQL file;
2. Save this file. Open the "Save as" dialog box and select the UNICODE encoding format in the dialog box;
3. Save the file, press CTRL + A, and select all;
4. Copy the SQL statement to the "SQL encoder" in SQLyog and execute the SQL statement again;
5. Refresh the data table once after the execution is complete. Check the data table in Chinese and eliminate mysql garbled characters;