一般如果把程序、配置文件和数据库字符格式都设置成utf8字符的话是不会出现乱码的。
可以通过命令
SHOW VARIABLES LIKE '%character_set_%'
察看Mysql的编码设置
character_set_client, utf8
character_set_connection, utf8
character_set_database, utf8
character_set_filesystem, binary
character_set_results, utf8
character_set_server, utf8
character_set_system, utf8
character_sets_dir, E:softProgrammysqlmysql-5.0.22-win32sharecharsets