mysql ±íÊý¾Ý±¸·ÝºÍ»Ö¸´
¼Ù¶¨±ítbl_name¾ßÓÐÒ»¸öPRIMARY KEY»òUNIQUEË÷Òý£¬±¸·ÝÒ»¸öÊý¾Ý±íµÄ¹ý³ÌÈçÏ£º
1¡¢Ëø¶¨Êý¾Ý±í£¬±ÜÃâÔÚ±¸·Ý¹ý³ÌÖУ¬±í±»¸üÐÂ
mysql>LOCK
TABLES READ tbl_name;
¹ØÓÚ±íµÄËø¶¨µÄÏêϸÐÅÏ¢£¬½«ÔÚÏÂÒ»Õ½éÉÜ¡£
2¡¢µ¼³öÊý¾Ý
mysql>SELECT
* INTO OUTFILE ‘tbl_name.bak’ from tbl_name;
3¡¢½âËø±í
mysql>UNLOCK
TABLES;
ÏàÓ¦µÄ»Ö¸´±¸·ÝµÄÊý¾ÝµÄ¹ý³ÌÈçÏ£º
1¡¢Îª±íÔö¼ÓÒ»¸öдËø¶¨£º
mysql>LOCK
TABLES tbl_name WRITE;
2¡¢»Ö¸´Êý¾Ý
mysql>LOAD
DATA INFILE ‘tbl_name.bak’
->REPLACE INTO TABLE tbl_name;
Èç¹û£¬ÄãÖ¸¶¨Ò»¸öLOW_PRIORITY¹Ø¼ü×Ö£¬¾Í²»±ØÈçÉÏÒª¶Ô±íËø¶¨£¬ÒòΪÊý¾ÝµÄµ¼È뽫±»ÍƳٵ½Ã»Óпͻ§¶Á±íΪֹ£º
mysql>LOAD
DATA LOW_PRIORITY INFILE ‘tbl_name’
->REPLACE INTO TABLE tbl_name;
3¡¢½âËø±í
mysql->UNLOCAK
TABLES;
Ïà¹ØÎĵµ£º
mysql°²×°Í¼½â½Ì³Ì 5.1
2009Äê03ÔÂ01ÈÕ ÐÇÆÚÈÕ 23:51
תÔØÇë×¢Ã÷³ö´¦:http://hi.baidu.com/herdff/blog/item/6e6b4bcf6132f90b93457e14.html
±¾½Ì³ÌÒÔMysql 5.1°æ±¾ÎªÀý£¬¸ü¸ß°æ±¾°²×°¹ý³ÌÓë´ËÀàËÆ¡£ÔĶÁÇ°£¬ÇëÏÂÔØ5.1£¬ÏÂÔصØÖ·£ºwww.mysql.com
°²×°¹ý³ÌÓëÆäËüWindows°²×°³ÌÐòÒ»Ñù£¬Ê×ÏȳöÏÖµÄÊÇ°²×°Ïòµ¼»¶Ó½çÃæ
Ö ......
CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]
¸ÃÓï¾äÄÜ´´½¨ÐµÄÊÓͼ£¬Èç¹û¸ø¶¨ÁËOR REPLACE×Ӿ䣬¸ÃÓï¾ä»¹ÄÜÌæ»»ÒÑÓеÄÊÓͼ¡£select_st ......
Èç¹ûÒ»¸öMyISAM±í°üº¬Èκοɱ䳤¶ÈÁУ¨VARCHAR, BLOB»òTEXTDynamic£©£¬»òÕßÈç¹ûÒ»¸ö±í±»ÓÃROW_FORMAT=DYNAMICÑ¡ÏîÀ´´´½¨£¬¶¯Ì¬´æ´¢¸ñʽ±»Ê¹Óá£
Õâ¸ö¸ñʽ¸üΪ¸´ÔÓÒ»µã£¬ÒòΪÿÐÐÓÐÒ»¸ö±íÃ÷ÐÐÓж೤µÄÍ·¡£µ±Ò»¸ö¼Ç¼ÒòΪ¸üеĽá¹û±»±äµÃ¸ü³¤£¬¸Ã¼Ç¼Ҳ¿ÉÒÔÔÚ³¬¹ýÒ»¸öλÖô¦½áÊø¡£
Äã¿ÉÒÔʹÓÃOPTIMIZE TAB ......
¶¨ÒåÓαê
DECLARE cur_Ãû³Æ CURSOR
FOR
SELECT ×Ö¶Î1,×Ö¶Î2,...×Ö¶În from ±í where ×Ö¶Î1=±äÁ¿;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET ±äÁ¿1=null,±äÁ¿2=null;
OPEN cur_Ãû³Æ;
FETCH cur_Ãû³Æ INTO ±äÁ¿1,±äÁ¿2...;
WHILE ( ±äÁ¿1 IS NOT NULL) DO
&nbs ......
javaÖÐʱ¼ä´ÁºÍʱ¼ä×Ö·û´®Ö®¼äµÄת»»
»ñÈ¡µ±Ç°µÄunixʱ¼ä´Á
new Date().getTime()
System.currentTimeMillis()
·µ»ØµÄÊǺÁÃëÊý£¬Òª×ª»»long t = System.currentTimeMillis()/1000;
»ñÈ¡µ±Ç°ÄêÔÂÈÕÒÔ¼°Ê±·ÖÃë
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR)) c.get(Calendar.YEAR)) c.get(C ......