4

I have a dozen stored procedure written in my local phpmyadmin. I want to export it to my server along with the tables. Is there any way to do this?. Please help.

Thanks in advance..

I'm_Pratik
  • 541
  • 8
  • 22
Sree
  • 530
  • 1
  • 8
  • 20
  • 1
    Not quite an answer but may provide some useful details: http://stackoverflow.com/questions/6115573/how-do-i-view-my-stored-procedures-in-phpmyadmin – Supericy Dec 27 '12 at 10:10

2 Answers2

5

in phpmyadmin while you are exporting database choose custom and then tick the add procedures/events/triggers option

or

use the below command

mysqldump -u root -p db_name --routines --events --triggers > file.sql

for more info visit this link

Sree
  • 530
  • 1
  • 8
  • 20
vidyadhar
  • 3,118
  • 6
  • 22
  • 31
2

You could use MySQLDump to export your stored proc :

Stored procedured in dump with everything else:

mysqldump -r <dbname> #or
mysqldump --routines <dbname>

Just the stored procedures:

mysqldump -n -t -d -r <dbname> #or
mysqldump --no-create-db --no-create-info --no-data --routines <dbname>

From : How to backup stored procedures in MySQL

Community
  • 1
  • 1
sdespont
  • 13,915
  • 9
  • 56
  • 97