mysqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö£¨×ܽáƪ£©
mysqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö£¨×ܽáƪ£©
µÚÒ»½â¾ö·½·¨£º
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
ÏÔʾʱ£º±àÂëÓëÊý¾Ý¿â¶ÁÈ¡ºóµÄÊý¾Ý²»Ò»ÖÂ
ºÜÏÔȻֻÓÐÈýÕ߶¼Í³Ò»²ÅÐУº£¨ÒÔutf-8ΪÀý£©
1£ºÒ³ÃæÌá½»Êý¾Ý±àÂëutf-8£¨ÕâÒ²¿ÉÒÔËãÊÇÏÔʾҳÃæ±àÂ룩£¬
2£ºÊý¾Ý¿âдÈëʱ±àÂ룺alter database db default character set ‘utf8’collate ‘utf8-general-ci’£¬
3£ºÊý¾Ý¿â¶ÁȡʱËùÓñàÂ룺mysql_query£¨“set names ‘utf8’”£©£»
4£ºÏÔʾҳÃæ±àÂ룺<meta http-equiv="Content-type"content=“text/html, charset=utf-8”>
µÚ¶þ½â¾ö·½·¨£º
½øÈëMYSQLÃüÁîÐÐ:
mysql> alter database you_dbname default character set 'utf8';
mysql> SET character_set_client='utf8';
mysql> SET character_set_connection='utf8'
mysql> SET character_set_results='utf8'
µÚÈý½â¾ö·½·¨£º
£¨ÔÝʱֻÕë¶ÔMySQL 5.0.16 ÂÒÂëÎÊÌâ´¦Àí°ì·¨£¬ÆäËû°æ±¾Î´²âÊÔ¡££©
1 ÉèÖÃphpMyAdmin
¡¡¡¡Language£ºChinese simplified (zh-utf-8)
¡¡¡¡MySQL ×Ö·û¼¯£ºUTF-8 Unicode (utf8)
¡¡¡¡MySQL Á¬½ÓУ¶Ô£ºgbk_chinese_ci
2 ´´½¨Êý¾Ý¿âʱ
¡¡¡¡ÕûÀíÉèÖÃ³É gbk_chinese_ci
3 ÓÃSQL½¨Á¢±íÖÐ
¡¡¡¡ENGINE=MyISAM DEFAULT CHARSET=gbk;
¡¡¡¡ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=40 ;
4 ¼ì²é±í½á¹¹ÖÐ
¡¡¡¡varchar(100) µÄÕûÀíÊôÐÔΪgbk_chinese_ci
¡¡¡¡ÆäËüÀàÐ͵ÄÕûÀíÊôÐÔΪ¿Õ
5 ´úÂëÖмÓÉÏ
¡¡¡¡$db->query("SET CHARACTER SET GBK"); ¡¡LinuxÏÂÐèÒª£¬Windowsϲ»ÐèÒª
¡¡¡¡Õâ¸öÏ൱ÓÚConnection Character Sets and Collations
ÒÔÉÏÊǸöÈË´ÓÍøÉÏËÑË÷µÄһЩ×ܽáºÍ¹éÄÉ£¬ÏàÐÅÕâ¸öÓ¦¸ÃÄܽâ¾öËùÓÐÂÒÂëµÄÎÊÌâÁË¡£
±¾ÎIJ¿·ÖÄÚÈÝתÔØ×Ôphp100.com£¬ÈçÓÐÎÊÌ⣬ÇëÓë±¾ÈËÁªÏµ¡£
Ïà¹ØÎĵµ£º
Ò»¡¢½¨±í
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`ID` int(11) NOT NULL auto_increment,
`NAME` varchar(16) NOT NULL default '',
`REMARK` varchar(16) NOT NULL default '',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
&nb ......
MysqlµÄÓα꾿¾¹ÔõôÓÖӳÈպɻ¨±ðÑùºì
Mysql´Ó5.0¿ªÊ¼Ö§³Ö´æ´¢¹ý³ÌºÍtrigger£¬¸øÎÒÃÇϲ»¶ÓÃmysqlµÄÅóÓÑÃǸüϲ»¶mysqlµÄÀíÓÉÁË£¬Óï·¨
ÉϺÍPL/SQLÓвî±ð£¬²»¹ý¸ã¹ý±à³ÌµÄÈ˶¼ÖªµÀ£¬Óï·¨²»ÊÇÎÊÌ⣬¹Ø¼üÊÇ˼Ï룬´óÖÂÁ˽âÓï·¨ºó£¬¾Í´Ó
±äÁ¿¶¨Ò壬ѻ·£¬Åжϣ¬Óα꣬Òì³£´¦ÀíÕâ¸ö¼¸¸ö·½ÃæÏêϸѧϰÁË¡£¹ØÓÚÓαêµÄÓ÷¨M ......
¼¸¸öÔÂÇ°£¬ÊÜһλÀÏʦµÄίÍУ¬Òª°ïËû×öÒ»¸ö¹ØϵÊý¾Ý¿âģʽÐÅÏ¢ÌáÈ¡µÄСÏîÄ¿£¬Ö÷ÒªµÄ¹¦ÄÜʵÏÖ¾ÍÊǽ«¹ØϵÊý¾Ý¿âµÄ±í½á¹¹ºÍ×ֶεÄÐÅϢͨ¹ý±í¸ñµÄÐÎʽչʾ³öÀ´¡£ÎÒͨ¹ý´ÓÍøÉÏËѼ¯×ÊÁÏÒÔ¼°·Êé²éÕÒ£¬ÏÈʵÏÖÁËÒ»¸ömysqlµÄÊý¾ÝÌáÈ¡Æ÷¡£Ïȸø´ó¼Ò·ÖÏíһϡ£ÉÔºóµÄ¼¸ÌìÄÚ»á°ÑÁíÒ»¸ömysql¹ ......
ÔÚApache, PHP, MySQLµÄÌåϵ¼Ü¹¹ÖУ¬MySQL¶ÔÓÚÐÔÄܵÄÓ°Ïì×î´ó£¬Ò²ÊǹؼüµÄºËÐIJ¿·Ö¡£¶ÔÓÚDiscuz!ÂÛ̳³ÌÐòÒ²ÊÇÈç´Ë£¬MySQLµÄÉèÖÃÊÇ·ñºÏÀíÓÅ»¯£¬Ö±½ÓÓ°Ïìµ½ÂÛ̳µÄËٶȺͳÐÔØÁ¿£¡Í¬Ê±£¬MySQLÒ²ÊÇÓÅ»¯ÄѶÈ×î´óµÄÒ»¸ö²¿·Ö£¬²»µ«ÐèÒªÀí½âһЩMySQLרҵ֪ʶ£¬Í¬Ê±»¹ÐèÒª³¤Ê±¼äµÄ¹Û²ìͳ¼Æ²¢ÇÒ¸ù¾Ý¾Ñé½øÐÐÅжϣ¬È»ºóÉèÖúÏÀíµÄ²ÎÊý¡ ......