views:

128

answers:

1

Hi, How can i get the Compiled Mysql stored procedures from Physical Location?

+2  A: 

In the database mysql there's a table proc which seems to hold all the data for a stored procedure.
So the physical files should be <datadir>/mysql/proc.MYI and <datadir>/mysql/proc.MYD.

edit: But maybe you're simply looking for SHOW CREATE PROCEDURE?

VolkerK
I did the above thing but same result :(.is there Any other possible Way?
Palani
No. I have reinstalled the OS before that i have copied all thing that is located under Mysql/Data folder.Now i can able to restore all values except store procedures.is there any way to get that?
Palani
hm, if you place those two files into another directory in your data dir, e.g. datadir/proctest/proc.MYI and datadir/proctest/proc.MYD and then restart the mysql server, can you access the table like e.g. `SELECT body FROM proctest.proc` ?
VolkerK
Thanks for your Help.It works :).
Palani
In order to transfer a mysql database server to a new host, you need to copy EVERYTHING under the data dir. Really everything. You can't just pick-and-choose. If you failed to copy the system "mysql" database, then the procedures are lost. Likewise, if you failed to copy the innodb tablespace, your innodb tables are lost.
MarkR
Hm yes it is everything but what my fault was that I just pasted these two files into Mysql default schema.It seems Every schema has separate files(proc.MYI and proc.MYD) but In My old mysql Database Only the default(mysql) has this.Which one is the real concept?
Palani