案例(需要有权限)
https://doc.rg1008.com/docs/bt/bt-1ebr017vb1be0
案例库,用于三方业务代码生成等,对应ConnBsDemo
create user 'rgdemo'@'localhost' identified by 'redis-tool-1!';
create user 'rgdemo'@'%' identified by 'redis-tool-1!';
create database rg_bs_demo;
grant all privileges on rg_bs_demo.* to rgdemo@'%';
ALTER USER 'rgdemo'@'localhost' IDENTIFIED WITH mysql_native_password BY 'redis-tool-1!';
ALTER USER 'rgdemo'@'%' IDENTIFIED WITH mysql_native_password BY 'redis-tool-1!';
flush privileges;
1、创建数据库:
create database {owner}_auth_bo;
create database {owner}_auth_log;
create database {owner}_auth_bs;
create database {owner}_log_sys;
create database {owner}_log_op;
create database {owner}_log_track;
create database {owner}_log_ub;
create database {owner}_bs_code;
create database {owner}_bs_mall;
create database {owner}_bs_msg;
create database {owner}_bs_chats;
create database {owner}_bs_crm;
create database {owner}_bs_bbs;
create database {owner}_bs_pm;
create database {owner}_bs_cpc;
create database {owner}_bs_idc;
create database {owner}_bs_activity;
create database {owner}_bs_rms;
create database {owner}_iot_space;
create database {owner}_iot_data;
create database {owner}_bo_question;
create database {owner}_bo_oss;
create database {owner}_bo_audit;
create database {owner}_bs_oa;
create database {owner}_bs_hrm;
create database {owner}_bs_wms;
create database {owner}_bs_workflow;
create database {owner}_bs_cos;
2、创建用户:
create user '{owner}'@'localhost' identified by '{owner}{suffix}!@#_';
create user '{owner}'@'%' identified by '{owner}{suffix}!@#_';
备注:localhost本机ip,%任何ip
3、配置权限(8.0以上):
grant all privileges on {owner}_auth_bo.* to {owner}@'%';
grant all privileges on {owner}_auth_bs.* to {owner}@'%';
grant all privileges on {owner}_auth_log.* to {owner}@'%';
grant all privileges on {owner}_log_sys.* to {owner}@'%';
grant all privileges on {owner}_log_track.* to {owner}@'%';
grant all privileges on {owner}_log_ub.* to {owner}@'%';
grant all privileges on {owner}_log_op.* to {owner}@'%';
grant all privileges on {owner}_bs_code.* to {owner}@'%';
grant all privileges on {owner}_bs_mall.* to {owner}@'%';
grant all privileges on {owner}_bs_msg.* to {owner}@'%';
grant all privileges on {owner}_bs_pm.* to {owner}@'%';
grant all privileges on {owner}_bs_cpc.* to {owner}@'%';
grant all privileges on {owner}_bs_idc.* to {owner}@'%';
grant all privileges on {owner}_bs_chats.* to {owner}@'%';
grant all privileges on {owner}_bs_crm.* to {owner}@'%';
grant all privileges on {owner}_bs_bbs.* to {owner}@'%';
grant all privileges on {owner}_bs_rms.* to {owner}@'%';
grant all privileges on {owner}_bs_oa.* to {owner}@'%';
grant all privileges on {owner}_bs_hrm.* to {owner}@'%';
grant all privileges on {owner}_bs_wms.* to {owner}@'%';
grant all privileges on {owner}_bs_workflow.* to {owner}@'%';
grant all privileges on {owner}_bs_cos.* to {owner}@'%';
flush privileges;
3、配置权限(8.0以下):
grant all privileges on {owner}_auth_bo.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_auth_log.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_log_sys.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_log_track.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_log_ub.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_log_op.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_code.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_mall.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_msg.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_pm.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_cpc.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_idc.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_rms.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_oa.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_hrm.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_wms.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_workflow.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
grant all privileges on {owner}_bs_cos.* to {owner}@'%' identified by '{owner}{suffix}!@#_';
flush privileges;
caching_sha2_password 报错,重新设置密码
ALTER USER '{owner}'@'%' IDENTIFIED WITH mysql_native_password BY '{owner}{suffix}!@#_';
ALTER USER '{owner}'@'localhost' IDENTIFIED WITH mysql_native_password BY '{owner}{suffix}!@#_';
flush privileges;
windwow mysql远程访问
http://t.zoukankan.com/tenghoo-p-mysql_grant.html
1、mysql -u root -p
2、use mysql
3、GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
4、flush privileges;
5、select host,user from user;
文档更新时间: 2023-11-05 10:17 作者:admin