mysql update set
update article set body = (REPLACE(body, '</div>', ' ')) where typeid=21
ÓÃupdateºÍreplaceÔÚmysqlÖÐÌ滻ijһ¸ö×ֶεIJ¿·ÖÄÚÈÝ
update users_settings set `ConfigValue` = replace(configvalue,' fromstr' 'tostr') where `ConfigName`='accesslist'
¶ÔÓÚÕë¶Ô×Ö·û´®Î»ÖõIJÙ×÷£¬µÚÒ»¸öλÖñ»±ê¼ÇΪ1¡£
ASCII(str)
·µ»Ø×Ö·û´®str
µÄ×î×óÃæ×Ö·ûµÄASCII´úÂëÖµ¡£
Èç¹ûstr
ÊÇ¿Õ×Ö·û´®£¬·µ»Ø0
¡£Èç¹ûstr
ÊÇNULL
£¬·µ»ØNULL
¡£
mysql> select ASCII('2');
-> 50
mysql> select ASCII(2);
-> 50
mysql> select ASCII('dx');
-> 100
Ò²¿É²Î¼ûORD()º¯Êý¡£
ORD(str)
Èç¹û×Ö·û´®str×î×óÃæ×Ö·ûÊÇÒ»¸ö¶à×Ö½Ú×Ö·û£¬Í¨¹ýÒÔ¸ñʽ((first byte ASCII code)*256+(second byte ASCII code))[*256+third byte ASCII code...]
·µ»Ø×Ö·ûµÄASCII´úÂëÖµÀ´·µ»Ø¶à×Ö½Ú×Ö·û´úÂë¡£Èç¹û×î×óÃæµÄ×Ö·û²»ÊÇÒ»¸ö¶à×Ö½Ú×Ö·û¡£·µ»ØÓëASCII()
º¯Êý·µ»ØµÄÏàֵͬ¡£
mysql> select ORD('2');
-> 50
CONV(N,from_base,to_base)
ÔÚ²»Í¬µÄÊý×Ö»ùÖ®¼ä±ä»»Êý×Ö¡£·µ»ØÊý×ÖN
µÄ×Ö·û´®Êý×Ö£¬´Ófrom_base
»ù±ä»»Îªto_base
»ù£¬Èç¹ûÈκβÎÊýÊÇNULL
£¬·µ»ØNULL
¡£²ÎÊýN
½âÊÍΪһ¸öÕûÊý£¬µ«ÊÇ¿ÉÒÔÖ¸¶¨ÎªÒ»¸öÕûÊý»òÒ»¸ö×Ö·û´®¡£×îС»ùÊÇ2
ÇÒ×î´óµÄ»ùÊÇ36
¡£Èç¹ûto_base
ÊÇÒ»¸ö¸ºÊý£¬N
±»ÈÏΪÊÇÒ»¸öÓзûºÅÊý£¬·ñÔò£¬N
±»µ±×÷ÎÞ·ûºÅÊý¡£ CONV
ÒÔ64λµã¾«¶È¹¤×÷¡£
mysql> select CONV("a",16,2);
-> '1010'
mysql> select CONV("6E",18,8);
-> '172'
mysql> select CONV(-17,10,-18);
-> '-H'
mysql> select CONV(10+"10"+'10'+0xa,10,10);
-> '40'
BIN(N)
·µ»Ø¶þ½øÖÆÖµN
µÄÒ»¸ö×Ö·û´®±íʾ£¬ÔÚ´ËN
ÊÇÒ»¸ö³¤ÕûÊý(BIGINT
)Êý×Ö£¬ÕâµÈ¼ÛÓÚCONV(N,10,2)
¡£Èç¹ûN
ÊÇNULL
£¬·µ»ØNULL
¡£
mysql> select BIN(12);
-> '1100'
OCT(N)
·µ»Ø°Ë½øÖÆÖµN
µÄÒ»¸ö×Ö·û´®µÄ±íʾ£¬ÔÚ´ËN
ÊÇÒ»¸ö³¤ÕûÐÍÊý×Ö£¬ÕâµÈ¼ÛÓÚCONV(N,10,8)
¡£Èç¹ûN
ÊÇNULL£¬·µ»ØNULL
¡£
mysql> select OCT(12);
-> '14'
HEX(N)
·µ»ØÊ®Áù½øÖÆÖµN
Ò»¸ö×Ö·û´®µÄ±íʾ£¬ÔÚ´ËN
ÊÇÒ»¸ö³¤ÕûÐÍ(BIGINT
)Êý×Ö£¬ÕâµÈ¼ÛÓÚCONV(N,10,16)
¡£Èç¹ûN
ÊÇNULL
Ïà¹ØÎĵµ£º
1,ÔÚcmdÏÂÓÃmysql¿Í»§»úÁ¬½Ómysql·þÎñÆ÷ php³ÌÐòÔ±Õ¾
´ò¿ªcmdºó,ÊäÈë php³ÌÐòÔ±Õ¾
mysql -h localhost -u root -p
phperz.com
Óï·¨: mysqlµ±È»ÊǸæËßcmd,ÕâÊÇmysqlµÄÃüÁîÁË php³ÌÐòÔ±Ö®¼Ò
²ÎÊý -h ÊÇ·þÎñÆ÷µØÖ·,ÔÚ´ËÎÒÃÇÒÔ±¾»úΪÀýÊäÈëlocalhost
-u ÊÇmysqlµÄÓû§Ãû ÎÒÃÇÓÃmysql µÄĬÈÏÓû§Ãû root phperz ......
MYSQL »ñÈ¡µ±Ç°ÈÕÆÚ¼°ÈÕÆÚ¸ñʽ
»ñȡϵͳÈÕÆÚ£º NOW()
¸ñʽ»¯ÈÕÆÚ£º DATE_FORMAT(date, format)
×¢£º date£ºÊ±¼ä×Ö¶Î
  ......
1£®Ë÷Òý×÷ÓÃ
ÔÚË÷ÒýÁÐÉÏ£¬³ýÁËÉÏÃæÌáµ½µÄÓÐÐò²éÕÒÖ®Í⣬Êý¾Ý¿âÀûÓø÷ÖÖ¸÷ÑùµÄ¿ìËÙ¶¨Î»¼¼Êõ£¬Äܹ»´ó´óÌá¸ß²éѯЧÂÊ¡£ÌرðÊǵ±Êý¾ÝÁ¿·Ç³£´ó£¬²éѯÉæ¼°¶à¸ö±íʱ£¬Ê¹ÓÃË÷ÒýÍùÍùÄÜʹ²éѯËٶȼӿì³ÉǧÉÏÍò±¶¡£
ÀýÈ磬ÓÐ3¸öδË÷ÒýµÄ±ít1¡¢t2¡¢t3£¬·Ö±ðÖ»°üº¬ÁÐc1¡¢c2¡¢c3£¬Ã¿¸ö±í·Ö±ðº¬ÓÐ1000ÐÐÊý¾Ý×é³É£¬Ö¸Îª1¡«1000µÄÊýÖµ£¬² ......
×î½ü×öÒ»¸öСÏîÄ¿£¬¸ÕºÃÓöµ½Õâ¸öÎÊÌ⣬ûʲôʱ¼äÈ¥½â¾öÕâ¸öÎÊÌ⣬´ó¸ÅÔÚÍøÉÏÕÒÁËһϣ¬Ëµ¸ÄʵÀýÃû£¬¸Ä×¢²á±í£¬ÏȲ»ÊǺܸҸģ¬±Ï¾¹¶Ô×¢²á±íÒ»Ö±¾õµÃÊǸö´óÉñ£¬²»¸ÒËæ±ã¶¯£¬½ñ¶ùÊÇ»í³öÈ¥ÁË£¬¾ÍÔÚ×¢²á±íÖвéÕÒËùÓдúmysql×ÖÑùµÄÐÅϢȫ²¿É¾³ý£¬×îºó¾¹È»³ÉÁË£¬µ±È»Ð¶Ôغóɾ³ý֮ǰËùÓеÄÏà¹ØÐÅÏ¢£¬°²×°ÎļþÄ¿ ......
Mysql Explain Ïê½â
Ò».Óï·¨
explain < table_name >
ÀýÈç: explain select * from t3 where id=3952602;
¶þ.explainÊä³ö½âÊÍ
+----+-------------+-------+-------+-------------------+---------+---------+-------+------+-------+
| id | select_type | table | type | possible_keys &nb ......