Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backing up stored routines

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
0
0
GB
MySQL version: 5.0.67-community-log

I've recently added a significant number of stored routines (i.e. stored procedure and stored functions) to my database. I checked the output of my automatic backup PHP script (which executes a call to mysqldump) today and discovered that the stored routines are not dumped.

I read the MySQL 5.0 Reference Manual ( but adding the "-R" parameter to the mysqldump call of my backup script only outputs the following (after all tables and their data have been dumped):
Code:
--
-- Dumping routines for database 'prefix_dbname'
--
DELIMITER ;;
DELIMITER ;
Unfortunately, no stored routines in sight!

Does anyone have any ideas on what I'm doing wrong?

Your advice would be much appreciated.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
from the manual:

Dump stored routines (procedures and functions) from the dumped databases. Use of this option requires the SELECT privilege for the mysql.proc table

I assume the user you are using has this privilege?

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks for your reply Daddy. I did read that, but I must confess I wasn't sure how to go about doing that until I spent a bit of time looking it up.

On trying the following SQL:
Code:
GRANT SELECT ON MySQL.Proc to user@host;
...I discovered I don't have permissions to do this on my shared web hosting account.

My web host was able to run "mysqldump -R db_name > filename" and it successfully dumped the stored routines. So it appears it is down to permissions.

I found a workaround by setting up a Backup Project in MySQL Administrator. The "Backup Content" section includes a list of tables and stored routines which you can include in the backup.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top