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 ...
随机推荐
- mq引入以后的缺点
系统可用性降低? 一旦mq不能使用以后,系统A不能发送消息到mq,系统BCD无法从mq中获取到消息.整个系统就崩溃了. 如何解决: 系统复杂程度增加? 加入mq以后,mq引入来的问题很多,然后导致系统 ...
- 题解 洛谷P2258 【子矩阵】
应该很容易想到暴力骗分. 我们考虑暴力\(dfs\)枚举所有行的选择,列的选择,每次跑一遍记下分值即可. 时间复杂度:\(O(C_n^r \times C_m^c \times r \times c) ...
- 201671030116 宋菲菲 实验十四 团队项目评审&课程学习总结
项目 内容 作业所属课程 所属课程 作业要求 作业要求 课程学习目标 (1)掌握软件项目评审会流程:(2)反思总结课程学习内容 任务一:团队项目审核已完成.项目验收过程意见表已上交. 任务二:课程学习 ...
- Tomcat默认连接超时时间
秒=1小时 2. 在web.xml中通过参数指定: xml 代码 <session-config> <session-timeout>30</sessio ...
- 使用Navicat Premium 12导出SQL语句并在Power Designer 16.5中生成物理模型
内容简介 本文主要介绍使用Navicat Premium 12导出建表SQL(使用MySQL数据库)文件,并在Power Designer 16.5中使用导出的SQL文件来生成物理模型的步骤. 操作步 ...
- LightOJ - 1095 - Arrange the Numbers(错排)
链接: https://vjudge.net/problem/LightOJ-1095 题意: Consider this sequence {1, 2, 3 ... N}, as an initia ...
- postgresql Kill掉正在执行的SQL语句
kill方式是杀掉进程,但是有时候需要取消相关SQL语句,采用以下方式 一.查看哪些SQL语句正在执行 语句如下:SELECT datname,procpid,query_start, current ...
- YAML_06 playbook从上往下顺序执行,若报错,不提示,继续往下执行
ansible]# vim user4.yml --- - hosts: cache remote_user: root vars: user: bb tasks: - sh ...
- web之大文件断点续传
之前仿造uploadify写了一个HTML5版的文件上传插件,没看过的朋友可以点此先看一下~得到了不少朋友的好评,我自己也用在了项目中,不论是用户头像上传,还是各种媒体文件的上传,以及各种个性的业务需 ...
- EL运算符和基本运算
1.EL存取器:.和[] ${applicationScope.list[].name} 获取applicationScope中list集合的第二个元素的name属性. 2.三元运算符: ${> ...