How to include functions and procedures when importing a MySql database from another server using mysqldump?


I am moving my application to AWS. I have a mysqldump file of my database from the original server that includes table, views, functions and procedures. When I try to import the file into the RDS, only the tables and views are imported. I get an error about needing super privileges and the functions and procedures are not imported. I followed the instructions found in the article: I set the log_bin_trust_function_creators=1 and I am now able to create new function and procedures but I still get the same error trying to import them.

I have tried using the command line and My SQL Workbench and get the same error.

How can get a complete database import. I verified that everything is included in the mysqldump file by importing it back into a new database on the same existing server and everything is there.

2 Answers
Accepted Answer

I don't have experience with this, but is this something the Schema Conversion Tool would recreate for you? Just a thought.

profile pictureAWS
answered 10 months ago
  • Good suggestion. However That tool is used when moving from day MS SQL to MySQL

  • Thanks for the info but in my case the schemas are the same.


Afraid you have to do this manually

Make sure to create any stored procedures, triggers, functions, or events manually in your Amazon RDS database. If you have any of these objects in the database that you are copying, exclude them when you run mysqldump. To do so, include the following arguments with your mysqldump command: --routines=0 --triggers=0 --events=0.

profile picture
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions