数据库
文章平均质量分 80
·银月·
这个作者很懒,什么都没留下…
展开
-
Access denied for user ‘root‘@‘localhost‘ (using password: YES)
进入突然项目中出现了 com.alibaba.druid.pool.DruidDataSource : create connection error, url: jdbc:mysql://localhost:3306/ams?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useAffectedRows=true, errorCode 1045, state 28000 java.sql.原创 2020-09-22 10:52:39 · 330 阅读 · 0 评论 -
Mysql 添加用户并授权
使用root 用户连接指定的数据库 添加用户 create user "username" identified by 'password'; 可以通过 select host, user from user; 查看是否成功添加用户。 授权 grant privilegesCode on dbName.tableName to username@host identified by “password”; 此命令模式已经淘汰,新版本采用创建用户和赋予权限分开的操作。 赋予权限:grant 权限列表 on原创 2020-09-09 11:10:27 · 221 阅读 · 0 评论 -
Mysql 设置访问IP
为了限制root用户的安全需要限制访问IP 最简单的方法 修改mysql数据库中user表的host字段 use mysql; 查看数据库中的用户信息 select host, user from user; 修改相关用户的host update user set host="localhost" where user="root"; 刷新一下 flush privileges; ...原创 2020-09-09 10:07:38 · 258 阅读 · 0 评论