
复制//针对root账号 set global validate_password_policy=0; --设置判断密码的文总问控标准基于密码的长度(validate_password_length) grant all privilges on *.* to root@localhost identified by password; grant all privilges on *.* to root@% identified by password; --根据具体情况决定是网站模板否开启 //针对日常运维账号 grant select, insert, update, delete on database_name.* to hwb@% identified by password; grant create,alter,drop,references on database_name.* to hwb@%; grant create temporary tables on database_name.* to hwb@%; grant index on database_name.* to hwb@%; grant create view on database_name.* to hwb@%; grant show view on database_name.* to hwb@%; grant create routine on database_name.* to hwb@%; -- 查看存储过程、函数状态 grant alter routine on database_name.* to hwb@%; --删除存储过程、站群服务器数据函数 grant execute on database_name.* to hwb@%; grant all privileges on mysql.* to hwb@% identified by password; --不增加不能对其他用户的库访函数或存储过程做操作 //针对应用连接账号 grant all privileges on database_name.* to hwb2@应用服务器IP identified by password; grant all privileges on mysql.* to hwb2@应用服务器IP; --不增加无法对其他用户的源码库函数或存储过程做操作 //针对只读账号(导出数据库权限) grant select on database_name.* to hwbread@% identified by hwbread123; grant select on mysql.* to hwbread@%; grant show view on database_name.* to hwbread@%; grant file on *.* to hwbread@%; --if database_name.* will ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.


相关文章



精彩导读

热门资讯
关注我们
