MySQLѧϰ(5)IN,GRANT,MD5,EXISTS
1.INµÄÓ÷¨
IN(value,value1,...) valuesµÄ¸öÊý¸úmax_allowed_packetÏà¹Ø£¬SELECT 2 IN (2,4,'STRING');
NOT IN(value,..)ºÍINÓï·¨Ò»Ñù¡£
2.IF NOT EXISTS
CREATE ... IF NOT EXISTS stm; ...¿ÉÒÔʹDATABASE,TABLE,EVENT¡£ÈçCREATE TABLE IF NOT EXISTS t(id INT);
3.MD5,MySQLÊý¾Ý¿âÌṩÁËmd5¼ÓÃܹ¦ÄÜ¡£
SELECT MD5('4444');
4.GRANT
GRANT ALL ON *.* TO 'user2' IDENTIFIED 'puser';
´´½¨Óû§²¢ÊÚȨ¡£
Ïà¹ØÎĵµ£º
ת×Ôhttp://amoeba.meidusa.com/wordpress/?p=24£¬Ò»¸öºÜºÃµÄ¹¤¾ß¡£¡£¡£¡£ÆÚ´ýÑо¿
ÐÞ¸´bugÁбí:
1¡¢ÐÞ¸´ÎÞ·¨½âÎöÅ׳öunknown statement£¨1.0.0ÐÂbug£©¡£½«ÎÞ·¨½âÎöµÃsqlĬÈÏÔÚdefaultPoolÖÐÖ´ÐÐ
2¡¢ÐÞ¸´union¹Ø¼ü×ÖÎÞ·¨½âÎöÎÊÌâ
3¡¢ÐÞ¸´º¯ÊýÇ°Ãæ! ÎÞ·¨½âÎöÎÊÌâ
4¡¢ÐÞ¸´order by ¡¢group by ºóÃæ´ø±í´ïʽµÃsql
ÏÂÔØµØ ......
mysqlÖв»Çø·Ö´óСд£º
LinuxÖÐMySQLµÄÅäÖÃÎļþÖÐ(/etc/my.cnf)£¬ÊÇûÓÐlower_case_table_names=1ÕâÐеġ£
ÔÚWindows°²×°µÄMySQLµÄÅäÖÃÎļþÖÐ(my.ini)£¬ÊÇÓÐlower_case_table_names=1ÕâÐеġ£
lower_case_table_names=1µÄÓÃ;ÊÇÈÃMySQLʵÏÖ²»Çø·Ö´óСд
mysqlÖÐÔÊÐíÆäËû»úÆ÷·ÃÎÊ£º
mysql> use mysql;
Õâ¾ä»°µÄÒâ˼ ......
Õ⼸Ì죬ÏîÄ¿ÖÐÓиöÐèÇ󣬵½Êý¾Ý¿âÕâ²½µÄ½á¹û¾ÍÊÇÐèÒªÅúÁ¿updateµÄÊý¾Ý£¬×ܲ»ÄÜÑ»·Ê¹ÓÃupdate....set...°É£¬ÕâÑùÏÔʾЧÂÊÊǺܵͣ¬ÎªÁ˽â¾öÕâ¸öÎÊÌ⣬´ó¼ÒÒ²ÊÇÏëÁ˺ܶàµÄ°ì·¨¡£
ÏÈ˵Õ⼸¸ö½â¾ö·½°¸£º
1£ºÑ»·update²Ù×÷£ºÊ²Ã´¶¼²»ËµÁË£¬ÏÔÈ»ÌÔÌÁË£»
2£º ......
Êý¾Ý¿âÉè¼Æ£º
--
-- Êý¾Ý¿â: `test`
--
-- --------------------------------------------------------
--
-- ±íµÄ½á¹¹ `menu`
--
CREATE TABLE IF NOT EXISTS `menu` (
`ID` int(10) unsigned NOT NULL auto_increment,
`PID` int(11) NOT NULL,
`TITLE` varchar(200) NOT NULL,
`REMARK` varchar(200) NOT ......