Solution for mysql to use the source command to import garbled characters in centos
When I pass an SQL file to a remote server and want to import it to the database today, I found garbled characters, mainly due to incorrect encoding. I would like to record them to help future generations:
PS: it is best to first use yuminstallzipunzip to install the known pressure software on the remote server and then compress the SQL file to be uploaded into a zip file to the remote server for decompression, my SQL file is 20 GB, which is about 2 GB after compression.
Under centos:
# MySQL-u root-pmypass -- default-character-set = utf8/* root and mypass are user names and passwords */
Mysql> use dbname/* dbname indicates the name of the database to be imported */
> Source/root/data. SQL/* data. SQL indicates the SQL file you want to run */
// Red indicates the part to be entered.