mysql USES the source command garble problem resolution method

  • 2020-05-17 06:41:25
  • OfStack

Today, I exported an sql executable from windows and then poured it into unbutn. The result was chaos. I was playing around for 7-8 minutes.
The solution
When exporting the mysql sql execution file, specify the following encoding format:
 
mysqldump -uroot -p --default-character-set=utf8 mo ( dbname )  > E://xxxx.sql 

OK was imported
Perform the following
 
mysql -u root -p --default-character-set=utf8 
use dbname 
source /root/newsdata.sql 

Related articles: