ºìÁªLinuxÃÅ»§
Linux°ïÖú

mysql´¢´æ¹ý³ÌµÄ±¸·ÝºÍ»¹Ô­

·¢²¼Ê±¼ä:2008-09-03 00:05:18À´Ô´:ºìÁª×÷Õß:tronrms
ÔÚת´¢µÄÊý¾Ý¿âÖÐת´¢´æ´¢³ÌÐò(º¯ÊýºÍ³ÌÐò)¡£Ê¹ÓÃ---routines²úÉúµÄÊä³ö°üº¬CREATE PROCEDUREºÍCREATE FUNCTIONÓï¾äÒÔÖØд´½¨×Ó³ÌÐò¡£µ«ÊÇ£¬ÕâЩÓï¾ä²»°üÀ¨ÊôÐÔ£¬ÀýÈç×Ó³ÌÐò¶¨ÒåÕß»ò´´½¨ºÍÐÞ¸Äʱ¼ä´Á¡£Õâ˵Ã÷µ±ÖØÔØ×Ó³ÌÐòʱ£¬¶ÔËüÃǽøÐд´½¨Ê±¶¨ÒåÕßÓ¦ÉèÖÃΪÖØÔØÓû§£¬Ê±¼ä´ÁµÈÓÚÖØÔØʱ¼ä¡£

Èç¹ûÄãÐèÒª´´½¨µÄ×Ó³ÌÐòʹÓÃÔ­À´µÄ¶¨ÒåÕߺÍʱ¼ä´ÁÊôÐÔ£¬²»Ê¹ÓÃ--routines¡£Ïà·´£¬Ê¹ÓÃÒ»¸ö¾ßÓÐmysqlÊý¾Ý¿âÏàӦȨÏÞµÄMySQLÕË»§Ö±½Óת´¢ºÍÖØÔØmysql.proc±íµÄÄÚÈÝ¡£

show procedure status;

show create procedure autoinsert;

DELIMITER ;;

CREATE PROCEDURE `autoinsert`()
begin
declare i int;
set i=1;
while(i<100000)do
insert into t10 values (i,'name');
set i=i+1;
end while;
END;;

DELIMITER ;

±¸·Ýmysqldump -u root -p123 --socket=/usr/local/mysql1/var/mysql.sock -R --no-data --no-create-db --no-create-info --all-database > /root/mysqllog/test.sql

mysqldump -u root -p123 --socket=/usr/local/mysql1/var/mysql.sock mysql proc > /root/mysqllog/test.sql

»¹Ô­source /root/mysqllog/test.sql

use mysql
source /root/mysqllog/test.sql
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ