Here's the code to export the stored procedure
1 # mysqldump-u database user name-p-n-t-d-r database name > file name
Where-D represents--no-create-db,-N for--no-data,-T for--no-create-info, and-R for export function and procedure. So the code above indicates that only functions and stored procedures are exported, and the table structure and data are not exported. However, the contents of this export include trigger. There will be problems when importing into MySQL, with the following errors:
ERROR 1235 (42000) at line * *: This version of MySQL doesn ' t yet support ' multiple triggers with the same action time and Event for one table '
So you need to turn the trigger off when exporting. Code for
1 # mysqldump-u database user name-p-n-t-d-R--triggers=false Database name > file name
When this is imported, a new problem occurs:
errorcode:1418
This function has none of the deterministic, NOSQL, or READS SQL DATA inits Declaration and binary logging is enabled (you *mi Ght* want to use the less safe log_bin_trust_function_creators variable)
The workaround is to find [mysqld] in/etc/my.cnf and add such a line below it:
1 Log-bin-Trust-function-creators=1
MySQL export functions, stored procedures