今天發現把某數據庫導入到mysql後,web上出現了亂碼,然後進入mysql裏面查詢的時候也是亂碼。於是搜了一下mysql的亂碼相關的資料。
試用了一下,http://linux.chinaunix.net/techdoc/database/2008/03/23/986386.shtml 這個文章中的方法,問題沒有解決。
後來使用了以下方法,問題得到解決:
drop database db_xxx;
create database db_xxx;
use db_xxx;
set names utf8;
source /path/to/file;