mysql创建数据库并创建用户授权
CREATE USER myuser IDENTIFIED BY 'mypassword';
创建一个不受主机限制的用户myuser,并且指定密码是mypassword
CREATE USER myuser@localhost IDENTIFIED BY 'mypassword'; 或者 CREATE USER [email protected] IDENTIFIED BY 'mypassword';
创建一个制定主机访问的用户myuser,并且指定密码是mypassword
CREATE DATABASE ecshop;
创建一个数据库ecshop
GRANT ALL PRIVILEGES ON *.* TO myuser@localhost
给用户myuser授权所有的数据库下的所有的表,并且是所有权限,只能在localhost登录
GRANT ALL PRIVILEGES ON ecshop.* TO myuser@localhost
给用户myuser授权数据库ecshop下的所有的表,并且是所有权限,只能在localhost登录
相关推荐
CoderToy 2020-11-16
bianruifeng 2020-11-16
云中舞步 2020-11-12
暗夜之城 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
敏敏张 2020-11-11
好记忆也需烂 2020-11-11
lpfvip00 2020-10-07
云中舞步 2020-09-11
康慧欣 2020-09-10
silencehgt 2020-09-07
幸福ITman汪文威 2020-09-05
sofia 2020-09-03
nan00zzu 2020-08-19
CHINA华军 2020-08-18
cyhgogogo 2020-08-18