ÈÃMySQLÖ§³ÖInnoDB
ÔÚmysqlÖÐÊäÈëSHOW variables like "have_%"²é¿´£¬ÏÔʾÈçÏ£º
mysql> SHOW variables like "have_%";
+-----------------------+----------+
| Variable_name | Value |
+-----------------------+----------+
| have_archive | YES |
| have_bdb | NO |
| have_blackhole_engine | NO |
| have_compress | YES |
| have_crypt | NO |
| have_csv | NO |
| have_dynamic_loading | YES |
| have_example_engine | NO |
| have_federated_engine | NO |
| have_geometry | YES |
| have_innodb | DISABLED |
| have_isam | NO |
| have_merge_engine | YES |
| have_ndbcluster | NO |
| have_openssl | DISABLED |
| have_query_cache | YES |
| have_raid | NO |
| have_rtree_keys | YES |
| have_symlink | YES |
+-----------------------+----------+
19 rows in set (0.00 sec)
À¶É«±íʾÎÒµÄMYSQL²¢²»Ö§³Öinnodb¡£
MySQLÖÐInnoDBºÍMyISAMÀàÐ͵IJî±ð£º
InnoDBºÍMyISAMÊÇÔÚʹÓÃMyS
Ïà¹ØÎĵµ£º
1¡¢½«Êý¾Ý¿âÉèÖÃΪdefault-character-set=gb2312
2¡¢½«¿ØÖÆÃæ°å/¹ÜÀí¹¤¾ß/ÅäÖúõÄÊý¾ÝÔ´/ÅäÖÃ/Ïêϸ/MiscOPtions/Character:gb2312
3¡¢´úÂëΪ GB2312;
±£Ö¤ÕâÈý¸öµØ·½Í³Ò»£¬ÂÒ×Ö·û½â¾ö¡£
ÎÒ×ö³ö²»°Ù˼²»µÃÆä½â£¬¾ÍÊǺöÂÔÁ˵Ú2µã¡£ ......
Ò»¡¢²é¿´Óû§
1¡¢ÏÔʾµ±Ç°Ê¹ÓõÄuser¼°host£º
mysql>select USER();
2¡¢ÏÔʾ¸ÃÊý¾Ý¿âÊÚȨµÇ½µÄÓû§Ãû(²»ÏÔʾÖظ´Óû§Ãû)£º
mysql>use mysql;
mysql>select distinct(User) from user;
3¡¢ÏÔʾ¸ÃÊý¾Ý¿âÊÚȨµÇ½µÄÓû§Ãû¼°hostÏÞÖÆ£º
£¨1£©·½·¨Ò»£º
mysql>use mysql;
mysql>select User,host from u ......
´æ´¢¹ý³ÌÊÇÒ»ÖÖ´æ´¢ÔÚÊý¾Ý¿âÖеijÌÐò£¨¾ÍÏñÕý¹æÓïÑÔÀïµÄ×Ó³ÌÐòÒ»Ñù£©£¬×¼È·µÄÀ´Ëµ£¬MySQLÖ§³ÖµÄ“routines£¨Àý³Ì£©”ÓÐÁ½ÖÖ£ºÒ»ÊÇÎÒÃÇ˵µÄ´æ´¢¹ý³Ì£¬ ¶þÊÇÔÚÆäËûSQLÓï¾äÖпÉÒÔ·µ»ØÖµµÄº¯Êý£¨Ê¹ÓÃÆðÀ´ºÍMysqlԤװÔصĺ¯ÊýÒ ......
MysqlµÄ×Ö·û¼¯ÊDZȽÏÂé·³µÄ,ĬÈϵĶÔÎÒÃÇÀ´Ëµ¸ù±¾¾ÍûʲôÓÃ,ÎÒÃÇÊÇÒªÓõ½ÖÐÎĵÄ,ËùÒÔÒ»¶¨µÃ¸Ä×Ö·û¼¯,Èç¹û×Ö·û¼¯²»¶Ô»áÓкܶàµÄÎÊÌâ,ÓÐÂÒÂ뻹ÓоÍÊÇÎÒÃÇÔÚ³ÌÐòÀï²åÈëÖÐÎÄʱ»á¸øÄã˵mysql Data truncation: Data too long for column,ÄãǧÍò±ðÒÔΪÊÇÄãµÄ×Ö¶ÎÉèµÃ²»¹»³¤,ÄãÉèµÃÔÙ³¤Ëû¶¼»á±¨´í,ËùÒÔ¸Ä×Ö·û¼¯°É
ÎÒÃÇÒ»°ã×°ºÃÊý ......
Timestamp·Òë¹ýÀ´Ò²½Ð“ʱ¼ä´Á”£¬¿ÉÒÔ°üº¬“Äê-ÔÂ-ÈÕ-ʱ-·Ö-Ãë-ºÁÃ딣¬ÊÇjava.util.DateϵÄÒ»¸ö×ÓÀà¡£Èç¹ûÏëʵÏÖÏòMysqlÖвåÈë´øÓÐʱ·ÖÃëµÄʱ¼ä£¬ÔÚ±í½á¹¹ÀïÐèÒªÖ¸¶¨×Ö¶ÎÀàÐÍΪDateTime£¬Java³ÌÐòÀïÔÚ»ñȡϵͳʱ¼äºóÐèҪת»»ÎªÊ±·ÖÃëµÄ¸ñʽ£¬ÔÙת»»ÎªTimestamp¼´¿É£¬ÈçÏÂËùʾ£º
Date dt = new Dat ......