创建新用户

https://blog.csdn.net/piaocoder/article/details/53704126

添加新用户
允许本地 IP 访问 localhost, 127.0.0.1

create user ‘test’@‘localhost’ identified by ‘123456’;

允许外网 IP 访问

create user ‘test’@’%’ identified by ‘123456’;

为新用户分配权限

授予用户通过外网IP对于该数据库的全部权限
grant all privileges on testdb.* to ‘test’@’%’ identified by ‘123456’;

授予用户在本地服务器对该数据库的全部权限

grant all privileges on testdb.* to ‘root’@‘localhost’ identified by ‘p6e70e97efa’;

在命令框 远程连接的时候,带上阿里云的服务器
mysql -h47.98.240.236 -uroot -p6e70e97efa

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值