Ô¶³Ì²»ÄÜÁ¬½Ó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 3.23.44°æ±¾ºó£¬InnoDBÒýÇæÀàÐ͵ıíÖ§³ÖÁËÍâ¼üÔ¼Êø¡£
Íâ¼üµÄʹÓÃÌõ¼þ£º
1.Á½¸ö±í±ØÐëÊÇ
InnoDB±í£¬MyISAM±íÔÝʱ²»Ö§³ÖÍâ¼ü£¨¾Ý˵ÒÔºóµÄ°æ±¾ÓпÉÄÜÖ§³Ö£¬µ«ÖÁÉÙÄ¿Ç°²»Ö§³Ö£©£»
2.Íâ¼üÁбØÐ뽨Á¢ÁËË÷Òý£¬MySQL
4.1.2ÒÔºóµÄ°æ±¾ÔÚ½¨Á¢Íâ¼üʱ»á×Ô¶¯´´½¨Ë÷Òý£¬µ«Èç¹ûÔÚ½ÏÔçµÄ°æ±¾ÔòÐèÒªÏÔʾ½¨Á¢£»
3.Íâ¼ü¹Øϵµ ......
×î½üÒòΪÍüÁËmysqlµÄrootÃÜÂ룬ÉÏÍøGoogleһϣ¬ÏÖÔڰѲ½Öè¼Çһϣ¬·ÀÖ¹ÒÔºóÍüÁË¡£
ÎÒÓõÄÊÇxamppÈí¼þ°ü¡£
1. ֹͣmysql
2. ´ò¿ªcmd£¬Çл»Ä¿Â¼µ½ \xampp\mysql\bin, ÔËÐÐ
mysqld -skip-grant-tables
ÕâÌõÃüÁîÊÇÌø¹ýȨÏÞ¼ì²éÆô¶¯mysql·þÎñ
3. ´ò¿ªÁíÒ»¸öcmd£¬Í¬ÑùÇл»Ä¿ ......
×òÌìÓöµ½Ò»¸öÎÊÌâ:
ÔÚÒ»ÕÅÓÐÈýÊ®ÍòÌõ¼Í¼µÄÊý¾Ý±íA£¬ÆäÖ÷¼ü×ÔÔö×Ö¶Îid£¬name×ֶΣ¨varchar)£¬»¹ÓÐtype_id£¨int)£¬ÔÚname×Ö¶ÎÉÏÒѾÌí¼ÓÁËË÷Òý¡£type_idÓÉÓÚÊÇÕûÐÍ×ֶΣ¬ÈÏΪ¼ÓË÷ÒýûÓÐÌ«¶àµÄÒâÒ壬ËùÒÔûÓмÓË÷Òý¡£
±¾´ÎÓÐÒ»¸öÐèÇóÊÇÔÚÒ»¸öÑ»·Öа´type_id²éѯ´Ë±íA£¬½á¹ûÒ»Ö´ÐдËÑ»·£¬mySQLÁ¢¿ÌÕ¼ÓÃCPUµ½200%ÒÔÉÏ£¬µ¼ ......
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°æ±¾£º ......