解决mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)
一、问题
有时候我们登录Mysql输入密码的时候,会出现这种情况
mysql -u root -p
Enter Password > '密码'
错误:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
或者:错误:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
二、解决办法
修改my.in/my.cnf配置文件
进入mysql安装目录
编辑my.ini
在[mysqld]下添加skip-grant-tables,保存即可。
使用管理员身份打开命令行
①重启mysql:
1、net stop mysql 2、net start mysql
②进入mysql,登录
mysql -u root -p
不用输入密码,直接回车(出现Enter Password 也一样直接回车,即可登陆成功)
③输入use mysql,修改root的密码:
update user set authentication_string=password('新密码') where user='root';
flush privileges;
④退出:
quit;
⑤再次重启mysql:
1、net stop mysql 2、net start mysql
⑥测试是否成功就是是否登陆成功咯。
mysql -u root -p
Enter Password>'新密码'
就不会出错,可以登录啦!!!
解决mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)的更多相关文章
- Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE)
安装mysql后,使用命令登录mysql居然报错了,Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using ...
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO
MySQL安装完server端和客户端后,登录Mysql时报错:[root@rhel204 MySQL 5.6.23-RMP]# mysqlERROR 2002 (HY000): Can't conn ...
- 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Red Hat Enterpris ...
- 转-解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Red Hat Enterpr ...
- 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 -u root -p显示ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...
- ubuntu系统安装mysql登陆提示 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqoAAABtCAIAAADmldQYAAAe/0lEQVR4nO1dveslR3btzJGFk02GmU
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的解决办法和原因
这两天下载了MySQL5.7.11进行安装,发现到了初次使用输入密码的时候,不管怎样都进不去,即使按照网上说的在mysqld 下面添加skip-grant-tables也是不行,后来研究了两天,终于找 ...
- MySQL5.7使用错误解决:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)【取消或重设root密码】
解决方法: 最简单方法: ⑴打开mysql中的my.ini(如果没有就将my-default.ini复制一份,并修改为my.ini): ⑵在[mysqld]下面空白行直接添加skip-grant-ta ...
- 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 ...
随机推荐
- react 工程起步 安装chrome 开发调试工具 react developer tools 及初建一个react 项目...
1.安装react 开发工具 1.下载 chrome react developer tools 下载地址:https://pan.baidu.com/s/1eSZsXDC 下载好是 ...
- 解决layui动态追加的点击事件不起作用问题
2019独角兽企业重金招聘Python工程师标准>>> //不起作用 $('#demo').on('click', function() { layer.msg('响应点击事件'); ...
- centos6更换yum源和epel源
epel是yum的一个软件用源,包含了很多基本源中没有的软件,cobbler就属于基本源中没有的软件,所以需要安装epel源. yum源: wget -O /etc/yum.repos.d/CentO ...
- 动态调用webSerivce-简易方法
大家对webservice已经不再陌生了,涉及到的通信大部分都是用webservice.不过我还是看好wcf,因为毕竟是微软推出的新技术,各个方面还是蛮不错的,特别是你可以利用多种通信方式, ...
- 第六章第二十题(计算一个字符串中字母的个数)(Count the letters in a string) - 编程练习题答案
*6.20(计算一个字符串中字母的个数)编写一个方法,使用下面的方法头计算字符串中的字母个数: public static int countLetters(String s) 编写一个测试程序,提示 ...
- 【Kafka】配置文件说明
目录 server.properties producer.properties consumer.properties server.properties # broker的全局唯一编号,不能重复 ...
- [hdu5448 Marisa’s Cake]多边形面积,公式化简
题意:给一个凸多边形,求任选若干点形成的多边形的面积和. 思路: 按一定方向(顺时针或逆时针)对多边形的顶点进行编号,则多边形的面积计算公式为:f1 x f2 + f2 x f3 + ... fn-1 ...
- Gulp的代理转发插件
需求背景 前后端分开部署时,需要单独为前端启动一个服务,如果使用gulp-connect的话,那么代理需要额外的插件来配置.首先说下为什么需要代理,gulp-connect是静态web的server( ...
- flink入门学习
Flink学习笔记 一.简介 1.定义: 针对流数据和批数据的分布式处理引擎.它主要是由 Java 代码实现.. 2.应用场景: 流数据:把所有任务当成流来处理,处理观察和分析连续事件产生的数 ...
- 这些Kubernetes常见安全问题,你遇到过几个?
导语:在 Threat Stack 公布的2020年第一季度安全报告中,列举了在AWS Web服务部署Kubernetes的组织所遇到的最常见安全问题. 该报告建议已部署Kubernetes的IT组织 ...