MySqlÖеÄTimestampÀàÐÍ×ֶεÄʹÓÃ
TIMESTAMPÁÐÀàÐÍÌṩһÖÖÀàÐÍ£¬Äã¿ÉÒÔʹÓÃËü×Ô¶¯µØÓõ±Ç°µÄÈÕÆÚºÍʱ¼ä±ê¼ÇINSERT»òUPDATEµÄ²Ù×÷¡£Èç¹ûÄãÓжà¸öTIMESTAMPÁУ¬Ö»ÓеÚÒ»¸ö×Ô¶¯¸üС£
×Ô¶¯¸üеÚÒ»¸öTIMESTAMPÁÐÔÚÏÂÁÐÈκÎÌõ¼þÏ·¢Éú£º
ÁÐûÓÐÃ÷È·µØÔÚÒ»¸öINSERT»òLOAD DATA INFILEÓï¾äÖÐÖ¸¶¨¡£
ÁÐûÓÐÃ÷È·µØÔÚÒ»¸öUPDATEÓï¾äÖÐÖ¸¶¨ÇÒһЩÁíÍâµÄÁиıäÖµ¡££¨×¢ÒâÒ»¸öUPDATEÉèÖÃÒ»¸öÁÐΪËüÒѾÓеÄÖµ£¬Õ⽫²»ÒýÆðTIMESTAMPÁб»¸üУ¬ÒòΪÈç¹ûÄãÉèÖÃÒ»¸öÁÐΪËüµ±Ç°µÄÖµ£¬MySQLΪÁËЧÂʶøºöÂÔ¸ü¸Ä¡££©
ÄãÃ÷È·µØÉ趨TIMESTAMPÁÐΪNULL.
³ýµÚÒ»¸öÒÔÍâµÄTIMESTAMPÁÐÒ²¿ÉÒÔÉèÖõ½µ±Ç°µÄÈÕÆÚºÍʱ¼ä£¬Ö»Òª½«ÁÐÉèΪNULL£¬»òNOW()¡£
ÎÒʹÓõķ½·¨ÊÇÔÚ´´½¨±íʱ½«×ֶεÄĬÈÏÖµÉèΪnow()£¬ÕâÖÖ·½·¨ÊÇ¿ÉÒԵġ£ÆäËü·½·¨»¹Ã»ÊÔ£¬ÒÔºóÓÐʱ¼äÔÙÊÔһϡ£ÖîλÈôÖªµÀÕâ·½ÃæµÄ֪ʶ£¬Çë²»Áߴͽ̡£
Ïà¹ØÎĵµ£º
ÎÒÃǵÄÏîÄ¿ÖÐÓкö಻µÈÓÚµÄÇé¿ö¡£½ñÌìдÕâƪÎÄÕ¼òµ¥µÄ·ÖÎöÒ»ÏÂÔõô¸öÓÅ»¯·¨¡£
ÕâÀïµÄ·Ö±íÂß¼ÊǸù¾Ýt_group±íµÄuser_name×éµÄ¸öÊýÀ´·ÖµÄ¡£
ÒòΪÕâÖÖÇé¿öµ¥¶Àuser_name×Ö¶ÎÉϵÄË÷Òý¾ÍÊôÓÚÀÃË÷Òý¡£Æð²»ÁËɶÃûÃ÷ÏÔµÄЧ¹û¡£
1¡¢ÊÔÑéPROCEDURE.
DELIMITER $$
DROP PROCEDURE `t_girl`.`sp_split_table`$$
CREATE PROCE ......
ÔÚ³ÌÐò¿ª·¢ÖУ¬ÓÐʱ»á±»×Ö·ûÂÒÂëµÄÎÊÌâËùÀ§ÈÅ¡£¶Ô´Ë£¬±ØÐëÀí½â MySQL µÄ×Ö·û¼¯±àÂëÉèÖõÄÔÀí£ºÔÚMySQLÖУ¬Ä¬ÈÏʹÓõÄÊÇlartin1£¬Ò²¾ÍÊÇISO8859-1×Ö·û¼¯±àÂë¡£ÕâÊÇÒ»ÖÖ8λµÄ±àÂ룬ÊÊÓÃÓÚËùÓÐÎ÷Å·×Ö·û¡£¶ø¶ÔÓÚºº×ÖµÈÊDz»ºÏÊʵġ£×îºÃ¡¢×îͨÓõıàÂë¸ñʽÊÇutf-8£¬UTF-8£¨8 λԪ Universal Cha ......
1.ʲôÊÇUDF? UDF(user-defined function)ÊÇmysqlΪÓû§ÌṩµÄ×Ô¶¨Ò庯ÊýµÄÀ©Õ¹½Ó¿Ú¡£Ëü±¾ÖÊÉϺÍmysqlÌṩµÄmax¡¢minºÍcountµÈº¯ÊýÀàËÆ¡£ 2.UDF¿ÉÒÔ×öʲô? UDFÊÇ×Ô¶¨Ò庯Êý£¬ËùÒÔËüÄÜ×öʲôÍêÈ«È¡¾öÓÚÄãµÄʵÏÖ¡£UDF¿ÉÒÔÔÚÆÕͨµÄsql¡¢triggerÒÔ¼°store procedure±»µ÷ÓᣠÈç¹û×Ô¶¨ÒåÒ»¸ötcp_send(ip,port,msg)µ ......
²Î¼û¹Ù·½²Î¿¼£¬µÚ25Õ£ºAPIºÍ¿â
25.2.3.49. mysql_ping()
int
mysql_ping(MYSQL *mysql)
ÃèÊö
¼ì²éÓë·þÎñÆ÷µÄÁ¬½ÓÊÇ·ñ¹¤×÷¡£Èç¹ûÁ¬½Ó¶ªÊ§£¬½«×Ô¶¯³¢ÊÔÔÙÁ¬½Ó¡£
¸Ãº¯Êý¿É±»ÏÐÖÃÁ˽ϳ¤Ê±¼äµÄ¿Í»§¶ËʹÓã¬ÓÃÒÔ¼ì²é·þÎñÆ÷ÊÇ·ñÒѹرÕÁËÁ¬½Ó£¬²¢ÔÚ±ØҪʱÔÙ´ÎÁ¬½Ó¡£
·µ»ØÖµ
Èç¹ûÓë·þÎñÆ÷µÄÁ¬½ÓÓÐЧ·µ»Ø ......