mysqlÈÕÆÚºÍʱ¼ä¸ñʽת»»
¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
DAYOFWEEK(date)
·µ»ØÈÕÆÚdateµÄÐÇÆÚË÷Òý(1=ÐÇÆÚÌ죬2=ÐÇÆÚÒ», ……7=ÐÇÆÚÁù)¡£ÕâЩË÷ÒýÖµ¶ÔÓ¦ÓÚODBC±ê×¼¡£
mysql> select DAYOFWEEK('1998-02-03');
-> 3
WEEKDAY(date)
·µ»ØdateµÄÐÇÆÚË÷Òý(0=ÐÇÆÚÒ»£¬1=ÐÇÆÚ¶þ, ……6= ÐÇÆÚÌì)¡£
mysql> select WEEKDAY('1997-10-04 22:23:00');
-> 5
mysql> select WEEKDAY('1997-11-05');
-> 2
DAYOFMONTH(date)
·µ»ØdateµÄÔ·ÝÖÐÈÕÆÚ£¬ÔÚ1µ½31·¶Î§ÄÚ¡£
mysql> select DAYOFMONTH('1998-02-03');
-> 3
DAYOFYEAR(date)
·µ»ØdateÔÚÒ»ÄêÖеÄÈÕÊý, ÔÚ1µ½366·¶Î§ÄÚ¡£
mysql> select DAYOFYEAR('1998-02-03');
-> 34
MONTH(date)
·µ»ØdateµÄÔ·ݣ¬·¶Î§1µ½12¡£
mysql> select MONTH('1998-02-03');
-> 2
DAYNAME(date)
·µ»ØdateµÄÐÇÆÚÃû×Ö¡£
mysql> select DAYNAME("1998-02-05");
-> 'Thursday'
MONTHNAME(date)
·µ»ØdateµÄÔ·ÝÃû×Ö¡£
mysql> select MONTHNAME("1998-02-05");
-> 'February'
QUARTER(date)
·µ»ØdateÒ»ÄêÖеļ¾¶È£¬·¶Î§1µ½4¡£
mysql> select QUARTER('98-04-01');
-> 2
WEEK(date)
¡¡
WEEK(date,first)
¶ÔÓÚÐÇÆÚÌìÊÇÒ»ÖܵĵÚÒ»ÌìµÄµØ·½£¬ÓÐÒ»¸öµ¥¸ö²ÎÊý£¬·µ»ØdateµÄÖÜÊý£¬·¶Î§ÔÚ0µ½52¡£2¸ö²ÎÊýÐÎʽWEEK()ÔÊÐí
ÄãÖ¸¶¨ÐÇÆÚÊÇ·ñ¿ªÊ¼ÓÚÐÇÆÚÌì»òÐÇÆÚÒ»¡£Èç¹ûµÚ¶þ¸ö²ÎÊýÊÇ0£¬ÐÇÆÚ´ÓÐÇÆÚÌ쿪ʼ£¬Èç¹ûµÚ¶þ¸ö²ÎÊýÊÇ1£¬
´ÓÐÇÆÚÒ»¿ªÊ¼¡£
mysql> select WEEK('1998-02-20');
-> 7
mysql> select WEEK('1998-02-20',0);
-> 7
mysql> select WEEK('1998-02-20',1);
-> 8
YEAR(date)
·µ»ØdateµÄÄê·Ý£¬·¶Î§ÔÚ1000µ½9999¡£
mysql> select YEAR('98-02-03');
-> 1998
HOUR(time)
·µ»ØtimeµÄСʱ£¬·¶Î§ÊÇ0µ½23¡£
mysql> select HOUR('10:05:03');
-> 10
MINUTE(time)
·µ»ØtimeµÄ·ÖÖÓ£¬·¶Î§ÊÇ0µ½59¡£
mysql> select MINUTE('98-02-03 10:05:03');
-> 5
SECOND(time)
»ØÀ´timeµÄÃë
Ïà¹ØÎĵµ£º
´úÂëÈçÏ£º
1 String command = " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
2 try {
3 Process process& ......
×î½üÓöµ½Ò»¸öÐèÇóÒªÔÚlinuxÏÂÓÃjava µ÷ÓÃmysql¿Í»§¶ËÔ¶³ÌµÇ½mysql·þÎñÆ÷£¬´Ó¿Í»§¶Ë»úÆ÷µ¼Èëmysql½Å±¾£¬´Ómysql·þÎñÆ÷¶Ëµ¼³ö±íÖеÄÊý¾Ý¡£ÒÔÏÂÊÇÓõ½µÄÖ÷Òª·½·¨£º
Java ´úÂë
/**
* µ¼ÈëÊý¾Ý
* @param ½Å±¾µÄµØÖ·ºÍÃû³Æ
* @return ÊÇ·ñ³ ......
http://www.javaeye.com/topic/211951
Õâ¶Îʱ¼äÔÚ¿´¡¶High Performance MySQL¡·£¬¿´µ½´æ´¢ÒýÇæÕâ¸öµØ·½¸Ðµ½ºÜ¶àϸ½Ú±È½ÏÄ°Éú£¬ËùÒÔ×ܽáС¼ÇһЩ
ΪÁËÊÊÓ¦¸÷ÖÖ²»Í¬µÄÔËÐл·¾³£¬MYSQLÌṩÁ˶àÖÖ²»Í¬µÄ´æ´¢ÒýÇ棨Storage Engine £©,ÔÚÓ¦ÓóÌÐò¿ª·¢Õâ¸ö²ãÃæÉÏ£¬¿ª·¢Õß¿ÉÒÔ¸ù¾Ý²»Í¬µÄÐèÇóÑ¡ÔñÊʺϵÄStorage Engine ·½°¸£¬¸üΪÁ ......
Õª³×Ô£ºhttp://database.ctocio.com.cn/153/9232653.shtml
ºÜ¶àʱºò¹ØÐĵÄÊÇÓÅ»¯SELECT ²éѯ£¬ÒòΪËüÃÇÊÇ×î³£ÓõIJéѯ£¬¶øÇÒÈ·¶¨ÔõÑùÓÅ»¯ËüÃDz¢²»×ÜÊÇÖ±½ØÁ˵±¡£Ïà¶ÔÀ´Ëµ£¬½«Êý¾Ý×°ÈëÊý¾Ý¿âÊÇÖ±½ØÁ˵±µÄ¡£È»¶ø£¬Ò²´æÔÚ¿ÉÓÃÀ´¸ÄÉÆÊý¾Ý×°ÔزÙ×÷ЧÂʵIJßÂÔ£¬Æä»ù±¾ÔÀíÈçÏ£º
¡¡¡¡³ÉÅú×°Ôؽϵ¥ÐÐ×°Ôظü¿ì£¬ÒòΪÔÚ×°ÔØÿ¸ö¼Ç ......
ÔÚwindowsÏÂ
£º
Æô¶¯£º
1.cd c:\mysql\bin
2.mysqld --console
¹Ø±Õ£º
1.cd c:\mysql\bin
......