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

MySQLÓû§Ìí¼ÓºÍ·ÖÅäȨÏÞ

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ÌØÓеÄtipÀ´Ð´²éѯ

http://immike.net/blog/2007/04/09/how-not-to-optimize-a-mysql-query/
ÕâƪÎÄÕ½¨Ò飺
£¨1£©²»ÒªÊ¹ÓÃһЩmysqlµÄtip£¬È磺SQL_SMALL_RESULT, HIGH/LOW_PRIORITY, and INSERT DELAYED£¬STRAIGHT_JOIN£¬³ý·ÇûÓÐÆäËû·½·¨£¬ÒòΪÕâÑùʧȥÁËSQLµÄ¿ÉÒÆÖ²ÐÔ
£¨2£©Êʵ±¶Ô±í½øÐÐË÷Òý
£¨3£©±ÜÃâ¶Ô²»±ØÒªÊý¾ÝµÄ²éѯ
£¨4£©´¦Àí× ......

MYSQL 8Сʱ¶Ï¿ªÁ´½ÓÎÊÌâºÍ½â¾ö°ì·¨

MYSQL 8Сʱ ¶Ï¿ªÁ´½ÓÎÊÌâ
½â¾ö°ì·¨ÓÐÁ½¸ö£ºµÚÒ»ÊÇÉèÖÃautoReconnectÊôÐÔÉèÖÃΪtrue£»µÚ¶þÊÇÉèÖÃDBCP ʱ½«testqueryµÈ¼¸¸öÊôÐÔÒ»²¢ÉèÖá£
ÎÊÌâµÄÔ­ÒòÊÇ£¬MySQLµÄ²ÎÊýinteractive_timeout£¬Ò²¾ÍÊǽ»»¥³¬Ê±Ê±¼äĬÈÏΪ8Сʱ¡£Ò²¾ÍÊÇÈç¹ûÒ»¸öÁ´½ÓÔÚ8Сʱºó£¬»¹Ã»ÓкͷþÎñÆ÷½»»¥£¬Õâ¸öÁ¬½Ó¾Í»á±»MySQL·þÎñÆ÷¶Ï¿ª¡£ÒòΪMySQLÄÜ ......

mysqlÕýÔò±í´ïʽ LIKE ͨÅä·û

ÓÉMySQLÌṩµÄģʽƥÅäµÄÆäËûÀàÐÍÊÇʹÓÃÀ©Õ¹ÕýÔò±í´ïʽ¡£µ±Äã¶ÔÕâÀàģʽ½øÐÐÆ¥Åä²âÊÔʱ£¬Ê¹ÓÃREGEXPºÍNOT REGEXP²Ù×÷·û(»òRLIKEºÍNOT RLIKE£¬ËüÃÇÊÇͬÒå´Ê)¡£ À©Õ¹ÕýÔò±í´ïʽµÄһЩ×Ö·ûÊÇ£º
“.”Æ¥ÅäÈκε¥¸öµÄ×Ö·û¡£
Ò»¸ö×Ö·ûÀà“[...]”Æ¥ÅäÔÚ·½À¨ºÅÄÚµÄÈκÎ×Ö·û¡£ÀýÈ磬“[abc]”ƥŠ......

Mysql Explain Ïê½â

Òý×Ô http://www.itpub.net/thread-1034410-1-1.html
Mysql Explain Ïê½â
Ò».Óï·¨
explain < table_name >
ÀýÈç: explain select * from t3 where id=3952602;
¶þ.explainÊä³ö½âÊÍ
+----+-------------+-------+-------+-------------------+---------+---------+-------+------+-------+
| id | select_type ......

MySQL cluster±¸·Ý»Ö¸´

±¸×¢£ºÈç¹ûÄãÓÐʱ¼äÄãÓ¦¸ÃÔĶÁÕâ¸ö±¸×¢£¬Èç¹ûûÓÐʱ¼äÄã¸üÒªÔĶÁÒÔϱ¸×¢¡£ ÔÚÍøÂçÉÏÕÒÁ˺ܶàÏà¹Ø±¸·ÝºÍ»¹Ô­µÄ½Ì³Ì£¬´ó¶à¶¼ÊÇ»¥Ïà³­Ï®£¬°´ÕÕËûÃǵĽ̳ÌÄܹ»³É¹¦±¸·Ý£¬»¹Ô­¾ÍºÜÈÃÈ˾¾ÐÄÁË¡£Ì¸Ì¸Ë¼Â·ºÍ×¢Òâµã°É¡£ Ê×ÏÈ£¬µÚÒ»²½²»ÓÃ˵£¬¿Ï¶¨ÊDZ¸·ÝÊý¾Ý¿â¡£×î¼òµ¥£¬´ò¿ª¹ÜÀí½ÚµãµÄndb_mgm¿ØÖÆ̨£¬ÊäÈëstart backup backupID£¨ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ