Exec bat Test~

.bat file:

set MySQL_HOME=C:\Program Files\MySQL\MySQL Server 6.0
set PATH=%MySQL_HOME%\bin;%PATH%
mysql --host=192.168.0.196 --port=3308 --user=scott --password=tiger --default-character-set=utf8 run<mysql.sql
pause

mysql.sql:

call Test_SP();
INSERT INTO `run`.`mylog`
(log_datetime,log_thread,log_level,log_logger,log_message)
VALUES
(
now(),100,'Operate','Exec temp table to Target table..','Manu'
);
Note:.bat and .sql should be in the same path with mysql.exe,for example:C:\Program Files\MySQL\MySQL Server 6.0\bin.

posted @ 2011-03-29 22:15  AriLee  Views(174)  Comments(0Edit  收藏  举报