When importing sql file mysql Chinese coding error Solution

Today, in time to import a sql file to the database because the Chinese coding error, here is a solution to this problem:

  1. Encoding database connection settings
mysql -u root -p --default-character-set=utf8
  1. Switch to the need to import database
use dbname
  1. Use the source command to import
 source db.sql  

When the path db.sql .sql file

Guess you like

Origin www.cnblogs.com/wualin/p/10978919.html
Recommended