008-MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)
1、新安装的mysql报错
MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)

解决方案
1、先停掉原来的服务
/etc/init.d/mysqld stop
2、使用安全模式登陆,跳过密码验证
mysqld_safe --user=mysql --skip-grant-tables --skip-networking&
或者上述两步可以使用如下操作
在mysql的配置文件内加入:
vim /etc/my.cnf
skip-grant-tables
保存并重启mysql服务
3、进入mysql,修改密码:
mysql> use mysql;
mysql> update user set password=password("你的新密码") where user="root";
mysql> flush privileges;
mysql> quit
到此root账户就重置了密码,
注意:如果使用配置文件了,需要删除etc/my.cnf中,刚添加的那行内容,重启mysql就好了
更新密码出错
mysql> update user set password=password("你的新密码") where user="root";
报错:ERROR 1054 (42S22): Unknown column 'password' in 'field list'
解决措施如下:
mysql>desc user;
发现在Field列中没有password,此时我们需要这样重置密码:
mysql>update user set authentication_string=password('123456') where user='root';
008-MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)的更多相关文章
- 连接mysql报错Access denied for user 'root'@'localhost' (using password: YES)解决办法
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”(免密码登录),保存并关闭文件,重启MySQL服务. 2.通过命令行进入MySQL的BIN目录,输 ...
- MySQL登录报错"Access denied for user 'root'@'localhost' (using password: YES)"
最近登录MySQL时候总报错: # mysql -uroot -p Enter password: ERROR (): Access denied for user 'root'@'localhost ...
- linux下mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
最近登录某台服务器的mysql时候总报错: Access[root@log01 ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Acc ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...
- 连接数据库报错Access denied for user 'root'@'localhost' (using password:YES)
报错信息为:pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using pa ...
- 运行JavaWeb项目报错Access denied for user 'root'@'localhost' (using password: YES)
问题重现:(以下讨论范围仅限Windows环境): C:\AppServ\MySQL> mysql -u root -p Enter password: ERROR 1045 (28000): ...
- 最新 mysql登录报错“Access denied for user 'root'@'localhost' (using password: NO”的处理方法
1.关闭正在运行的MySQL.2.打开DOS窗口,转到mysql\bin目录.3.输入mysqld --skip-grant-tables回车.如果没有出现提示信息,那就对了.(正常的情况是光标闪烁没 ...
- MySQL5.7.20报错Access denied for user 'root'@'localhost' (using password: NO)
在centos6.8上源码安装了MySQL5.7.20,进入mysql的时候报错如下: 解决办法如下: 在mysql的配置文件内加入: vim /etc/my.cnf skip-grant-tabl ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法
使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 文件内容: [client]host = localhostuser = debian-sys-maint ...
随机推荐
- JQuery实现品牌展示
最近验收了ITOO,老师当时验收的时候对于界面的设计非常敏感,只要看了一个大体轮廓,就能给出我们建议,这是二十年积累的经验,我们要做的就是站在巨人的肩膀上,让我们成长更快! 老师说了一下关于界面设计的 ...
- docker 进程 转载:
今天我们会分析Docker中进程管理的一些细节,并介绍一些常见问题的解决方法和注意事项. 容器的PID namespace(名空间) 在Docker中,进程管理的基础就是Linux内核中的PID名空间 ...
- Backpack III
Description Given n kinds of items, and each kind of item has an infinite number available. The i-th ...
- 学习Spring-Data-Jpa(四)---Naming命名策略,源码跟踪
1.首先在Entity实体中,命名方式有两种: 一种是显示命名,即通过@Table的name属性指定对应的数据库表名称,@Column的name属性指定实体字段对应数据库字段的名称. 另一种是隐式命名 ...
- 微信网站防屏蔽防红的措施以及微信域名检测API等工具的技术原理
为什么关心这种技术?因为我经常听到身边搞微商.搞微信项目的朋友都在叫苦连天,由于微信域名屏蔽.微信域名被拦截.弄得他们尸横遍野,损失的连过年回家的路费都没了,曾经的叱咤风云一下变成了今日的倒亏损.腾讯 ...
- PHP流程控制之goto语法
自 PHP 5.3.0 起,还可以使用 goto 来跳出循环. 在本章开始的章节,我们讲解到一个故事,王同学每周往返,但有一个特例:直线电机滑台 项目失败后或者集团临时除知除外,他就可以不再这么每周往 ...
- WinDbg 图形界面功能(一)
当我们启动windbg后,我们就能看到Windbg的样子了,如下: 本部分讨论 WinDbg 图形用户界面的元素. 这些元素包括以下各项:菜单.工具栏和快捷键.菜单有:文件菜单.编辑菜单.视图菜单.调 ...
- AQS面试题
问:什么是AQS? 答:AQS的全称为(AbstractQueuedSynchronizer),这个类在java.util.concurrent.locks包下面.AQS是一个用来构建锁和同步器的框架 ...
- C利用time函数实现简单的定时器
//定时器 #include <stdio.h> #include <time.h> #include <stdlib.h> int main(int num, c ...
- codevs:1313 质因数分解:已知正整数 n是两个不同的质数的乘积,试求出较大的那个质数 。
#include<iostream>#include<cstdio>#include<cmath>using namespace std;int a[2];int ...