数据库
文章平均质量分 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 28000java.sql.原创 2020-09-22 10:52:39 · 376 阅读 · 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 · 247 阅读 · 0 评论 -
Mysql 设置访问IP
为了限制root用户的安全需要限制访问IP最简单的方法修改mysql数据库中user表的host字段use mysql;查看数据库中的用户信息select host, user from user;修改相关用户的hostupdate user set host="localhost" where user="root";刷新一下flush privileges;...原创 2020-09-09 10:07:38 · 285 阅读 · 0 评论