mysqlµÄslow queryÖеÄÒ»¸öÏÖÏó
ÔÚmysqlµÄslow query logÖУ¬¿ÉÄÜ´æÔÚÀàËÆÕâÑùµÄÌØÊâ¼Ç¼£º
# Time: 100127 23:17:01
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 18446744073709.351562 Lock_time: 0.000129 Rows_sent: 1 Rows_examined: 11030
SET timestamp=1264663021;
SELECT dummy.id AS dummy_id
from dummy
WHERE dummy.id = 1;
×¢Òâµ½ÆäÖÐQuery_time·Ç³£´ó£¨18446744073709.351562£©£¬³öÏÖÕâÖÖÏÖÏóµÄÔÒò¿ÉÄÜÊÇmysql·þÎñÆ÷»á¶¨Ê±´Ótime serverУ׼ʱ¼ä£¬¶ø²éѯǡºÃÔÚУ׼ʱ¼äʱ½øÐУ¬ÓÚÊÇQuery_time³ÉÁ˸ºÊý¡£¶ÔÓÚ32λϵͳ£¬¿ÉÄÜÊÇ4294967296×óÓÒµÄÒ»¸öÖµ£¬¶ø¶ÔÓÚ64λϵͳ£¬ÔòÊÇ18446744073709551616×óÓÒµÄÒ»¸öÖµ¡£
Ïà¹ØÎĵµ£º
1.mysqlÊÇÒ»¸ö·Ç³£·½±ãµÄ¹ÜÀímysql·þÎñÆ÷µÄ¿Í»§¶ËÈí¼þ¡£ ´´½¨Ò»¸ömysql·þÎñÆ÷µÄÁ¬½ÓµÄʱºòÓ¦¸Ã×¢ÒâÌîдÐÅÏ¢µÄʱºòÏÈÔÚ×¢²áÀ¸ÌîдµÇ½Óû§ÃûºÍÃÜÂ룬ÔÙÔÚÁ¬½ÓÀ¸Ìîд·þÎñÆ÷Ãû£¬¶Ë¿ÚºÅ¡£
2.ʹÓÃmysql-frontµÄʱºò£¬½¨Á¢Ò»¸öµÇ½ÊôÐÔÒÔºó£¬ÔÙÔÚÃüÁîÐвÙ×÷mysqlÊý¾Ý¿â£¬mysql-frontµÄÊý¾ÝÐèÒªÊÖ¶¯Í¬²½²Å¿ÉÒÔ¿´µ½Ê¹ÓÃÃüÁîÐжÔÊý¾ ......
Õª×Ôhttp://blog.csdn.net/ljah/archive/2006/11/08/1373959.aspx
¸ñʽ£º
CREATE PROCEDURE ¹ý³ÌÃû ([¹ý³Ì²ÎÊý[,...]])
[ÌØÐÔ ...] ¹ý³ÌÌå
CREATE FUNCTION º¯ÊýÃû ([º¯Êý²ÎÊý[,...]])
RETURNS ·µ»ØÀàÐÍ
[ÌØÐÔ ...] º¯ÊýÌå
¹ý³Ì²ÎÊý:
[ IN | OUT | INOUT ] ²ÎÊýÃû ²ÎÊýÀàÐÍ
º¯Êý²ÎÊý:
²ÎÊýÃû ²ÎÊýÀàÐÍ
·µ»ØÀàÐÍ: ......
²âÊÔ»·¾³£ºUbuntu 9.10 + MySQL 5.1.37-1ubuntu5
Ubuntu ÔÚÆô¶¯¹ÜÀí init.d
ÀïÃæ¹ØÓÚ MySQL µÄÃüÁîÓУº
/etc/init.d/mysql start|stop|restart|reload|force-reload|status
ÀýÈçÖØÆôMySQL·þÎñ£ºsudo /etc/init.d/mysql restart
......
truncate table Çå¿Õ±í£¬ºÍdeleteÏàËÆ£¬µ«ÊÇÔÚ±í·Ç³£´óµÄʱºò£¬ËüÊÇÖð²½Êͷŵġ£
insert Èç¹ûÔÚ²åÈëʱ£¬Ä³¸ö×ֶδæÔÚ£¬ÎÒÏë¸üпÉÒÔͨ¹ý insert into tablename values() on duplicate key update id=id+1;
insert into tablename values(default) ĬÈÏ×ÔÔö³¤
select last_insert_id() È¡×îºó²åÈëÒ»Ìõ¡£ ......