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

¿ªÊ¼ÊÕ¼¯mysqlµÄ¸÷ÖÖÃüÁî

  ÕâÀïÊÕ¼¯¸÷ÖÖMysqlµÄ»ù´¡ÖªÊ¶,ΪÁËijЩ³¡ºÏµÄÐèÒª,»¹ÊÇÉáÆúnavicatÖ®ÀàµÄ¹¤¾ß¹Ô¹ÔÓÃÃüÁîÐаɠ  
£¨×¢ÒâÓеÄÃüÁîÐèÒª·ÖºÅÓеIJ»ÐèÒª)
Ò».»ù±¾²Ù×÷
  1.µÇ¼
     mysql -u Óû§Ãû -pÃÜÂë Êý¾Ý¿âÃû
         ÕâÀïÐèҪעÒâµÄÊÇ-uÓû§ÃûÖ®¼ä¿ÉÒÔÓпոñ,¶ø-pÃÜÂëÖ®¼ä¾ö²»ÄÜÓпոñ,Äã¿ÉÒÔ²»ÌîÃÜÂë,µ±È»Óû§ÃûÄãÒ²¿ÉÒÔ²»Ìî,µ«ÊÇ»áÒÔ¿ÕµÄÓÃ
     »§ÃûÀ´µÇ¼,È»ºó²Ù×÷Êý¾Ý¿âµÄʱºò»áÓкܶàÏÞÖÆ,ÖîÈçÖ®ÀàµÄAccess denied for user ''@'localhost' to database´íÎó.
         »¹ÓÐ,²»ÒªÔÚºóÃæ¼Ó·ÖºÅ;
  2.´´½¨Óû§
     grant ȨÏÞ on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë";
          ÕâÀï×¢ÒâµÄÊÇÒ»¶¨ÒªÊÇ×îºÜ¸ßȨÏÞµÄÓû§²Å¿ÉÒÔ²Ù×÷,Ò»°ã¾ÍÊÇroot,²»ÏÓÂé·³µÄ»°Ò²¿ÉÒÔÖ±½ÓÇÐÈëmysqlÕâ¸öÊý¾Ý¿â°ÑÊý¾ÝÌí¼Ó½ø
       user±íÀï.ÕâÀï¸ø¸öÀý×Ó:grant select,insert,update,delete on *.* to Rye@loaclhost Identified by "1234"
          Èç¹ûÏ£Íû¸ÃÓû§Äܹ»ÔÚÈκλúÆ÷Éϵǽmysql£¬Ôò½«localhost¸ÄΪ"%".
  3.´´½¨³¬¼¶Óû§
     grant all privileges on *.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë" with grant options; 
  4.ÐÞ¸ÄÓû§
     ÃüÁîÓëÉÏÃæÒ»Ñù,¿ÉÒÔÐÞ¸ÄȨÏÞºÍÃÜÂë
  5.ÐÞ¸Äroot ÃÜÂë
     Õâ¸öʱºòÒªÔÚδµÇ¼µÄ״̬ÏÂ(Ò²¾ÍÊÇÏÈexitÍ˳ö)ʹÓÃÃüÁî mysqladmin -u Óû§Ãû -pÃÜÂë password ÐÂÃÜÂë
  6.¹Ø±ÕÆô¶¯
     net stop mysql  (δµÇ¼״̬ÏÂ) ¹Ø±Õmysql
     net start mysql  (δµÇ¼״̬ÏÂ) ¿ªÆômysql
  7.Í˳ömysql
     quite»òÕßexit 
¶þ.²Ù×÷Êý¾Ý¿â
  1.show databases;            ÏÔʾ¿É¹©²Ù×÷µÄÊý¾Ý¿â£¬ÓÐʱºòÄã»á·¢ÏÖ²¢Ã»ÓÐÏÔʾȫÃæ,ÄÇÊÇÒòΪȨÏÞ²»¹»¡£
  2.use Êý¾Ý¿âÃû;  &nb


Ïà¹ØÎĵµ£º

JAVAºÍPHP»ñÈ¡mysql×îºó²åÈëµÄ×ÔÔöidÖµ

phpºÍjavaͨÓÃsqlÓï¾ä·¨
SELECT max(id) from table
¸Ã·½·¨ÔÚ¶àÏ̵߳ÈÇé¿öÏ¿ÉÄÜ»áÔì³É²»ÕýÈ·¡£
javaÈýÖÖ·½·¨
1¡¢¸ù¾ÝpsµÄgetGeneratedKeys
PreparedStatement ps = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS); //ºìÉ«Êǹؼü
ps.executeUpdate(); //Ö´Ðкó
ResultSet rs = ps.getGeneratedKeys ......

mysql µÄ ÄÚ´æ±íºÍÁÙʱ±í

1 ÄÚ´æ±íµÄ±í»ú¹¹»¹ÊÇÔÚÊý¾Ý¿âÖеģ¬Ö»ÊÇÊý¾Ýʱ·ÅÔÚÄÚ´æÖеġ£
2 ÄÚ´æ±íÖв»¿ÉÒÔʹÓÃTEXTºÍBLOBÀàÐ͵Ä×ֶΡ£
3 ÄÚ´æ±í¿ÉÒÔͨ¹ýmax_heap_table_size = 2048MÀ´¼Ó´óʹÓõÄÄÚ´æ¡£
1 ÁÙʱ±íµÄ±í»ú¹¹ºÍÊý¾Ý¶¼ÊÇ·ÅÔÚÄÚ´æÖеÄ
¾ßÌå¼ûÏ£º
ÄÚ´æ±íʹÓùþϣɢÁÐË÷Òý°ÑÊý¾Ý±£´æÔÚÄÚ´æÖУ¬Òò´Ë¾ßÓм«¿ìµÄËٶȣ¬Êʺϻº´æÖÐСÐÍÊý¾Ý¿ ......

MySQL .frm .myd .myi Îļþ ¼°Êý¾Ý¿â±¾µØÒÆÖ²

     ½ñÌìÔÚʵ¼Ê¿ª·¢ÖжÔÓÚMySQLÊý¾Ý¿â½øÐÐÒÆÖ²·¢ÉúµÄÎÊÌâÀ´ËµÏÂ. ¿ªÊ¼°Ñ±¾µØdataÖеÄÊý¾Ý¿âÎļþ¿½±´µ½Áíһ̨»ú×ÓÉÏTest, Ö´ÐÐshow tables ; ¿ÉÒÔ¿´µ½Êý¾Ý¿â±í,µ«ÊǶԱí½øÐÐÈκβÙ×÷¶¼±¨´í: ±í²»´æÔÚ , Ô­ÒÔΪMysqlµÄÊý¾Ý¿âÎļþ(.frm)Copy->stickµ½±¾µØ°²×°MySQLDBĿ¼µÄdataÎļþ¼ÐϾͿÉÒÔ.ÊÂʵ²»Ê ......

mysql+php


php£«mysqlÔúʵ¸öÈË»ù±¾¹¦
Ò». 10¾ä»°
1.²»ÒªÒÀÀµregister_global=ONµÄ»·¾³£¬´ÓÄã¸Õ¶®µÃÅäÖÃphpÔËÐл·¾³ÉõÖÁÉв»Ã÷°×register_globalµÄON/OFF»á¶Ô×Ô¼ºÓÐʲôӰÏìµÄÄÇÌìÆ𣬾ÍÓ¦¸ÃÓ¸ҵذÑËüÉèΪOFF.
2.д³ÌÐòÇ°¿´¿´ÔõôÓÃerror_reporting.
3.²»¶®¾ÍÎʱ¾Éíû´í£¬µ«ÄãÐèÒªÔÚÄÇ֮ǰ²é²éÊֲᡣ
4.µ±È»£¬ÄãÐèÒª¶®µÃʹÓÃÊÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ