Below you will find pages that utilize the taxonomy term “编码”
December 28, 2009
修改mysql数据库编码
"\u003cp\u003e修改my.ini文件\u003c/p\u003e\n\u003cp\u003e加上\u003c/p\u003e\n\u003cp\u003edefault-character-set=gb2312\u003c/p\u003e\n\u003cp\u003e设定数据库字符集\u003c/p\u003e\n\u003cp\u003ealter database da_name default character set ‘charset’\u003c/p\u003e\n\u003cp\u003e1)设置数据库编码 /etc/my.cnf\n[mysqld]\ndefault-character-set=gbk\n…\n[client]\ndefault-character-set=gbk\n---------------------------------------\n2)按字符集导出\n$mysqldump -u root -p dbname –default-character-set=gbk \u0026gt; a.sql;\n3)查看SQL文件的编码\n[root@localhost gethtml]# file a.sql\na.sql: UTF-8 Unicode …\n[root@localhost gethtml]# iconv -f utf-8 -t gbk a.sql \u0026gt; a2.sql\n[root@localhost gethtml]# file a2.sql …\u003c/p\u003e"