1

Im trying to do an initial transfer of my data to a replica server by running this command:

sudo mysqldump -f -u root -pPassword --opt mydb | mysql --host=replica01 -C mydb -u restore -pPassword

It copies most of the data, but stops on one of the functions i've created with this error:

ERROR 1305 (42000) at line 3750: FUNCTION mydb.myFunction does not exist mysqldump: Got errno 32 on write

I have both procedures and functions in my database. Some procedures use functions in them. Is that what is causing this? In that case, what can i do to ignore these errors?

jared
  • 123
  • 6

1 Answers1

1

You should try doing mysqldump without the stored procedures

In your case, it would be

sudo mysqldump -f -u root -pPassword --skip-routines -opt mydb | mysql --host=replica01 -C mydb -u restore -pPassword

You should also dump the stored procedures into a text file

See my old post Dump only the Stored Procedures in MySQL

In your case it would be

mysqldump -f -u root -pPassword --routines --skip-triggers --no-data --no-create-info -opt mydb > mydb_sp.sql

Have a look at the file

less mydb_sp.sql

then import the stored procedures like this

mysql --host=replica01 -C mydb -u restore -pPassword < mydb_sp.sql
RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536