mysqlÖÐchar¡¢varchar¡¢nvarcharÊý¾ÝÀàÐ͵ÄÓ÷¨Çø±ð
mysqlÖÐchar¡¢varchar¡¢nvarcharÊý¾ÝÀàÐ͵ÄÓ÷¨Çø±ð:
˵Ã÷:
1¡¢char:
¹Ì¶¨³¤¶ÈµÄ·Ç Unicode ×Ö·ûÊý¾Ý£¬×î´ó³¤¶ÈΪ 8,000 ¸ö×Ö·û¡£
2¡¢varchar£º
¿É±ä³¤¶ÈµÄ·Ç Unicode Êý¾Ý£¬×Ϊ 8,000 ¸ö×Ö·û¡£
3¡¢nvarchar£º
¿É±ä³¤¶È Unicode Êý¾Ý£¬Æä×î´ó³¤¶ÈΪ 4,000 ×Ö·û¡£
4¡¢nchar
¹Ì¶¨³¤¶ÈµÄ Unicode Êý¾Ý£¬×î´ó³¤¶ÈΪ 4,000 ¸ö×Ö·û¡£
5¡¢charºÍvarchar¶¼ÊÇ×Ö·û´®ÀàÐ͵Ä
ÓÃUnicode±àÂëµÄ×Ö·û´®,½á¹ûÊÇ×Ö·ûµÄÕûÊýÖµ
Ó÷¨Çø±ð:
ÎÄ×Ö×Ö¶ÎÈô³¤¶È¹Ì¶¨£¬È磺Éí·ÖÖ¤ºÅÂ룬¾Í²»ÒªÓà varchar »ò nvarchar£¬Ó¦¸ÃÓà char »ò nchar¡£
Ö§³Ö¶àÓïÑÔµÄÕ¾µãÓ¦¿¼ÂÇʹÓà Unicode nchar »ò nvarchar Êý¾ÝÀàÐÍÒÔ¾¡Á¿¼õÉÙ×Ö·ûת»»ÎÊÌâ
ÎÄ×Ö×Ö¶ÎÈô³¤¶È²»¹Ì¶¨£¬È磺µØÖ·£¬Ôò¸ÃÓà varchar »ò nvarchar¡£³ýÁ˿ɽÚÊ¡´æ´¢¿Õ¼äÍ⣬´æÈ¡Ó²ÅÌʱҲ»á½ÏÓÐЧÂÊ¡£
Ïà¹ØÎĵµ£º
mysqlÊý¾Ý¿âµ¼³öÒªÓõ½MySQLµÄmysqldump¹¤¾ß£¬»ù±¾Ó÷¨ÊÇ£º
shell> mysqldump [OPTIONS] database [tables]
Èç¹ûÄã²»¸ø¶¨ÈÎºÎ±í£¬Õû¸öÊý¾Ý¿â½«±»µ¼³ö¡£
ͨ¹ýÖ´ÐÐmysqldump --help£¬ÄãÄܵõ½ÄãmysqldumpµÄ°æ±¾Ö§³ÖµÄÑ¡Ïî±í¡£
×¢Ò⣬Èç¹ûÄãÔËÐÐmysqldumpûÓÐ--quick»ò--optÑ¡Ïmysq ......
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 ......
ÓÃInstallAnywhere´ò°üJava³ÌÐò°üº¬MySQLÊý¾Ý¿â
InstallAnywhere´ò°üJava³ÌÐòʱ¿ÉÒÔ×Ô¶¯Íê³ÉjreµÄ´ò°ü£¬µ«ÊÇÐèÒªMySQLÊý¾Ý¿âµÄ³ÌÐò¾ÍµÃÊÖ¶¯Ìí¼Ó¡£×ÊÁÏÌ«ÉÙ£¬¾À½áÁËÈýÌ죬ÖÕÓÚ½â¾ö
1¡¢ ÏÂÔØÂÌÉ«°æµÄMySQL£¬¿ÉÒÔÈ¥¹ÙÍøÏÂÔØ¡£ÍøÓÑÖÆ×÷ÁËMySQLµÄÂÌÉ«¾«¼òBat°æ£¨http://download.csdn.net/source/524812 ......
InnoDB¸ÅÊö
InnoDB¸øMySQLÌṩÁ˾ßÓÐÌá½»£¬»Ø¹öºÍ±ÀÀ£»Ö¸´ÄÜÁ¦µÄÊÂÎñ°²È«£¨ACID¼æÈÝ£©´æ´¢ÒýÇæ¡£InnoDBËø¶¨ÔÚÐм¶²¢ÇÒÒ²ÔÚSELECTÓï¾äÌṩһ¸öOracle·ç¸ñÒ»ÖµķÇËø¶¨¶Á¡£ÕâЩÌØÉ«Ôö¼ÓÁ˶àÓû§²¿ÊðºÍÐÔÄÜ¡£Ã»ÓÐÔÚInnoDBÖÐÀ©´óËø¶¨µÄÐèÒª£¬ÒòΪÔÚInnoDBÖÐÐм¶Ëø¶¨ÊʺϷdz£Ð¡µÄ¿Õ¼ä¡£InnoDBÒ²Ö§³ÖFOREIGN KEYÇ¿ÖÆ¡£ÔÚSQL²éÑ¯Ö ......
bigint ´Ó -2^63 (-9223372036854775808) µ½ 2^63-1 (9223372036854775807) µÄÕûÐÍÊý¾Ý£¨ËùÓÐÊý×Ö£©¡£´æ´¢´óСΪ 8 ¸ö×Ö½Ú¡£
int ´Ó -2^31 (-2,147,483,648) µ½ 2^31 - 1 (2,147,483,647) µÄÕûÐÍÊý¾Ý£¨ËùÓÐÊý×Ö£©¡£´æ´¢´óСΪ 4 ¸ö×Ö½Ú¡£int µÄ SQL-92 ͬÒå×ÖΪ integer¡£
smallint ´Ó -2^15 (-32,768) µ½ 2^15 - 1 (32,7 ......