mysql常用操作
1. 给数据库添加登录用户和权限
# 创建用户
create user 'ecsoft' identified by 'ecsoft';
# grant all privileges on 库名.表名 to '用户名'@'IP地址' identified by '密码' with grant option;
grant all privileges on ecsoft.* to ecsoft@"localhost" identified by 'ecsoft';
//后面在使用过程中,发现指定单个数据库权限的时候,经常连接不上。后面改成所有的数据库连接就可以。
grant all privileges on *.* to ecsoft@"localhost" identified by 'ecsoft';
# 提交 flush privileges;
本文来自博客园,作者:硅谷工具人,转载请注明原文链接:https://www.cnblogs.com/30go/p/9157188.html