Mysql – How to retrieve stored procedures from raw data

backupMySQLstored-procedures

I have all the raw data from a database that I can't access through the mysql program anymore. I was able to get the tables by copying the .frm files over to the new installation of mysql, but I don't know how to get the stored procedures, which are what I really need out of the database.

Is there a way to retrieve them from the raw data files? (no, I did not do a dump of the stored procedures; I did not realize at the time you specify options to do that, and so I only have a dump of the tables).

Best Answer

Stored Procedures are physically stored in the mysql.proc table as a MyISAM table

Simply copy

/var/lib/mysql/mysql/proc.frm
/var/lib/mysql/mysql/proc.MYD
/var/lib/mysql/mysql/proc.MYI

If the new installation is the same major version of mysql, copying should do it for you

It would be safer to go back to the old setup, start mysql, and dump the stored procedures.

See my old post Dump only the Stored Procedures in MySQL