怎樣設(shè)置mysql創(chuàng)建表格時默認(rèn)的字符集?
通過mysql命令修改:修改數(shù)據(jù)庫的字符集mysql>usemydbmysql>alterdatabasemydbcharactersetutf-8;創(chuàng)建數(shù)據(jù)庫指定數(shù)據(jù)庫的字符集mysql>createdatabasemydbcharactersetutf-8;通過配置文件修改:修改/var/lib/mysql/mydb/db.optdefault-character-set=latin1default-collation=latin1_swedish_ci為default-character-set=utf8default-collation=utf8_general_ci重起MySQL: