mysql> grant ȨÏÞ1,ȨÏÞ2,¡È¨ÏÞn on Êý¾Ý¿âÃû³Æ.±íÃû³Æ to Óû§Ãû@Óû§µØÖ· identified by ¡®Á¬½Ó¿ÚÁ; ȨÏÞ1,ȨÏÞ2,¡È¨ÏÞn´ú±íselect,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,fileµÈ14¸öȨÏÞ¡£µ±È¨ÏÞ1,ȨÏÞ2,¡È¨ÏÞn±»all privileges»òÕßall´úÌ棬±íʾ¸³ÓèÓû§È«²¿È¨ÏÞ¡£ µ±Êý¾Ý¿âÃû³Æ.±íÃû³Æ±»*.*´úÌ棬±íʾ¸³ÓèÓû§²Ù×÷·þÎñÆ÷ÉÏËùÓÐÊý¾Ý¿âËùÓбíµÄȨÏÞ¡£ Óû§µØÖ·¿ÉÒÔÊÇlocalhost£¬Ò²¿ÉÒÔÊÇipµØÖ·¡¢»úÆ÷Ãû×Ö¡¢ÓòÃû¡£Ò²¿ÉÒÔÓá¯%'±íʾ´ÓÈκεØÖ·Á¬½Ó¡£ ¡®Á¬½Ó¿ÚÁ²»ÄÜΪ¿Õ£¬·ñÔò´´½¨Ê§°Ü¡£ ÀýÈ磺 mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ¡®123¡ä; ¸øÀ´×Ô10.163.225.87µÄÓû§joe·ÖÅä¿É¶ÔÊý¾Ý¿âvtdcµÄemployee±í½øÐÐselect,insert,update,delete,create,dropµÈ²Ù×÷µÄȨÏÞ£¬²¢É趨¿ÚÁîΪ123¡£ mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ¡®123¡ä; ¸øÀ´×Ô10.163.225.87µÄÓû§joe·ÖÅä¿É¶ÔÊý¾Ý¿âvtdcËùÓбí½øÐÐËùÓвÙ×÷µÄȨÏÞ£¬²¢É趨¿ÚÁîΪ123¡£ mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ¡®123¡ä; ¸øÀ´×Ô10.163.225.87µÄÓû§joe·ÖÅä¿É¶ÔËùÓÐÊý¾Ý¿âµÄËùÓбí½øÐÐËùÓвÙ×÷µÄȨÏÞ£¬²¢É趨¿ÚÁîΪ123¡£ mysql>grant all privileges on *.* to joe@localhost identified by ¡®123¡ä; ¸ø±¾»úÓû§joe·ÖÅä¿É¶ÔËùÓÐÊý¾Ý¿âµÄËùÓбí½øÐÐËùÓвÙ×÷µÄȨÏÞ£¬²¢É趨¿ÚÁîΪ123¡£mysql>grant all privileges on *.* to joe@"%" identified by ¡®123¡ä; ¸øÓû§joe·ÖÅäÔÚÈκÎÖ÷»úÉϾù¿É¶ÔËùÓÐÊý¾Ý¿âµÄËùÓбí½øÐÐËùÓвÙ×÷µÄȨÏÞ£¬²¢É趨¿ÚÁîΪ123¡£ mysql>GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; ¸øÓû§Ö±½Ó·ÖÅägrantȨÏÞ; ȨÏÞ1,ȨÏÞ2,¡È¨ÏÞn´ú±íselect,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,fileµÈ14¸öȨÏÞ¡£
µ±È¨ÏÞ1,ȨÏÞ2,¡È¨ÏÞn±»all privileges»òÕßall´úÌ棬±íʾ¸³ÓèÓû§È«²¿È¨ÏÞ¡£
µ±Êý¾Ý¿âÃû³Æ.±íÃû³Æ±»*.*´úÌ棬±íʾ¸³ÓèÓû§²Ù×÷·þÎñÆ÷ÉÏËùÓÐÊý¾Ý¿âËùÓбíµÄȨÏÞ¡£
Óû§µØÖ·¿ÉÒÔÊÇlocalhost£¬Ò²¿ÉÒÔÊÇipµØÖ·¡¢»úÆ÷Ãû×Ö¡¢ÓòÃû¡£Ò²¿ÉÒÔÓá¯%'±íʾ´ÓÈκεØÖ·Á¬½Ó¡£
¡®Á¬½Ó¿ÚÁ²»ÄÜΪ¿Õ£¬·ñÔò´´½¨Ê§°Ü¡£
ÓÉMySQLÌṩµÄģʽƥÅäµÄÆäËûÀàÐÍÊÇʹÓÃÀ©Õ¹ÕýÔò±í´ïʽ¡£µ±Äã¶ÔÕâÀàģʽ½øÐÐÆ¥Åä²âÊÔʱ£¬Ê¹ÓÃREGEXPºÍNOT REGEXP²Ù×÷·û(»òRLIKEºÍNOT RLIKE£¬ËüÃÇÊÇͬÒå´Ê)¡£ À©Õ¹ÕýÔò±í´ïʽµÄһЩ×Ö·ûÊÇ£º
“.”Æ¥ÅäÈκε¥¸öµÄ×Ö·û¡£
Ò»¸ö×Ö·ûÀà“[...]”Æ¥ÅäÔÚ·½À¨ºÅÄÚµÄÈκÎ×Ö·û¡£ÀýÈ磬“[abc]”ƥŠ......
±¸×¢£ºÈç¹ûÄãÓÐʱ¼äÄãÓ¦¸ÃÔĶÁÕâ¸ö±¸×¢£¬Èç¹ûûÓÐʱ¼äÄã¸üÒªÔĶÁÒÔϱ¸×¢¡£ ÔÚÍøÂçÉÏÕÒÁ˺ܶàÏà¹Ø±¸·ÝºÍ»¹ÔµÄ½Ì³Ì£¬´ó¶à¶¼ÊÇ»¥Ïà³Ï®£¬°´ÕÕËûÃǵĽ̳ÌÄܹ»³É¹¦±¸·Ý£¬»¹Ô¾ÍºÜÈÃÈ˾¾ÐÄÁË¡£Ì¸Ì¸Ë¼Â·ºÍ×¢Òâµã°É¡£ Ê×ÏÈ£¬µÚÒ»²½²»ÓÃ˵£¬¿Ï¶¨ÊDZ¸·ÝÊý¾Ý¿â¡£×î¼òµ¥£¬´ò¿ª¹ÜÀí½ÚµãµÄndb_mgm¿ØÖÆ̨£¬ÊäÈëstart backup backupID£¨ ......