Today, in time to import a sql file to the database because the Chinese coding error, here is a solution to this problem:
- Encoding database connection settings
mysql -u root -p --default-character-set=utf8
- Switch to the need to import database
use dbname
- Use the source command to import
source db.sql
When the path db.sql .sql file