MySQL uses the source command garbled problem solution

    Execute a piece of code through the source command. If there are Chinese characters in it, there will be garbled characters. You must add the --default-character-set parameter when logging in to mysql.

As follows:

mysql -u root -p --default-character-set=utf8

This way there will be no garbled characters.

 

mysql -u root -p --default-character-set=utf8
use dbname
source /root/newsdata.sql

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326682247&siteId=291194637