Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MYSQL »ñÈ¡µ±Ç°ÈÕÆÚ¼°ÈÕÆÚ¸ñʽ

MYSQL »ñÈ¡µ±Ç°ÈÕÆÚ¼°ÈÕÆÚ¸ñʽ
   »ñȡϵͳÈÕÆÚ£º  NOW()
   ¸ñʽ»¯ÈÕÆÚ£º    DATE_FORMAT(date, format)
               ×¢£º   date£ºÊ±¼ä×Ö¶Î
                         format£ºÈÕÆÚ¸ñʽ
·µ»ØϵͳÈÕÆÚ,Êä³ö 2009-12-25 14:38:59
select now();
Êä³ö 09-12-25
select date_format(now(),'%y-%m-%d');
¸ù¾Ýformat×Ö·û´®¸ñʽ»¯dateÖµ:
%S, %s  Á½Î»Êý×ÖÐÎʽµÄÃ루 00,01, ..., 59£©
%I, %i  Á½Î»Êý×ÖÐÎʽµÄ·Ö£¨ 00,01, ..., 59£©
%H  Á½Î»Êý×ÖÐÎʽµÄСʱ£¬24 Сʱ£¨00,01, ..., 23£©
%h  Á½Î»Êý×ÖÐÎʽµÄСʱ£¬12 Сʱ£¨01,02, ..., 12£©
%k  Êý×ÖÐÎʽµÄСʱ£¬24 Сʱ£¨0,1, ..., 23£©
%l  Êý×ÖÐÎʽµÄСʱ£¬12 Сʱ£¨1, 2, ..., 12£©
%T  24 СʱµÄʱ¼äÐÎʽ£¨hh:mm:ss£©
%r  12 СʱµÄʱ¼äÐÎʽ£¨hh:mm:ss AM »òhh:mm:ss PM£©
%p  AM»òPM
%W  Ò»ÖÜÖÐÿһÌìµÄÃû³Æ£¨Sunday, Monday, ..., Saturday£©
%a  Ò»ÖÜÖÐÿһÌìÃû³ÆµÄËõд£¨Sun, Mon, ..., Sat£©
%d  Á½Î»Êý×Ö±íʾÔÂÖеÄÌìÊý£¨00, 01,..., 31£©
%e  Êý×ÖÐÎʽ±íʾÔÂÖеÄÌìÊý£¨1, 2£¬ ..., 31£©
%D  Ó¢Îĺó׺±íʾÔÂÖеÄÌìÊý£¨1st, 2nd, 3rd,...£©
%w  ÒÔÊý×ÖÐÎʽ±íʾÖÜÖеÄÌìÊý£¨ 0 = Sunday, 1=Monday, ..., 6=Saturday£©
%j  ÒÔÈýλÊý×Ö±íʾÄêÖеÄÌìÊý£¨ 001, 002, ..., 366£©
%U  ÖÜ£¨0, 1, 52£©£¬ÆäÖÐSunday ΪÖÜÖеĵÚÒ»Ìì
%u  ÖÜ£¨0, 1, 52£©£¬ÆäÖÐMonday ΪÖÜÖеĵÚÒ»Ìì
%M  ÔÂÃû£¨January, February, ..., December£©
%b  ËõдµÄÔÂÃû£¨ January, February,...., December£©
%m  Á½Î»Êý×Ö±íʾµÄÔ·ݣ¨01, 02, ..., 12£©
%c  Êý×Ö±íʾµÄÔ·ݣ¨1, 2, ...., 12£©
%Y  ËÄλÊý×Ö±íʾµÄÄê·Ý
%y  Á½Î»Êý×Ö±íʾµÄÄê·Ý
%%  Ö±½ÓÖµ“%”


Ïà¹ØÎĵµ£º

mysql³ö´í´úÂëÖÐÎÄ˵Ã÷

¡¡¡¡mysql³ö´íÁË,ÒÔÇ°ÍùÍù¿¿²Â.ÓÐÁËÕâÕűí,Ò»²é¾Í³öÀ´ÁË.·½±ã²»ÉÙ.Ìع²ÏíÓÚÖÚ
1005£º´´½¨±íʧ°Ü
1006£º´´½¨Êý¾Ý¿âʧ°Ü
1007£ºÊý¾Ý¿âÒÑ´æÔÚ£¬´´½¨Êý¾Ý¿âʧ°Ü
1008£ºÊý¾Ý¿â²»´æÔÚ£¬É¾³ýÊý¾Ý¿âʧ°Ü
1009£º²»ÄÜɾ³ýÊý¾Ý¿âÎļþµ¼ÖÂɾ³ýÊý¾Ý¿âʧ°Ü
1010£º²»ÄÜɾ³ýÊý¾ÝĿ¼µ¼ÖÂɾ³ýÊý¾Ý¿âʧ°Ü
1011£ºÉ¾³ýÊý¾Ý¿âÎļþʧ ......

ÈçºÎÒÆÖµ£¨»Ö¸´¡¢»¹Ô­£©MysqlÖеÄinnoDBµÄÊý¾Ý¿â¡£

½ñÌì¸ãÁËÒ»Ì죬ÖÕÓڸ㶨ÁË¡£
¶ÔÓÚMysqlÓÐÁ½ÖÖģʽ£¬MYISAMÓëINNODB
Èç¹ûÊÇMYISAMµÄ»°£¬ÔÚdataĿ¼ÏÂÀï»á.frm .myd .myi ÈýÖÖÎļþ£¬ÄÇôֱ½Ó°ÑDATAÒƹýÈ¥£¬ÅäÖúÃȨÏ޾ͿÉÒÔ»¹Ô­ÁË¡£
Èç¹ûÊÇINNODBµÄ»°£¬ÄÇÊÇÏ൱µÄ·³°¡¡£ÔÚdataĿ¼ÏÂÖ»ÓÐ.frm(ÕâÖ»ÊÇÒ»¸öÊý¾Ý¸ñʽ£©£¬Õâ¸öÒƹýÈ¥ºó£¬ÊÇÎÞ·¨»¹Ô­Ô­Ê¼Êý¾ÝµÄ¡£
ÕæÕýµÄÊý¾ÝÊÇÕ ......

¸ü¸ÄmysqlÊý¾Ý¿â±àÂëΪGBK

¸Õ¸Õ°²×°Íêmysqlºó
´ÓcmdÖнøÈëmysqlÊý¾Ý¿â
ÃüÁîÐÐÖÐÊäÈ룺
mysql -uroot -p123
½øÈëmysqlÊý¾Ý¿âÖÐ
ÃüÁîÐÐÖÐÊäÈë:
status;
²é¿´µ±Ç°Êý¾Ý¿âÖеıàÂë
ÈçÏ£º
--------------
mysql  Ver 14.12 Distrib 5.1.7-beta, for Win32 (ia32)
Connection id:       &nb ......

Red Hat enterprise linux 5 mysql°²×°²½Öè

Ò»¡¢°²×°·þÎñÆ÷¶Ë
£¨1£©¡¢ÔÚÓÐÁ½¸örmpÎļþµÄĿ¼ÏÂÔËÐÐÈçÏÂÃüÁ
[root@test1 local]# rpm -ivh MySQL-server-5.0.26-0.i386.rpm
ÏÔʾÈçÏÂÐÅÏ¢£º
warning: MySQL-server-5.0.26-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing……¡¡¡¡¡¡¡¡¡¡¡¡¡¡##################################### ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ