MySql教程

mysql 权限设置

本文主要是介绍mysql 权限设置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

mysql 权限设置,创建用户

 

 


GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION

 

 


SHOW GRANTS FOR 'root';

SHOW GRANTS FOR 'compdev';

SHOW GRANTS FOR 'selectastore';


-- 创建用户
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
CREATE USER 'compdev'@'%' IDENTIFIED BY 'comp3edcMJU&';

-- 设置密码
SET PASSWORD FOR 'compdev'@'%' = PASSWORD("comp3edcMJU&");

-- 设置密码
SET PASSWORD FOR 'selectastore'@'%' = PASSWORD("Astore_2018er");

-- 赋权
GRANT SELECT, INSERT ON test.user TO 'selectastore'@'%';
GRANT ALL ON *.* TO 'selectastore'@'%';

-- 刷新权限
FLUSH PRIVILEGES;


-- 创建dblink
CREATE TABLE ability_oparty_msg_view(
`abilityName` VARCHAR(64) NOT NULL COMMENT '接口英文名',
`abilityVersion` VARCHAR(64) NOT NULL COMMENT '版本号',
`abilityChNames` VARCHAR(64) NOT NULL COMMENT '接口中文名',
`opartyName` VARCHAR(64) NOT NULL COMMENT '接口调用方',
`url` VARCHAR(128) NOT NULL COMMENT '地址'
)ENGINE=FEDERATED DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='平台能力信息表' CONNECTION='mysql://selectastore:Astore_2018er@32.1****:13306/comp_workbench/ability_oparty_msg_view';

 

这篇关于mysql 权限设置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!