解决方案:

(1) 打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”,保存并关闭文件。(my.ini在C:\ProgramData\MySQL\MySQL Server 5.7\my.ini)

(2)重启MySQL服务。

(3)通过命令行进入MySQL的BIN目录,输入“mysql -u root -p”(不输入密码),回车即可进入数据库。

C:\Program Files\MySQL\MySQL Server 5.7\bin>

(4)执行“use mysql;”,使用mysql数据库。

(5)执行“update user set authentication_string=password('xxxx') where User='root'; (修改root的密码)

(6)分配权限

grant all privileges on *.* to root@localhost identified by "xxxx" ;

(7)打开MySQL目录下的my.ini文件,删除最后一行的“skip-grant-tables”,保存并关闭文件。

(8)重启MySQL服务。

(9)在命令行中输入“mysql -u root -p xxxx”,即可成功连接数据库。

Access denied for user 'root'@'localhost' (using password:YES) Mysql5.7的更多相关文章

  1. MySql Access denied for user 'root'@'localhost' (using password:YES) 解决方案

    关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑. 今早打开电脑,开始-运行 输入"mysql -uroot -pmyadmin"后出现以下错 ...

  2. phpmyadmin #1045 - Access denied for user 'root'@'localhost' (using password: NO)

    phpmyadmin访问遇到1045问题 #1045 - Access denied for user 'root'@'localhost' (using password: NO) 解决办法 找到p ...

  3. Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes

    Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes http://blog.csdn.n ...

  4. 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 ...

  5. 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 ...

  6. mac 安装mysql + 修改root用户密码 + 及报Access denied for user 'root'@'localhost' (using password:YES)解决办法

    1.下载MySQL 到mysql的官网http://dev.mysql.com/downloads/mysql/然后在页面中会看到“MySQL Community Server”下方有一个“downl ...

  7. 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...

  8. 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)) 修改: # ...

  9. 安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案

    本机是centos 6.5  安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rw ...

随机推荐

  1. SVN和Git的功能和区别,尚学堂SVN和Git学习视频资料免费下载

    对于软件开发人员来说,版本控制系统再熟悉不过了,所谓版本控制系统就是软件项目开发过程中用于储存开发人员所写代码所有修订版本的软件.目前常见的版本控制系统分为集中式版本控制系统(SVN)和分布式版本控制 ...

  2. [Swift]LeetCode446. 等差数列划分 II - 子序列 | Arithmetic Slices II - Subsequence

    A sequence of numbers is called arithmetic if it consists of at least three elements and if the diff ...

  3. [Swift]LeetCode696. 计数二进制子串 | Count Binary Substrings

    Give a string s, count the number of non-empty (contiguous) substrings that have the same number of ...

  4. [Swift]LeetCode1016. 子串能表示从 1 到 N 数字的二进制串 | Binary String With Substrings Representing 1 To N

    Given a binary string S (a string consisting only of '0' and '1's) and a positive integer N, return ...

  5. Redis 设计与实现 (四)--事件、客户端

    事件 一.文件事件 文件事件处理器使用I/O多路复用程序来同时监听多个套接字, 监听套接字,分配对应的处理事件. 四个组成部分:套接字 .I/O多路复用 . 文件事件分派器 . 事件处理器 连接应答处 ...

  6. mongodb高级聚合查询

    在工作中会经常遇到一些mongodb的聚合操作,特此总结下.mongo存储的可以是复杂类型,比如数组.对象等mysql不善于处理的文档型结构,并且聚合的操作也比mysql复杂很多. 注:本文基于 mo ...

  7. Python爬虫入门项目

    Python是什么 Python是著名的"龟叔"Guido van Rossum在1989年圣诞节期间,为了打发无聊的圣诞节而编写的一个编程语言. 创始人Guido van Ros ...

  8. JVM基础系列第14讲:JVM参数之GC日志配置

    说到 Java 虚拟机,不得不提的就是 Java 虚拟机的 GC(Garbage Collection)日志.而对于 GC 日志,我们不仅要学会看懂,而且要学会如何设置对应的 GC 日志参数.今天就让 ...

  9. redis 系列13 集合对象

    一. 集合对象概述 这里的集合是string类型的无序集合,在集合对象中集合成员是唯一的,这就意味着集合中不能出现重复的数据.集合是通过哈希表实现的,集合中最大的成员数为 232-1 (4294967 ...

  10. ubuntu16.04 Golang语言开发环境搭建

    golang即go语言是跨平台的语言,适用于windows 和linux平台,下面介绍linux平台下ubuntu16.04系统下的开发环境搭建过程. 一.安装开发必备环境 执行下面命令分别安装git ...