Import mysql procedures generated from mysqldump -routines

I am using the mysqldump tool to create copies of my database. The problem is that when I use the -routines parameter to output my stored procedures along with my data, the generated output causes an error when trying to import it.

It looks something like this:

% mysqldump --routines MyDB | mysql MyDB2

(where MyDB2 already exists but is empty)

The error I am getting is the following:

ERROR 1064 (42000) at line 307: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 23

Everything works correctly if I omit -routines.

Has anyone else come across this?

+5
source share
2 answers

I managed to get this to work by splitting it into two calls:

% mysqldump MyDB | mysql MyDB2
% mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt MyDB | mysql MyDB2
+3
source

- MyDB2, :

  • mysqldump, .
  • , , .
  • .

, mysql , . mysql? (, )?

+3

All Articles