作者:spermwhale0来源:https://www.jianshu.com/p/94d6b75bdff9MySQL编码过程MySQL出现乱码的原因有很多,一般与character_set参数有关。我们先来看看有哪些参数:SHOW VARIABLES LIKE "character%";Variable_name Valuecharacter_set_client utf8character_set_connection utf8character_set_database utf8character_set_filesystem binarycharacter_set_results utf8character_set_server utf8character_set_system utf8character_sets_dir /usr/local/Cellar/mysql@5.7/5.7.24/share/mysql/charsets/其中,最主要的是character_set_client和character_set_results。这两个参数分别有什么用呢?在客户端将一条命令输入MySQL时,MySQL只知道这条命令是0101的字节流,并不知道具体采用的是什么编码。第一个参数character_set_client就告诉了MySQL,这条命令是UTF-8编码
………………………………