linux连接mysql 出现Access denied for user 'root'@'localhost'(using password: YES)错误解决方案
linux连接mysql /usr/local/mysql/bin/mysql -uroot -p
输入密码出现Access denied for user 'root'@'localhost'(using password: YES)错误。
解决办法:
1.先停止mysql 服务
service mysqld stop
2.进入mysql安装目录bin/ 使用safe模式,进行重启:
./mysqld_safe --skip-grant-tables
3.新开一个终端,使用root账户,无密码登录,修改root用户密码
/usr/local/mysql/bin/mysql -uroot
use mysql
update user set password=PASSWORD("你的密码") where User = 'root';
5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string
update user set authentication_string=PASSWORD("你的密码") where User = 'root';
4.重启mysql,正常登录
service mysqld restart 重启
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhwAAAA7CAYAAAAwyFPbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA2jSURBVHhe7Z1tkuO4DYbnPHMVXyROpSqp3WSz2fntg/gcc7gOQREiCAIgpZa6rem3pp6aFj8B0hJeURb97cePH2/fvn27DrfH28+fPxeed7sM2M/3+9vzccvj/Lx/t8sAAAAAW7EEx/f7swT159v9e5v3qVAwFDbdHj/fHrf690fZS30dHYy32L+//9vbo4g1t34RHPQZ4LG9GmfMzxWo5+2M/+WzANEOAPgoPMHxWRfs+/PxdjPSic4udRd+f76YQNrIR9kfzi+tIF1ccHx15s/fJDpeTHBE5/8RnN0+ACBgi+C4P+vdE5VZ7qbaE5jLWHlhfl69kHkLMujdHhyQ7Tv1HLBvsp0+gEf2jfyraf4dZNN+sue54YI+sj/qn/MeD/HIyRh/LmvZv6yyKDYGpNB/Pceq7Wj8pW3ZduPR2sz8ND6meo3IG9jnwvVSW8vnMtm82lfmYG279rfaK/oZfX5k/uNmr1J486v9y/VnfUxE85PLTIyf65+uW2hEr5zzhPYxtG+mfQDAufy1dYWDT3q+UKRjPmnphG/qUVlx0RnlL2XEBUzBgoOCRu4z1ZftLRccHUBqezP95zTHP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c4gtE/qw4AAICvw38gOMARRKICggMAAID8LRUAdgPBAQAAIOK/VxMccj+Kg98yAQnejGzrq70QHAAAACIswfGyr+00r422234vr6R+jL16R9Aj2GL//v4nXlsqgoM+A5te64XgAAAAEGE9UvnMjUmi3x/p7FJ34Xrr8qvxUfaH80srSBAcAAAAjsb60qgXkHjTLMqjMssqSCsQmo21jE2r3Pxmq/CKDHr1d0TsO/UcsG+ynT6AR/aN/Ktp/gpB0z5tnb7hsc/I/qh/zns85Bbo/fhzWcv+ZZVFMWs/BAcAAIAIax8OLyBl+DsUHIjSMYsCCrZNPSorAtYofyljB0mCBQcFxtxnqi/bW4K9CNJZxNT2ZvrPaY5/jDc+Oj0HcN1+wMh+JupfC6QZOxvKmG7+GXwIDgAAABHW1uYzAalLL8/+dfoauEb55XhGcKyPHpQtFLAtcZDTJvt3/RP441NXXhZ8XyxC+1Wa1X9X1vHFt7/mQXAAAAA4lH/8dT3BkdvioN6soPRBcg3CHyI4FKmtbSscgf0qzeq/K7tJcGixtDDlJwHBAQAAIOLvfx4kOBJ9wExBLBQEbX5XhgL2xCMCJj+SkO1lYVLrz/T/HsHRtU/2GyLHY2Q/4/VP6UescFAbkfAzgeAAAAAQcf9jVnDYd8BNgJMrD3vyiSwyOF8FvU5A1Pr8WunjUb9Y2X1pNOx/5J+dL23MgsHJGzG2P+6f5ozTss1iHPVcRoKDV3wgOAAAABzK36YFx2sgA+uW1QNQGQsOY+VnBAQHAACACG+FYwnqaoUAXJy6SnK4oITgAAAA4PLt7f80R7xasFaQIAAAAABJRU5ErkJggg==" alt="" />
/usr/local/mysql/bin/mysql -uroot -p 然后输入刚才重置的密码
完成,连接成功!
linux连接mysql 出现Access denied for user 'root'@'localhost'(using password: YES)错误解决方案的更多相关文章
- MySQL 出现 Access denied for user 'root'@'localhost' (using password: YES) 错误
登录某台服务器的mysql时候总报错: mysql2/client.rb:58:in `connect': Access denied for user 'root'@'localhost' (usi ...
- Web项目打成war包部署到tomcat时报MySQL Access denied for user 'root'@'localhost' (using password: YES)错误解决方案
Web项目使用使用root账号root密码进行部署,通过Eclipse加载到Tomcat服务器可以发布成功,打成war包放到tomcat的webapps目录无法发布成功,报错: jdbc.proper ...
- mariadb mysql 报'Access denied for user 'root'@'localhost' (using password: NO)'错误的解决
C:\Program Files\MariaDB 10.2\bin>mysql admin -u root password "x123456789" mysql Ver 1 ...
- linux下mysql出现Access denied for user 'root'@'localhost' (using password: YES)解决方法
# /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # my ...
- mysql中Access denied for user 'root'@'localhost' (using password:YES)错误
此错误主要是由于你的系统曾经装过MYSQL,在重装就会要求输入原来设定的密码 由于输入错误导致 解决办法见 上一篇博客 MYSQL安装时解决要输入current root passwo ...
- Windows系统下MySQL数据库出现Access denied for user 'root'@'localhost' (using password:YES) 错误
Windows系统下MySQL数据库出现Access denied for user 'root'@'localhost' (using password:YES) 错误,(root密码错误) 处理方 ...
- mysql登录:access denied for user 'root'@'localhost'(using password:YES)
mysql登录: access denied for user 'root'@'localhost'(using password:YES) 解决: use mysql; select user,ho ...
- MySQL出现Access denied for user ‘root’@’localhost’ (using password:YES)
连接时MySQL出现了下面的错误: Access denied for user ‘root’@’localhost’ (using password:YES) 解决的办法是先停止MySQL服务,在m ...
- 安装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 ...
随机推荐
- springboot+rabbitmq例子
demo目录 贴代码 1.ProducerConfig.java package com.test.config; import org.springframework.amqp.core.Bindi ...
- dataTables 使用整理
官方网站:http://www.datatables.net/ 简介:DataTables是一个jQuery的表格插件.这是一个高度灵活的工具,依据的基础逐步增强,这将增加先进的互动控制,支持任何HT ...
- 小白的Python之路 day4 装饰器前奏
装饰器前奏: 一.定义: 1.装饰器本质是函数,语法都是用def去定义的 (函数的目的:他需要完成特定的功能) 2.装饰器的功能:就是装饰其他函数(就是为其他函数添加附加功能) 二.原则: 1. 不能 ...
- InnoDB 逻辑存储结构
本文同时发表在https://github.com/zhangyachen/zhangyachen.github.io/issues/80 如果创建表时没有显示的定义主键,mysql会按如下方式创建主 ...
- ArcGIS API for JavaScript 4.2学习笔记[25] 官方第八章Analysis(空间查询)概览与解释
开森,最关注的空间分析章节终于到了,在空间查询那节逻辑性的代码简直要命(呵呵,空间分析的代码也要命...). 上目录截图: [Geodesic buffers(GeometryEngine)] 使用G ...
- 【ASP.NET MVC系列】浅谈NuGet在VS中的运用
一 概述 在我们讲解NuGet前,我们先来看看一个例子. 1.例子: 假设现在开发一套系统,其中前端框架我们选择Bootstrap,由于选择Bootstrap作为前端框架,因此,在项目中,我们 ...
- Visual Studio 我的插件
为了以后开发方便,自己记录下好用的Visual Studio 扩展 1.outline if折叠 2.Indent Guides 代码块虚线 3.CodeMaid 大文件里能够重构文件,快速定位方法. ...
- application19事件 20多少步骤 具体20多少只有微软知道!!!
- python (5分钟实现一个游戏的屏蔽敏感字系统,)
import datetime time=datetime.datetime.now() dirty= ['fuck','狗日的','犊子','麻批','仙人板板','R你妈','操你','草你',' ...
- js间隔几秒弹出一次联系框
运行效果截图如下: 在线演示地址如下: http://demo.jb51.net/js/2015/js-3-sec-alert-dlg-codes/ 具体代码如下: <html> < ...