MySQL export functions, stored procedures

Source: Internet
Author: User
Tags one table

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.