Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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+phpÎÞ·¨Á¬½Ósql£¨Òѽâ¾ö£©

¸ãÁ˺ܾᣡ£ÖÕÓÚ·¢ÏÖÔ­À´ÊÇȨÏÞÎÊÌâ¡£¡£
2ÐÐÃüÁî¸ã¶¨
grant all privileges on rogue.* to admin@localhost identified by 'admin' with grant option
grant all privileges on rogue.* to admin@'%' identified by 'admin' with grant option
¾­µäÁË¡£¡£¡£
ħÁ¦Ë½·þÍøÒ³¶Ë¸ã¶¨¿©~~ ......

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

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

mySqlÖÐÈçºÎÅúÁ¿¸üмÆÊýÆ÷


¼ÙÈçÎÒÃǵÄmysqlÓÐÒ»¸ö¼ÆÊýÆ÷£¬¶øÕâ¸ö¼ÆÊýÆ÷ÐèÒªÎÒÃÇÖØÐÂͳ¼Æ£¬Ôõô°ìÄØ£¿
Ó¦Óó¡¾°£¬±ÈÈç˵ÓÐÒ»¸öÉ̳¡£¬Ã¿ÂôÒ»¸ö²úÆ·¶¼²úÉúÒ»¸öÁ÷Ë®£¬È»ºóÎÒÃÇÐèÒªÖªµÀÿ±ÊÁ÷Ë®ÊǸòúÆ·µÚ¼¸´Î³öÊ۵ģ¬ÕâÑù˵¿ÉÄܲ»Ã÷°×£¬ÎÒÄÃÒ»¸öÏêϸµÄÊý¾Ý
¾ÙÀý°É¡£
recordID,productID,productType,sellDate,counter
1, 1, 1, '2010-1-15 15:20:10 ......

MySQLµ¼³öºÍµ¼ÈëSQL½Å±¾

MySQLµ¼³öºÍµ¼ÈëSQL½Å±¾
µ¼³ösql½Å±¾£º
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > ´æ·ÅλÖÃ
mysqljump -u root -p test > c:\a.sql
µ¼Èësql½Å±¾£º
Òª½¨»·¾³±äÁ¿»òÕßÔÚbinµÄĿ¼Ï£¬mysqlÕâ¸öÃüÁî²ÅÄÜʶ±ð¡£
testÊÇÄãÒªµ¼½øÈ¥µÄÊý¾Ý¿âÃû×Ö£¬ÒªÌáÇ°½¨ºÃ~~
mysql -u Óû§Ãû -p Êý¾Ý¿âÃû < ´æ·ÅλÖÃ
mysqljump -u ro ......

mysql ÅäÖÃÎļþ

mysqlµÄÅäÖÃÎļþͨ³£ÃüÃûΪmy.cnf,Èç¹û±£´æÔÚĬÈϵÄ/etc/my.cnfĿ¼ÏÂ,ÄÇôÕâÀïÃæµÄÅäÖÃÊÇÈ«¾ÖµÄ,¼È¶Ô´Ë·þÎñÆ÷ÉϵÄËùÓÐmysql·þÎñÆ÷¶¼ÊÇÓÐЧµÄ(Èç¹ûÄãÓÐÔÚЩ·þÎñÆ÷ÉÏ°²×°Á˶à¸ömysql).Èç¹ûÖ»ÊDZ£´æÔÚij¸ömysql·þÎñÆ÷µÄÊý¾ÝĿ¼ÏÂ,ÔòÖ»¶Ô¸Ãmysql·þÎñÆ÷²úÉú×÷ÓÃ.Èç¹ûÊDZ£´æÔÚij¸öÓû§(µ±È»ÊÇmysqlÓû§)µÄhomeĿ¼ÏÂ,ÔòÖ»ÊÇÔÚmy ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ