开发者

Schedule an event to execute SQL statements everytime the mysql server is started

开发者 https://www.devze.com 2022-12-11 02:07 出处:网络
I want a stored procedure to execute so that it updates a specific column in a table every time mysql server is started (to be precise when windows boots and mysql is start开发者_运维知识库ed as a par

I want a stored procedure to execute so that it updates a specific column in a table every time mysql server is started (to be precise when windows boots and mysql is start开发者_运维知识库ed as a part of service automatically).

Can somebody point out the syntax? Or the care to be taken to do something like this.

I know the events were included as a part of 5.1 realease. Is it possible to do the above execution when mysql start in 5.0 release. But we are able to schedule at a specific time interval but not when mysql starts.

We would like to avoid window-services.

regards...

Kalpak


you can use the init-file variable in your configuration file to run a text file containing SQL statements in it.

but what do you want to run on startup? there's probably already something in mysql that does what you want to do without resorting to "magic".

0

精彩评论

暂无评论...
验证码 换一张
取 消