mysql ѧϰ
truncate table Çå¿Õ±í£¬ºÍdeleteÏàËÆ£¬µ«ÊÇÔÚ±í·Ç³£´óµÄʱºò£¬ËüÊÇÖð²½Êͷŵġ£
insert Èç¹ûÔÚ²åÈëʱ£¬Ä³¸ö×ֶδæÔÚ£¬ÎÒÏë¸üпÉÒÔͨ¹ý insert into tablename values() on duplicate key update id=id+1;
insert into tablename values(default) ĬÈÏ×ÔÔö³¤
select last_insert_id() È¡×îºó²åÈëÒ»Ìõ¡£
Ïà¹ØÎĵµ£º
¹ØÓÚMYSQLµÄshow status½âÏê
SHOW STATUSÌṩ·þÎñÆ÷µÄ״̬ÐÅÏ¢(Ïómysqladmin extended-statusÒ»Ñù)¡£Êä³öÀàËÆÓÚÏÂÃæµÄÏÔʾ£¬¾¡¹Ü¸ñʽºÍÊý×Ö¿ÉÒÔÓе㲻ͬ£º
+--------------------------+--------+
| Variable_name | Value |
+--------------------------+--------+
| Aborted_clients | 0 |
| Aborted_connect ......
1.ÆÕͨlog
¼Ç¼ËùÓÐsql²Ù×÷£¬°üÀ¨select£¬showÓï¾ä¡£
ÉèÖÃ
ĬÈÏÊDz»´ò¿ª´Ëlog¡£
´ò¿ªÊ±¿ÉÒÔÖ¸¶¨Ä¿Â¼£¬²»Ö¸¶¨Ê±±£´æÔÚÊý¾Ý¿â¼Ŀ¼Ï¡£
[mysqld]
log = /data/logs/mysql.log #´Ë·½Ê½ÎªÖ¸¶¨Îļþ
log = 1 ......
ÔÎÄÁ´½Ó http://database.51cto.com/art/200904/117957.htm
ÒÔÏÂÊÇÉæ¼°µ½²åÈë±í¸ñµÄ²éѯµÄ5ÖָĽø·½·¨£º
1)ʹÓÃLOAD DATA INFILE´ÓÎı¾ÏÂÔØÊý¾ÝÕ⽫±ÈʹÓòåÈëÓï¾ä¿ì20±¶¡£
2)ʹÓôøÓжà¸öVALUESÁбíµÄINSERTÓï¾äÒ»´Î²åÈ뼸ÐÐÕ⽫±ÈʹÓÃÒ»¸öµ¥ÐвåÈëÓï¾ä¿ì¼¸±¶¡£µ÷Õûbulk_insert_buffer_size±äÁ¿Ò²ÄÜÌá¸ß£¨Ïò°üº¬Ðеıí ......
mysqlÔÚsdkÖÐΪcÓïÑÔÌṩÁËһЩ·ÃÎʽӿڣ¬ÎÒÃÇ¿ÉÒÔʹÓÃÕâЩ½Ó¿ÚÁ¬½Ó²¢·ÃÎÊmysqlÊý¾Ý¿â£¬µ±È»Ò²¿ÉÒÔµ÷ÓÃmysqlµÄ´æ´¢¹ý³Ì¡£
Àý×Ó£º
Ê×ÏÈÏÂÔØmysqlµÄsdk£¬½âѹºÃÒÔºó£¬ÀïÃæ°üº¬Ò»¸öinclude,ºÍlibÎļþ¼Ð¡£ÎÒÃÇÔÚ×Ô¼ºµÄ¹¤³ÌÖаüº¬ÕâÁ½¸öÎļþ¼ÐµÄĿ¼£¬²¢Ç ......