MySql ×Ö·û´®º¯Êý
MySql ×Ö·û´®º¯Êý
[ 2006-04-22 19:24:44 | Author: Ychon ]
Font Size: Large | Medium | Small
¶ÔÓÚÕë¶Ô×Ö·û´®Î»Öõ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£¬·µ»ØNULL¡£
mysql> select HEX(255);
-> 'FF'
CHAR(N,...)
CHAR()½«²ÎÊý½âÊÍΪÕûÊý²¢ÇÒ·µ»ØÓÉÕâЩÕûÊýµÄASCII´úÂë×Ö·û×é³ÉµÄÒ»¸ö×Ö·û´®¡£NULLÖµ±»Ìø¹ý¡£
mysql> select CHAR(77,121,83,81,'76');
-> 'MySQL'
mysql> select CHAR(77,77.3,'77.3');
-> 'MMM'
CONCAT(str1,str2,...)
·µ»ØÀ´×ÔÓÚ²ÎÊýÁ¬½áµÄ×Ö·û´®¡£Èç¹ûÈκβÎÊýÊÇNULL£¬·µ»ØNULL¡£¿ÉÒÔÓг¬¹ý2¸öµÄ
Ïà¹ØÎĵµ£º
1.CREATE USER
CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
CREATE USERÓÃÓÚ´´½¨ÐµÄMySQLÕË»§¡£ÒªÊ¹ÓÃCREATE USER£¬Äú±ØÐëÓµÓÐmysqlÊý¾Ý¿âµÄÈ«¾ÖCREATE USERȨÏÞ£¬»òÓµÓÐINSERTȨÏÞ¡£¶ÔÓÚÿ¸öÕË»§£¬CREATE USER»áÔÚûÓÐȨÏÞµÄmysq ......
×î½üÓöµ½Ò»¸öÐèÇóÒªÔÚlinuxÏÂÓÃjava µ÷ÓÃmysql¿Í»§¶ËÔ¶³ÌµÇ½mysql·þÎñÆ÷£¬´Ó¿Í»§¶Ë»úÆ÷µ¼Èëmysql½Å±¾£¬´Ómysql·þÎñÆ÷¶Ëµ¼³ö±íÖеÄÊý¾Ý¡£ÒÔÏÂÊÇÓõ½µÄÖ÷Òª·½·¨£º
Java ´úÂë
/**
* µ¼ÈëÊý¾Ý
* @param ½Å±¾µÄµØÖ·ºÍÃû³Æ
* @return ÊÇ·ñ³ ......
10055:ûÓлº´æ¿Õ¼ä¿ÉÀûÓà ·½·¨:²é¿´ÏÂÄãµÄCÅÌ¿Õ¼äÊÇ·ñÒѾÂú,Çå³ýһЩûÓÐÓõÄÎļþ. ¿ÉÒÔÔÚºǫ́µÄ"ÂÛ̳ºËÐÄÉèÖÃ","ºËÐŦÄÜÉèÖÃ"Àï"½ø³ÌÓÅ»¯"¿ªÆô,"GZIP ѹËõÊä³ö"¹Ø±Õ. ²éÕÒÁËÒ»ÏÂ10055£¨Ã»Óлº´æ
˵Ã÷:Èç¹ûÓöµ½Êý¾Ý¿â³ö´íµÄÎÊÌâÐÞ¸ÄÏàÓ¦µÄ´úÂëºóÒ»°ãÒªÖØÆômysql¡£Èç¹ûÓöµ½mysqlµÄÎÊÌâ¿ÉÒÔÏÈÖØÆ ......
Ç°²»¾ÃÍøÉϹ«¿ªÁËÒ»¸öMySQL FuncµÄ©¶´,½²µÄÊÇʹÓÃMySQL´´½¨Ò»¸ö×Ô¶¨ÒåµÄº¯Êý,È»ºóͨ¹ýÕâ¸öº¯ÊýÀ´¹¥»÷·þÎñÆ÷¡£×îÔç¿´µ½Ïà¹ØµÄ±¨µÀÊÇÔÚo-otikÉÏ,µ«Êǹ«²¼µÄÊÇÕë¶Ô UnixϵͳµÄExploit,²¢Çҳɹ¦ÂÊÒ²²»ÊǺܸß.¶ø½üÆÚ,¹úÄÚÓиßÊַųöÕë¶ÔWinϵͳµÄÏà¹ØÎÄÕÂ,ÓÚÊÇÎÒÂíÉÏÕÒÀ´ÓëÅóÓÑһͬÑо¿.
ÆäʵÎÒÃÇÔç¾ÍÄÜÏëµ½.µ±ÎÒÃÇÔÚ¶ÔMSSQL ......