ÈÃ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
Ïà¹ØÎĵµ£º
Á¬Ðø¼¸Ìì°²×°ÅäÖúÍÁ¬½ÓMysqlÊý¾Ý¿â£¬½ñÌìÖÕÓڳɹ¦ÁË£¬»ØÏëÕ⼸Ìì£¬ÕæµÄÊÇÌðËá¿àÀ±¶¼ÓУ¬µ¥mysql¾Í֨װÁ˲»ÏÂ10´Î£¬¶øÔÚeclipseÉϱàдµÄÁ¬½ÓÊý¾Ý¿âµÄ³ÌÐò×ÜÊDZ¨´í£®ÎÒ¶¼ÒѾdownÁËoracal×¼±¸·ÅÆúmysqlÁË£¬²»¹ý£®£®£®¾ÍÏóµçÊÓ¾çÑݵÄÄÇÑù£¬×ª»ú×ÜÊÇÔÚÕâ¸öʱºò³öÏÖ£¬ÏÈÊÇ¿´µ½ÁËsaulzy¹ØÓÚmysql4.1.11°æ±¾µÄ°²×°½éÉÜ£¬½Ó×ÅÓÖÕ ......
ÔÚ¿´ÏîÄ¿µÄÊÇ¿´µ½mysql°æ±¾µÄÏîÄ¿£¬·¢ÏÖÖ´ÐжàÌõsqlÓï¾äÊǶ¼ÊÇÏÈ·ÖÀëÒ»ÌõÌõµÄÊý¾Ý¿âÔÙÒ»ÌõÌõÖ´ÐУ¬ÎÒÏëÓ¦¸ÃÓа취һÌõÌõÖ´ÐеİÉ
ËùÒÔ½ñÌìÌØÒâµÄ²éÕÒÁËÒ»ÏÂ
ÔÚjdbcÏÂ˵¿ÉÒÔÉèÖÃÁ¬½Ó×Ö·û´®µÄʱºòÉèÖÃÒ»ÏÂ
ÉèÖóÉÈçÏ嵀 jdbc:mysql://192.168.3.180/sample?user=root&password=&allowMultiQueries=true
¾Í¿ÉÒÔÖ´Ð ......
connect·½·¨ÊÇjava.sql.Driver½Ó¿ÚÖж¨ÒåµÄ·½·¨£¬Èç¹ûÁ¬½ÓµÄÊý¾Ý¿â²»Í¬£¬ÄÇôΪ²»Í¬µÄÊý¾Ý¿â±àдJDBCÇý¶¯½«±äµÃºÜÁé»î£¬ÊµÏÖDriver½Ó¿Ú¼´¿É¡£Á¬½ÓÊý¾Ý¿âʱÊ×ÏȵÃ×°ÔØJDBCÇý¶¯£¬Ò²¾ÍÊǵ÷Óà Class.forName(“com.mysql.jdbc.Driver”)·½·¨£¬ÔÚµÚһƪÖÐÒѾÁгömysql jdbc DriverÀàµÄÔ´Â룬´ËÀà¼Ì³ÐNonRegisteringD ......
MysqlµÄ×Ö·û¼¯ÊDZȽÏÂé·³µÄ,ĬÈϵĶÔÎÒÃÇÀ´Ëµ¸ù±¾¾ÍûʲôÓÃ,ÎÒÃÇÊÇÒªÓõ½ÖÐÎĵÄ,ËùÒÔÒ»¶¨µÃ¸Ä×Ö·û¼¯,Èç¹û×Ö·û¼¯²»¶Ô»áÓкܶàµÄÎÊÌâ,ÓÐÂÒÂ뻹ÓоÍÊÇÎÒÃÇÔÚ³ÌÐòÀï²åÈëÖÐÎÄʱ»á¸øÄã˵mysql Data truncation: Data too long for column,ÄãǧÍò±ðÒÔΪÊÇÄãµÄ×Ö¶ÎÉèµÃ²»¹»³¤,ÄãÉèµÃÔÙ³¤Ëû¶¼»á±¨´í,ËùÒÔ¸Ä×Ö·û¼¯°É
ÎÒÃÇÒ»°ã×°ºÃÊý ......
Timestamp·Òë¹ýÀ´Ò²½Ð“ʱ¼ä´Á”£¬¿ÉÒÔ°üº¬“Äê-ÔÂ-ÈÕ-ʱ-·Ö-Ãë-ºÁÃ딣¬ÊÇjava.util.DateϵÄÒ»¸ö×ÓÀà¡£Èç¹ûÏëʵÏÖÏòMysqlÖвåÈë´øÓÐʱ·ÖÃëµÄʱ¼ä£¬ÔÚ±í½á¹¹ÀïÐèÒªÖ¸¶¨×Ö¶ÎÀàÐÍΪDateTime£¬Java³ÌÐòÀïÔÚ»ñȡϵͳʱ¼äºóÐèҪת»»ÎªÊ±·ÖÃëµÄ¸ñʽ£¬ÔÙת»»ÎªTimestamp¼´¿É£¬ÈçÏÂËùʾ£º
Date dt = new Dat ......