java访问数据库被拒绝,不能连接数据库ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

错误原因:mysql数据库只允许本地ip访问;
解决方法:修改mysql表设置所有ip都可以访问;
登录数据库 使用以下命令:
use mysql;
grant all privileges on *.* to 'root'@'%' identified by '你的数据库密码';
flush privileges;

查看是否修改成功
select host,user from user;

java访问数据库被拒绝,不能连接数据库ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)的更多相关文章
- mysql登录报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问 对于出现拒绝访问root用户的解决方案错 ...
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit ...
- MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
问题描述 安装完MySQL5.5数据库,使用Navicat Premium以及命令窗口连接数据库都报以下错误: ERROR 1045 (28000): Access denied for user ' ...
- Ubuntu下 MySQL的“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)”
今天闲来无事,在Ubuntu上掏鼓一下mysql.但尴尬的是,当我输入mysql -u root -p的时候,抛出了一个错误:ERROR 1045 (28000): Access denied for ...
- 【MySQL】ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
问题现象: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问root用户 ...
- MySQL密码正确却无法本地登录,ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
MySQL密码正确却无法本地登录 报错如下: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password ...
- ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决办法
问题:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 很久没用这台电脑的mysql ...
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因
在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...
- mysql 链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES))
mysql链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)) 修改: # ...
随机推荐
- [07/18NOIP模拟测试5]超级树
鬼能想到的dp定义:dp[i][j]表示在一棵i级超级树中,有j条路径同时存在且这j条路径没有公共点时,可能的情况数 刚开始我也没看懂,所以举个例子 如一个2级的超级树,父节点为1,左右儿子为2,3 ...
- csps模拟测试110
好久没写博客了,主要是太懒了,这次考试其实状态还算好. 考试的时候半小时左右打完T1T2,先没打T2对拍,想了想T3,大概有了一个bitset的思路,回去补上了T2的对拍. 然后T3想了一些东西: 三 ...
- 使用Samba或实现文件共享
安装Samba服务软件包: 命令:yum install samba 使用Samba服务口令验证方式可以让共享文件更加的安全,做到仅让信任的用户访问,而且验证过程也很简单 第1步:检查当前是否为use ...
- PostgreSQL的模式、表、空间、用户间的关系
在平时的工作中,我们经常接触到数据库表和用户以及角色的使用,由于经常使用默认的数据库表空间和模式(Schema),所以我们往往忽略了数据库表空间和模式的概念以及作用. 接下来,先介绍一下模式和表空间的 ...
- 『题解』Codeforces2A Winner
Portal Portal1: Codeforces Portal2: Luogu Description The winner of the card game popular in Berland ...
- css3 mask遮罩动画(照明灯效果)
<pre><!DOCTYPE html><html lang="en"><head><meta charset="U ...
- php 环境require(): open_basedir restriction in effect 错误
php 环境require(): open_basedir restriction in effect 错误 错误日志显示,访问脚本不在 open_basedir的限定目录里面 解决方法打开fastc ...
- Dockerfile介绍及指令详情
Dockerfile简介: 镜像的定制实际上就是定制每一层所添加的配置.文件.如果我们可以把每一层修改.安装.构建.操作的命令都写入一个脚本,用这个脚本来构建.定制镜像,那么哪些无法重复的问题.镜 ...
- 【R语言学习笔记】 Day1 CART 逻辑回归、分类树以及随机森林的应用及对比
1. 目的:根据人口普查数据来预测收入(预测每个个体年收入是否超过$50,000) 2. 数据来源:1994年美国人口普查数据,数据中共含31978个观测值,每个观测值代表一个个体 3. 变量介绍: ...
- 最新版 IDEA 2019.2.4 下载安装 & 破解使用期限至2089年
一.准备 官网下载链接:https://www.jetbrains.com/idea/download/#section=windows 根据自己系统选择对应版本,这里选择Windows的UItima ...