zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

mysql常用操作

mysql 操作 常用
2023-09-14 08:57:20 时间

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;