MYSQL£ºCannot convert value '0000
½ñÌì´ÓMYSQLÊý¾Ý¿âץȡʱ£¬·¢ÉúÁËCannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMPÒì³£
googleÁËһϣ¬´ó¸ÅÒâ˼ÊÇMySQLÖеÄDatetimeÖµÎÞ·¨ÔÙJAVAÖпɿ¿µÄ±»±íʾ£¬°´ÕÕJDBCºÍSQLµÄ±ê׼ĬÈÏÇé¿öϲúÉúÒì³£¡£
JDBCÔÊÐíÓÃÏÂÁеÄÖµ¶ÔzeroDateTimeBehavior ÊôÐÔÀ´ÉèÖÃÕâЩ´¦Àí·½Ê½£¬
exception (the default), which throws an SQLException with an SQLState of S1009.
ÉèÖÃΪexception Òì³££¨È±Ê¡£©ÓÃÒ»¸öSQLStateµÄs1009´íÎóºÅÀ´Å׳öÒ»¸öÒì³£
convertToNull, which returns NULL instead of the date.
ÉèÖÃΪconvertToNull£¬ÓÃNULLÖµÀ´´úÌæÕâ¸öÈÕÆÚÀàÐÍ
round, which rounds the date to the nearest closest value which is 0001-01-01.
ÉèÖÃΪround£¬ÔòΧÈÆÕâ¸öÈÕÆÚ×î½Ó½üµÄÖµ£¨0001-01-01£©À´´úÌæ
Äã¿ÉÒÔÐÞ¸ÄÄãµÄjdbcÁ¬½Ó
jdbc:mysql://localhost:3306/NovelSiteDB?user=root&password=zjwilove4&zeroDateTimeBehavior=round
ÔËÐгɹ¦!
ת×Ô£ºhttp://blog.csdn.net/pjchen/archive/2008/04/19/2308245.aspx
Ïà¹ØÎĵµ£º
my.iniÎļþÅäÖ㺠[mysql] default-character-set=GBK #´Ë´¦µÄ±àÂëÊÇMySQL¿ØÖÆ̨ÏÔʾµÄ±àÂ뷽ʽ£¬Ó¦¸ÃÉèÖÃΪGBK [mysqld] default-character-set=utf8 #´Ë´¦µÄ±àÂëÊÇMySQLÊý¾Ý´æ´¢µÄ¸ñʽ£¬Ó¦¸ÃÉèÖÃΪutf8£¬¿ÉÒÔ´æ´¢ÊÀ½çÉϾø´ó¶àÊý×Ö·û ......
ÔÎÄÁ´½Ó£ºhttp://hi.baidu.com/171892549/blog/item/14818d0ac616ee34b1351dbd.html
ÔÚÊý¾Ý¿â±íÖУ¬Ê¹ÓÃË÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËٶȡ£
¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö testIndex ±í£º
CREATE TABLE testIndex(i_testID INT NOT NULL,vc_Name VARCHAR(16) NOT NULL);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË 1000 Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ i_testID vc_Name ......
Ò»¡¢ÎÊÌâµÄÌá³ö
¡¡¡¡ÔÚÓ¦ÓÃϵͳ¿ª·¢³õÆÚ£¬ÓÉÓÚ¿ª·¢Êý¾Ý¿âÊý¾Ý±È½ÏÉÙ£¬¶ÔÓÚ²éѯSQLÓï¾ä£¬¸´ÔÓÊÓͼµÄµÄ±àдµÈÌå»á²»³öSQLÓï¾ä¸÷ÖÖд·¨µÄÐÔÄÜ¡£ÓÅÁÓ£¬µ«ÊÇÈç¹û½«Ó¦ÓÃϵͳÌύʵ¼ÊÓ¦Óúó£¬Ëæ×ÅÊý¾Ý¿âÖÐÊý¾ÝµÄÔö¼Ó£¬ÏµÍ³µÄÏìÓ¦ËٶȾͳÉΪĿǰϵͳÐèÒª½â¾öµÄ×îÖ÷ÒªµÄÎÊÌâÖ®Ò»¡£ÏµÍ³ÓÅ»¯ÖÐÒ»¸öºÜÖØÒªµÄ·½Ãæ¾ÍÊÇSQLÓï¾äµÄÓÅ»¯¡£¶ÔÓ ......
1.¸´ÖƱí½á¹¹¼°Êý¾Ýµ½Ð±í
CREATE TABLE бí SELECT * from ¾É±í
2.Ö»¸´ÖƱí½á¹¹µ½Ð±í
CREATE TABLE бí SELECT * from ¾É±í WHERE 1=2
»òCREATE TABLE бí LIKE ¾É±í
3.¸´ÖƾɱíµÄÊý¾Ýµ½Ð±í(¼ÙÉèÁ½¸ö±í½á¹¹Ò»Ñù)
INSERT INTO бí SELECT * from ¾É±í
4.¸´ÖƾɱíµÄÊý¾Ýµ½Ð±í(¼ÙÉèÁ½¸ö±í½á¹¹²»Ò»Ñù)
IN ......
ÒýÓÃhttp://bbs.yahunet.com/thread-9946-1-1.html
´Ó»ù±¾Çé¿ö¡¢³É±¾¡¢ÓÅȱµãºÍÓ¦Óó¡ºÏµÈ·½Ãæ¶Ô5ÖÖMySQLµÄ¿É¿¿ÐÔ·½°¸
½øÐÐÁË·ÖÎö
ºÍ±È½Ï£¬¶ÔMySQLµÄ¿ª·¢ºÍ¹ÜÀí
ÓÐÒ»¶¨µÄ½è¼ø×÷Óá£
1£®MySQL Clustering(ndb-cluster stogare)
¼ò½é£º
MySQL¹«Ë¾ÒÔ´æ´¢ÒýÇ淽ʽÌṩµÄ¸ß¿É¿¿ÐÔ·½°¸£¬ÊÇÊÂÎñ°²È«µÄ£¬ÊµÊ±¸´ÖÆÊý¾Ý
£¬¿ÉÓ ......