一、异常现象

使用navicat premuim 连接 虚拟机mysql数据库时 ,抛出如下错误:

Access denied for user 'root'@'192.168.1.13' (using password: YES)

二、异常原因

Mysql 安装完毕后,默认会有'root'@'localhost'用户,这个用户只能在本机登录mysql。若需要远程登录,则需要以'root'@'%' 用户登录。

出现上图,是因为当前数据库中没有 'root'@'%'用户,或是此用户密码不对,因此需要创建这个用户或修改此用户密码

三、异常解决

在 mysql 服务器上使用root进行登录:

mysql -u root -p

然后执行如下命令:

(1) 创建用户并授权

# 创建 'root'@'%'用户
CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; # 授权
grant all on *.* to 'root'@'%';
flush privileges;

  

  

(2)或者修改密码

alter user 'root'@'%' identified by 'root.';

  

然后再连接即可成功连接。

二、参考资料

1.解决mysql"Access denied for user'root'@'IP地址'"问题

2.关于远程访问mysql出现Access denied for user 'root'@'的解决方法

mysql_异常_01_Access denied for user 'root'@'192.168.1.13' (using password: YES)的更多相关文章

  1. python连接mariadb报错解决1045, "Access denied for user 'root'@'192.168.0.50' (using password: YES)

    [root@localhost ~]# python Python 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Ha ...

  2. idea启动报错:Access denied for user 'root '@'192.168.100.XXX' (using password: YES)

    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit ...

  3. 解决MySql Access denied for user 'root'@'192.168.1.119' to databse 的问题

    因为ip未授权,在navicat中执行 grant all privileges on *.* to 'root'@'192.168.1.119' identified by 'root' with ...

  4. Access denied for user '密码'@'192.18.0.0' (using password: YES)

    Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.6:generate (default- ...

  5. ligh@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.3

    ligh@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.3

  6. (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)

      在一台测试服务器测试Python脚本时,执行Python脚本时报如下错误: 主要错误信息为"operation the sql fail!1045 (28000): Access den ...

  7. ssh免密登陆:sshpass -p [passwd] ssh -p [port] root@192.168.X.X

    正文: ssh免密登陆:sshpass -p [passwd] ssh -p [port] root@192.168.X.X

  8. ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)

    我的原因是在配置文件my.ini [mysqld]项,在其后加入了一句:skip-name-resolve 导致授权出现这个错误,把skip-name-resolve这项屏蔽了就好了. 场景2:对所有 ...

  9. mysql错误 Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)

    mysql -u root -p Aaa111222333 grant all privileges on *.* to root@'%' identified by 'aaa111222333; Q ...

随机推荐

  1. Oracle学习笔记—Db_name、Db_domain、Global_name、Service_name、Instance_name和Oracle_SID(转载)

    转载自: Oracle中DB_NAME,SID,DB_DOMAIN,SERVICE_NAME等之间的区别 Db_name:对一个数据库(Oracle database)的唯一标识.这种表示对于单个数据 ...

  2. 字符串之strstr

    功能:查找第二个字符串是否存在第一个字符串中. 输入:字符串1,字符串2 返回值:成功返回str1中的位置,失败返回NULL #include <iostream> using names ...

  3. zabbix3.2.4监控MySQL5.7.16状态

    一.添加监控用户mysql> grant all privileges on *.* to 'zabbix'@'localhost' identified by 'zabbix';mysql&g ...

  4. Win8.1和office2013使用电话激活步骤

    Win8.1和office2013使用电话激活步骤: 先从Win8.1贴吧的最后几个回复中找到几个密钥,最后的通常是最新的,然后输入到Win8.1中,会提示你密钥无效,如果有效你就走了狗屎运了,无效的 ...

  5. Owncloud-X安装配置

    系统是基于Centos7.2 1.更改yum源: mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back ...

  6. 前端 初级篇(CSS)

    CSS 简介 css是英文Cascading Style Sheets的缩写,称为层叠样式表,用于对页面进行美化. 存在方式有三种:元素内联.页面嵌入和外部引入,比较三种方式的优缺点. 语法:styl ...

  7. Android sdk manager加载缓慢或加载不出来

    1.打开android sdk manager 2.打开tool->options,如图所示 3.将Proxy Settings 里的HTTP Proxy Server和HTTP Proxy P ...

  8. JS字符串数组转换

    字符串转数组: str.split(';') 数组转字符串: arr.join(';')

  9. redis 第一篇

    一.redis简介 redis是一个开源的高性能键值对数据库:本质上是数据结构服务器或者是数据结构数据库 特点: 1.共享内存 如果有自己的线程可以读list,如果外界还有一个程序都上面的list,那 ...

  10. 【转】linux驱动开发

    转自:http://www.cnblogs.com/heat-man/articles/4174899.html 首先理一理驱动/内核/应用程序的一些概念,以前总没有具体的去关注过! 我们的pc直观来 ...