MySQL ×Ö·û¼¯µ¼ÖÂSQLÁ¬½ÓÖ®ºóÖÐÎÄÂÒÂëµÄÎÊÌ⣡
character-set-server = GB2312
collation-server = latin1_general_ci
MySQL×Ö·û¼¯ GBK¡¢GB2312¡¢UTF8Çø±ð ½â¾ö MYSQLÖÐÎÄÂÒÂëÎÊÌâ ÊÕ²Ø
MySQLÖÐÉæ¼°µÄ¼¸¸ö×Ö·û¼¯
character-set-server/default-character-set£º·þÎñÆ÷×Ö·û¼¯£¬Ä¬ÈÏÇé¿öÏÂËù²ÉÓõġ£
character-set-database£ºÊý¾Ý¿â×Ö·û¼¯¡£
character-set-table£ºÊý¾Ý¿â±í×Ö·û¼¯¡£
ÓÅÏȼ¶ÒÀ´ÎÔö¼Ó¡£ËùÒÔÒ»°ãÇé¿öÏÂÖ»ÐèÒªÉèÖÃcharacter-set-server£¬¶øÔÚ´´½¨Êý¾Ý¿âºÍ±íʱ²»ÌرðÖ¸¶¨×Ö·û¼¯£¬ÕâÑùͳһ²ÉÓÃcharacter-set-server×Ö·û¼¯¡£
character-set-client£º¿Í»§¶ËµÄ×Ö·û¼¯¡£¿Í»§¶ËĬÈÏ×Ö·û¼¯¡£µ±¿Í»§¶ËÏò·þÎñÆ÷·¢ËÍÇëÇóʱ£¬ÇëÇóÒÔ¸Ã×Ö·û¼¯½øÐбàÂë¡£
character-set-results£º½á¹û×Ö·û¼¯¡£·þÎñÆ÷Ïò¿Í»§¶Ë·µ»Ø½á¹û»òÕßÐÅϢʱ£¬½á¹ûÒÔ¸Ã×Ö·û¼¯½øÐбàÂë¡£
ÔÚ¿Í»§¶Ë£¬Èç¹ûûÓж¨Òåcharacter-set-results£¬Ôò²ÉÓÃcharacter-set-client×Ö·û¼¯×÷ΪĬÈϵÄ×Ö·û¼¯¡£ËùÒÔÖ»ÐèÒªÉèÖÃcharacter-set-client×Ö·û¼¯¡£
Òª´¦ÀíÖÐÎÄ£¬Ôò¿ÉÒÔ½«character-set-serverºÍcharacter-set-client¾ùÉèÖÃΪGB2312£¬Èç¹ûҪͬʱ´¦Àí¶à¹úÓïÑÔ£¬ÔòÉèÖÃΪUTF8¡£
¹ØÓÚMySQLµÄÖÐÎÄÎÊÌâ
½â¾öÂÒÂëµÄ·½·¨ÊÇ£¬ÔÚÖ´ÐÐSQLÓï¾ä֮ǰ£¬½«MySQLÒÔÏÂÈý¸öϵͳ²ÎÊýÉèÖÃΪÓë·þÎñÆ÷×Ö·û¼¯character-set-serverÏàͬµÄ×Ö·û¼¯¡£
character_set_client£º¿Í»§¶ËµÄ×Ö·û¼¯¡£
character_set_results£º½á¹û×Ö·û¼¯¡£
character_set_connection£ºÁ¬½Ó×Ö·û¼¯¡£
ÉèÖÃÕâÈý¸öϵͳ²ÎÊýͨ¹ýÏòMySQL·¢ËÍÓï¾ä£ºset names gb2312
¹ØÓÚGBK¡¢GB2312¡¢UTF8
UTF-8£ºUnicode Transformation Format-8bit£¬ÔÊÐíº¬BOM£¬µ«Í¨³£²»º¬BOM¡£ÊÇÓÃÒÔ½â¾ö¹ú¼ÊÉÏ×Ö·ûµÄÒ»ÖÖ¶à×Ö½Ú±àÂ룬Ëü¶ÔÓ¢ÎÄʹÓÃ8루¼´Ò»¸ö×Ö½Ú£©£¬ÖÐÎÄʹÓÃ24Ϊ£¨Èý¸ö×Ö½Ú£©À´±àÂë¡£UTF-8°üº¬È«ÊÀ½çËùÓйú¼ÒÐèÒªÓõ½µÄ×Ö·û£¬Êǹú¼Ê±àÂ룬ͨÓÃÐÔÇ¿¡£UTF-8±àÂëµÄÎÄ×Ö¿ÉÒÔÔÚ¸÷¹úÖ§³ÖUTF8×Ö·û¼¯µÄä¯ÀÀÆ÷ÉÏÏÔʾ¡£È磬Èç¹ûÊÇUTF8±àÂ룬ÔòÔÚÍâ¹úÈ˵ÄÓ¢ÎÄIEÉÏÒ²ÄÜÏÔʾÖÐÎÄ£¬ËûÃÇÎÞÐèÏÂÔØIEµÄÖÐÎÄÓïÑÔÖ§³Ö°ü¡£
GBKÊǹú¼Ò±ê×¼GB2312»ù´¡ÉÏÀ©Èݺó¼æÈÝGB2312µÄ±ê×¼¡£GBKµÄÎÄ×Ö±àÂëÊÇÓÃË«×Ö½ÚÀ´±íʾµÄ£¬¼´²»ÂÛÖС¢Ó¢ÎÄ×Ö·û¾ùʹÓÃË«×Ö½ÚÀ´±íʾ£¬ÎªÁËÇø·ÖÖÐÎÄ£¬½«Æä×î¸ßλ¶¼É趨³É1¡£GBK°üº¬È«²¿ÖÐÎÄ×Ö·û£¬Êǹú¼Ò±àÂ룬ͨÓÃÐÔ±ÈUTF8²î£¬²»¹ýUTF8Õ¼ÓõÄÊý¾Ý¿â±ÈGBD´ó¡£
GBK¡¢GB2312µÈÓëUTF8Ö®¼ä¶¼±ØÐëͨ¹ýUnicode±àÂë²ÅÄÜÏ໥ת»»£º
GBK¡¢GB2312££Unicode££UTF8
UTF8££Unicode££GBK¡¢GB2312
¶ÔÓÚÒ»¸öÍøÕ¾
Ïà¹ØÎĵµ£º
CREATE TABLE `taa` (
`year` varchar(4) DEFAULT NULL,
`month` varchar(2) DEFAULT NULL,
`amount` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf
"year","m ......
¿ÉÒÔ½«Õâ¸ö½Å±¾·Å½øcrontab£¬ËûµÄÅäÖÆÎļþÔÚ /etc/crontabÖÐÿÌìÁ賿ִÐÐÒ»´Î£¬×Ô¶¯±¸·Ý Õâ¸ö½Å±¾Ã¿Ìì×î¶àÖ»Ö´ÐÐÒ»´Î£¬¶øÇÒÖ»±£Áô×î½üÎåÌìµÄ±¸·ÝÔÚ·þÎñÆ÷ÉÏ¡£
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by aspbiz
#2004-09
#Setting
#ÉèÖÃÊý¾Ý¿âÃû£¬Êý¾Ý¿âµÇ¼Ãû£¬ÃÜÂ룬±¸·Ý·¾¶£¬ÈÕ־ ......
Ò»¡¢½¨±í
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 ......
9.3 MySQL´æ´¢¹ý³Ì
MySQL 5.0ÒÔºóµÄ°æ±¾¿ªÊ¼Ö§³Ö´æ´¢¹ý³Ì£¬´æ´¢¹ý³Ì¾ßÓÐÒ»ÖÂÐÔ¡¢¸ßЧÐÔ¡¢°²È«ÐÔºÍÌåϵ½á¹¹µÈÌص㣬±¾½Ú½«Í¨¹ý¾ßÌåµÄʵÀý½²½âPHPÊÇÈçºÎ²Ù×ÝMySQL´æ´¢¹ý³ÌµÄ¡£
ʵÀý261£º´æ´¢¹ý³ÌµÄ´´½¨
ÕâÊÇÒ»¸ö´´½¨´æ´¢¹ý³ÌµÄʵÀý
¼ÏñλÖ㺹âÅÌ\mingrisoft\09\261
ʵÀý˵Ã÷
ΪÁ˱£Ö¤Êý¾ÝµÄÍêÕûÐÔ¡¢Ò»ÖÂÐÔ£¬Ìá ......
¼¸¸öÔÂÇ°£¬ÊÜһλÀÏʦµÄίÍУ¬Òª°ïËû×öÒ»¸ö¹ØϵÊý¾Ý¿âģʽÐÅÏ¢ÌáÈ¡µÄСÏîÄ¿£¬Ö÷ÒªµÄ¹¦ÄÜʵÏÖ¾ÍÊǽ«¹ØϵÊý¾Ý¿âµÄ±í½á¹¹ºÍ×ֶεÄÐÅϢͨ¹ý±í¸ñµÄÐÎʽչʾ³öÀ´¡£ÎÒͨ¹ý´ÓÍøÉÏËѼ¯×ÊÁÏÒÔ¼°·Êé²éÕÒ£¬ÏÈʵÏÖÁËÒ»¸ömysqlµÄÊý¾ÝÌáÈ¡Æ÷¡£Ïȸø´ó¼Ò·ÖÏíһϡ£ÉÔºóµÄ¼¸ÌìÄÚ»á°ÑÁíÒ»¸ömysql¹ ......