Mysql »ù±¾µÄ³£ÓÃÃüÁî
ÓкܶàÅóÓÑËäÈ»°²×°ºÃÁË MySQL µ«È´²»ÖªÈçºÎʹÓÃËü¡£ÔÚÕâƪÎÄÕÂÖÐÎÒÃǾʹÓÁ¬½Ó MySQL¡¢ÐÞ¸ÄÃÜÂë¡¢Ôö¼ÓÓû§µÈ·½ÃæÀ´Ñ§Ï°Ò»Ð© MySQL µÄ³£ÓÃÃüÁî¡£
Ò»¡¢Á¬½ÓMySQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
¡¡¡¡Ê×ÏÈÔÚ´ò¿ª DOS ´°¿Ú£¬È»ºó½øÈëĿ¼ mysql\bin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃ MySQL£¬³¬¼¶Óû§ root ÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½ MySQL ÖÐÁË£¬MySQL µÄÌáʾ·ûÊÇ£ºmysql>
2¡¢Àý2£ºÁ¬½Óµ½Ô¶³ÌÖ÷»úÉ쵀 MySQL¡£
¡¡¡¡¼ÙÉèÔ¶³ÌÖ÷»úµÄIPΪ£º110.110.110.110£¬Óû§ÃûΪroot£¬ÃÜÂëΪabcd123¡£Ôò¼üÈëÒÔÏÂÃüÁ
mysql -h110.110.110.110 -uroot -pabcd123
£¨×¢:uÓëroot¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
3¡¢Í˳ö MySQL ÃüÁ exit £¨»Ø³µ£©
¶þ¡¢ÐÞ¸ÄÃÜÂë¡£
¸ñʽ£ºmysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
1¡¢Àý1£º¸øroot¼Ó¸öÃÜÂëab12¡£Ê×ÏÈÔÚDOSϽøÈëĿ¼mysqlbin£¬È»ºó¼üÈëÒÔÏÂÃüÁî
mysqladmin -uroot -password ab12
×¢£ºÒòΪ¿ªÊ¼Ê±rootûÓÐÃÜÂ룬ËùÒÔ-p¾ÉÃÜÂëÒ»Ïî¾Í¿ÉÒÔÊ¡ÂÔÁË¡£
2¡¢Àý2£ºÔÙ½«rootµÄÃÜÂë¸ÄΪdjg345¡£
mysqladmin -uroot -pab12 password djg345
Èý¡¢Ôö¼ÓÐÂÓû§¡£
£¨×¢Ò⣺ºÍÉÏÃ治ͬ£¬ÏÂÃæµÄÒòΪÊÇ MySQL »·¾³ÖеÄÃüÁËùÒÔºóÃ涼´øÒ»¸ö·ÖºÅ×÷ΪÃüÁî½áÊø·û£©
¸ñʽ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë"
Àý1¡¢Ôö¼ÓÒ»¸öÓû§ test1 ÃÜÂëΪ abc£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔ root Óû§Á¬Èë MySQL£¬È»ºó¼üÈëÒÔÏÂÃüÁ
grant select, insert, update, delete on *.* to test1@"%" Identified by "abc";
µ«Àý1Ôö¼ÓµÄÓû§ÊÇÊ®·ÖΣÏյģ¬ÄãÏëÈçij¸öÈËÖªµÀtest1µÄÃÜÂ룬ÄÇôËû¾Í¿ÉÒÔÔÚinternetÉϵÄÈκÎһ̨µçÄÔÉϵǼÄãµÄmysqlÊý¾Ý¿â²¢¶ÔÄãµÄÊý¾Ý¿ÉÒÔΪËùÓûΪÁË£¬½â¾ö°ì·¨¼ûÀý2¡£
Àý2¡¢Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃËûÖ»¿ÉÒÔÔÚlocalhostÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿â mydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØÖ÷»ú£¬¼´MYSQLÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ËûÒ²ÎÞ·¨´ÓinternetÉÏÖ±½Ó·ÃÎÊÊý¾Ý¿â£¬Ö»ÄÜͨ¹ýMYSQLÖ÷»úÉϵÄwebÒ³À´·ÃÎÊÁË¡£
grant select, insert, update,delete on mydb.* to test2@localhost identified by "abc";
¡¡¡¡Èç¹ûÄã²»Ïëtest2ÓÐÃÜÂ룬¿ÉÒÔÔÙ´òÒ»¸öÃü
Ïà¹ØÎĵµ£º
>>mysql:
1¡¢²é¿´ËùÓбíÃû£º
show tables [from db_name];
2¡¢²é¿´×Ö¶ÎÐÅÏ¢
SHOW FULL COLUMNS from db_name.table_name
»ñÈ¡ÒÔÏÂÐÅÏ¢
Field £º×Ö¶ÎÃû
Type£º×Ö¶ÎÀàÐÍ
Collation£º×Ö·û¼¯ £¨mysql 5.0ÒÔÉÏÓУ©
Null £ºÊÇ·ñ¿ÉÒÔΪNULL
Key£ºË÷Òý£¨PRI,unique,index)
Default£ºÈ±Ê¡Öµ
Extra£º¶îÍ⣨ÊÇ·ñ aut ......
Love in coding...
Free and Susan
[Òý]MySQL INNODBÀàÐͱíµÄÍâ¼ü¹ØÁªÉèÖÃ
Here is a simple example that relates parent and child tables through a single-column foreign key:
CREATE TABLE parent (id INT NOT NULL,
......
MySQL·þÎñÆ÷²ÉÓÃÁËÄ£¿é»¯·ç¸ñ£¬¸÷²¿·ÖÖ®¼ä±£³ÖÏà¶Ô¶ÀÁ¢£¬ÓÈÆäÌåÏÖÔÚ´æ´¢¼Ü¹¹ÉÏ¡£´æ´¢ÒýÇ渺Ôð
¹ÜÀíÊý¾Ý´æ´¢£¬ÒÔ¼°MySQLµÄË÷Òý¹ÜÀí¡£Í¨¹ý¶¨ÒåµÄAPI£¬MySQL·þÎñÆ÷Äܹ»Óë´æ´¢ÒýÇæ½øÐÐͨÐÅ¡£Ä¿Ç°Ê¹ÓÃ×î¶àµÄÊÇMyISAMºÍInnoDB¡£
InnoDB±»OracleÊÕ¹ººó£¬MySQL×ÔÐпª·¢µÄд洢ÒýÇæFalcon½«ÔÚMySQL6.0°æ±¾Òý½ø¡£
MyISAMÒýÇæÊÇÒ ......
GROUP_CONCAT ÊÇÒ»¸öºÏ²¢¶àÐеĺ¯Êý£¬Ò»°ãÓõÄÉÙ£¬ËùÒԺܶàÈ˶¼²»ÖªµÀ£¬ÎÒÒ²ÊÇÒ»¸ö£¬½ñÌìżȻ¿´µ½£¬¹Ê¼ÇÏ·½·¨£»
GROUP_CONCATµÄÓï·¨ÈçÏ£º
GROUP_CONCAT([DISTINCT] expr [,expr ...][ORDER BY {unsigned_integer | col_name | expr}[ASC | DESC] [,col_name ...]][SEPARATOR str_val])
ÏÂÃæÑÝʾһÏÂÕâ¸öº¯Êý£¬ÏȽ¨Á¢Ò ......
¼ÇµÃÇ°ÌìÓÐÈËÎÊÎÒ£¬ Memcache ºÍ MySQL ×Ô¼ºµÄ Query Cache ÓÐɶÇø±ð? ÎÒÕâÑù»Ø´ðµÄ£¬Ç°ÕßÊÇɽկÖеÄÕ½¶·»ú£¬ºóÕßÊǹٷ½µÄÕ½¶·»ú¡£
ÐÂÊֻشðÎÊÌ⣬´íÁËĪ¹Ö¡£¹þ¹þ¹þ¡£
ºÃÏñϸ½ÚÉϵIJî±ð»¹ÊÇÓеġ£
MemcacheÓŵãÈçÏ£º
1. ÀíÂÛÉÏ¿ÉÒÔÖ§³ÅÎÞÏÞ²¢·¢ÒµÎñ²Ù×÷¡£
2. ¿ÉÒÔÆôÓõ¥¶ÀµÄʵÀýÀ´»º´æ¾Þ¶àµÄÊý¾Ý¡££¨µ± ......