mysqldump:权限不足,无法显示创建函数“函数名" [英] mysqldump: insufficient privileges to show create function 'function name'

查看:761
本文介绍了mysqldump:权限不足,无法显示创建函数“函数名"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用mysql工作台中的函数和过程转储我的数据库.我可以不使用函数和过程转储数据库,但是当我尝试使用过程导出数据时,它显示出如下错误:

I want to dump my database with function and procedure in mysql workbench. I could dump my DB without functions and procedures.but when I try to export the data with procedures, it showed me the error like:

"mysqldump:用户没有足够的权限来显示创建函数的函数名称"

"mysqldump:user has insufficient privileges to show create function function name"

推荐答案

要同时使用存储过程转储数据库,必须授予mysql.proc的SELECT权限:

To dump a database also with stored procedures, you must grant SELECT rights to mysql.proc:

以root身份执行一次该语句:

Execute this statement once as root:

GRANT SELECT ON mysql.proc to 'your-mysqldump-user';

用真实的用户名替换 your-mysqldump-user .

<罢工> 然后刷新特权:

Then flush the privileges:

FLUSH PRIVILEGES

现在,您应该可以使用mysqldump-user转储包括存储过程在内的数据库了.

Now you should be able to dump the database including stored procedures with your mysqldump-user.

更新:正如@Michael在评论中指出的,在这种情况下FLUSH PRIVILEGES不是必须的

UPDATE: as @Michael pointed out in the comments, FLUSH PRIVILEGES isn't nesseccary in this case

这篇关于mysqldump:权限不足,无法显示创建函数“函数名"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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