How to export a stored procedure from a local machine and import to a server?

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

Thanks in advance.

+4
source share
2 answers

in phpmyadmin while you export the database to select and then check the add procedures/events/triggers

or

use the following command

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

for more information visit the link

+5
source

You can use MySQLDump to export the stored proc:

The procedure is saved in a dump with everything else:

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

Just stored procedures:

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

From: How to save stored procedures in MySQL

+2
source

All Articles