views:

162

answers:

1

Hi,

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 started 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

A: 

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".

longneck
I want to set the value of a column in our database table to a specific value when the machine restart (i.e when mysql restarts as it we have put it as a windows based service). The database startup is not in our control. So we can't schedule at any specific timestamp.
Kalpak
then use the init-file option.
longneck
Thanks a lot....My work is done...
Kalpak