今天幫忙朋友找bug的時候,准備導入她數據庫裡面的數據,所以我就試圖在mysql管理工具Navicat下面導入相應的mysql命令。結果發現導入的中文字符全部變成亂碼,所以做了如下這種嘗試:
在“連接屬性”的設置中,高級-“使用mysql字符集”去掉鉤,並且將編碼改為10008-GB2312.+--------------------------+---------------------------------------+ | Variable_name | Value | +--------------------------+---------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | D:\mysql-5.1.32-win32\share\charsets\ |
+--------------------------+---------------------------------------+ | Variable_name | Value | +--------------------------+---------------------------------------+ | character_set_client | gbk | | character_set_connection | gbk | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | gbk | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | D:\mysql-5.1.32-win32\share\charsets\ |