root登陆,赋予某个用户限
查询、插入、更新、删除 数据库中所有表数据的权利。
grant select, insert, update, delete on {库名}.* to {用户名}@'%';
建表
grant create on {库名}.* to {用户名}@'%';
改表
grant alter on {库名}.* to {用户名}@'%';
删表
grant drop on {库名}.* to {用户名}@'%';
建索引
grant index on {库名}.* to {用户名}@'%';
执行函数存储过程
grant execute on {库名}.* to '{用户名}'@'%';
创建函数权限
grant create routine on {库名}.* to '{用户名}'@'%';
删除函数权限
grant alter routine on {库名}.* to '{用户名}'@'%';
查询数据库中的存储过程和函数
show procedure status; //存储过程
show function status; //函数
select `name` from mysql.proc where db = 'xx' and `type` = 'PROCEDURE' //存储过程
select `name` from mysql.proc where db = 'xx' and `type` = 'FUNCTION' //函数
查看存储过程或函数的创建代码
show create procedure proc_name;
show create function func_name;
刷新
flush privileges;
参考:https://www.cnblogs.com/rmbteam/archive/2011/10/20/2219368.html
输入导出脚本 mysql -u用户名 -p密码 数据库名 < 数据库名.sql 例子: #mysql -uabc_f -p abc < abc.sql
创建函数权限
grant create routine on {库名}.* to '{用户名}'@'%';
删除函数权限
grant alter routine on {库名}.* to '{用户名}'@'%';
查询数据库中的存储过程和函数
select `name` from mysql.proc where db = 'xx' and `type` = 'PROCEDURE' //存储过程
select `name` from mysql.proc where db = 'xx' and `type` = 'FUNCTION' //函数
show procedure status; //存储过程
show function status; //函数 查看存储过程或函数的创建代码
show create procedure proc_name;
show create function func_name;