有没有办法在MySQL数据库之间复制函数? [英] Is there a way to copy a function between MySQL databases?

查看:799
本文介绍了有没有办法在MySQL数据库之间复制函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建实时数据库的开发副本,并进行了一些修改以进行测试.有没有一种方法可以在数据库之间复制MySQL用户定义的FUNCTION?还是我需要手动重新创建它?

I'm creating a dev copy of a live databases with some modifications for testing. Is there a way to copy a MySQL user defined FUNCTION between databases? Or do I need to recreate it manually?

推荐答案

是的,使用带有--routines选项的mysqldump从源数据库中导出它们:

Yes, use mysqldump with --routines options to export them from your source db:

mysqldump <other mysqldump options> --routines > your_output_file.sql 

并要将其导入目标数据库中,请使用

And to import them in the destination db, use

mysql <database> < your_output_file.sql

您可以在此处

这篇关于有没有办法在MySQL数据库之间复制函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆