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

Ô¶³Ì²»ÄÜÁ¬½Ómysql½â¾ö·½·¨

Ô¶³ÌÁ¬½ÓÁíһ̨µçÄÔµÄmysqlµÄÊý¾Ý¿âʱ£¬Èç¹ûÁ¬½Ó²»ÉÏ£¬Õâʱºò¾ÍÒªÔÚ±»Á¬½ÓµÄµçÄÔÉÏÖ´ÐÐÒÔÏÂÃüÁ
Ô­Òò£ºÊÇûÓиøµÇ¼Óû§ÃûÉèÖÃÔ¶³ÌÖ÷»úµÇ¼µÄȨÏÞ
1¡£µÇ¼mysql  £º
Ö´ÐУºmysql -u root -p
2¡£ÐÞ¸Ä MySQL Êý¾Ý¿âÖÐ user ±íÖÐ ¶ÔÓ¦Óû§ÃûµÄ Host ×ֶΣ¬½« localhost ¸ÄΪ %
Ö´ÐУºuse mysql;
ÔÙÖ´ÐУºupdate user set Host = '%' where User = 'username';
È»ºóÖØÆô£ºsudo /etc/init.d/mysql restart
ÕâÑù¾Í¿ÉÒÔÁË


Ïà¹ØÎĵµ£º

MYSQLÍâ¼ü(Foreign Key)µÄʹÓÃ


ÔÚMySQL 3.23.44°æ±¾ºó£¬InnoDBÒýÇæÀàÐ͵ıíÖ§³ÖÁËÍâ¼üÔ¼Êø¡£
Íâ¼üµÄʹÓÃÌõ¼þ£º
1.Á½¸ö±í±ØÐëÊÇ
InnoDB±í£¬MyISAM±íÔÝʱ²»Ö§³ÖÍâ¼ü£¨¾Ý˵ÒÔºóµÄ°æ±¾ÓпÉÄÜÖ§³Ö£¬µ«ÖÁÉÙÄ¿Ç°²»Ö§³Ö£©£»
2.Íâ¼üÁбØÐ뽨Á¢ÁËË÷Òý£¬MySQL
4.1.2ÒÔºóµÄ°æ±¾ÔÚ½¨Á¢Íâ¼üʱ»á×Ô¶¯´´½¨Ë÷Òý£¬µ«Èç¹ûÔÚ½ÏÔçµÄ°æ±¾ÔòÐèÒªÏÔʾ½¨Á¢£»
3.Íâ¼ü¹Øϵµ ......

windowsÏÂÖØÉèmysqlµÄrootÃÜÂë

  ×î½üÒòΪÍüÁËmysqlµÄrootÃÜÂ룬ÉÏÍøGoogleһϣ¬ÏÖÔڰѲ½Öè¼Çһϣ¬·ÀÖ¹ÒÔºóÍüÁË¡£
ÎÒÓõÄÊÇxamppÈí¼þ°ü¡£
1.  Í£Ö¹mysql
2.  ´ò¿ªcmd£¬Çл»Ä¿Â¼µ½ \xampp\mysql\bin, ÔËÐÐ
   mysqld -skip-grant-tables
   ÕâÌõÃüÁîÊÇÌø¹ýȨÏÞ¼ì²éÆô¶¯mysql·þÎñ
3. ´ò¿ªÁíÒ»¸öcmd£¬Í¬ÑùÇл»Ä¿ ......

¸ømysqlÊý¾Ý±í¼ÓË÷ÒýµÄÒ»´Î¾­ÑéÓëÌå»á.


×òÌìÓöµ½Ò»¸öÎÊÌâ:
ÔÚÒ»ÕÅÓÐÈýÊ®ÍòÌõ¼Í¼µÄÊý¾Ý±íA£¬ÆäÖ÷¼ü×ÔÔö×Ö¶Îid£¬name×ֶΣ¨varchar)£¬»¹ÓÐtype_id£¨int)£¬ÔÚname×Ö¶ÎÉÏÒѾ­Ìí¼ÓÁËË÷Òý¡£type_idÓÉÓÚÊÇÕûÐÍ×ֶΣ¬ÈÏΪ¼ÓË÷ÒýûÓÐÌ«¶àµÄÒâÒ壬ËùÒÔûÓмÓË÷Òý¡£
±¾´ÎÓÐÒ»¸öÐèÇóÊÇÔÚÒ»¸öÑ­»·Öа´type_id²éѯ´Ë±íA£¬½á¹ûÒ»Ö´ÐдËÑ­»·£¬mySQLÁ¢¿ÌÕ¼ÓÃCPUµ½200%ÒÔÉÏ£¬µ¼ ......

MySQL count(*) Óë count(col) ²éѯЧÂʱȽÏ

MySQL count(*) Óë count(col) ²éѯЧÂʱȽÏ
ÓÅ»¯×ܽ᣺
1.ÈκÎÇé¿öÏÂSELECT COUNT(*) from xxx ÊÇ×îÓÅÑ¡Ôñ£»
2.¾¡Á¿¼õÉÙSELECT
COUNT(*) from xxx WHERE COL = ‘xxx’ ÕâÖÖ²éѯ£»
3.¶Å¾øSELECT COUNT(COL) from tablename WHERE COL = ‘xxx’
µÄ³öÏÖ¡£(ÆäÖÐCOL·ÇÖ÷¼ü)
»·¾³£º
MySQL°æ±¾£º ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ