linux安装完mysql后,使用程序连接报以上错误
解决方法,重新设置密码,步骤如下

1.先停掉原来的服务

service mysqld stop

2.使用安全模式登陆,跳过密码验证

mysqld_safe --user=mysql --skip-grant-tables --skip-networking&

3.登陆

mysql -uroot  mysql

4.修改密码

mysql  > update user set authentication_string = password('123456')
where user = 'root' and Host = 'localhost'

5.刷新权限

mysql > flush privileges;

6.重新使用正常模式登陆

#mysql -uroot -p
#enter password : 123456

可以正常登陆。

7.执行其他命令:show databases; 提示如下错误

You must reset your password using ALTER USER statement
before executing this statement.

8.重新将密码设置一遍即可

mysql > set password = password ('123456');

9.配置完成。

linux mysql access denied for user ‘root’@’localhost'(using password:YES)的更多相关文章

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

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

  2. mysql Access denied for user root @localhost (using password:YES)错误

    C:\AppServ\MySQL> mysql -u root -p Enter password:  ERROR 1045 (28000): Access denied for user 'r ...

  3. mysql—Access denied for user 'root'@'localhost' (using password:NO)

    安装mysql未设置初始密码,登录提示Access denied for user 'root'@'localhost' (using password:NO): 解决方案:  sudo /etc/i ...

  4. Web项目打成war包部署到tomcat时报MySQL Access denied for user 'root'@'localhost' (using password: YES)错误解决方案

    Web项目使用使用root账号root密码进行部署,通过Eclipse加载到Tomcat服务器可以发布成功,打成war包放到tomcat的webapps目录无法发布成功,报错: jdbc.proper ...

  5. Access denied for user 'root'@'localhost' (using password: YES)的解决

    今天使用phpmyadmin登录远程数据库所以改了一些配置,结果回过头来登录本地mysql时来了一句mysql Access denied for user 'root'@'localhost' (u ...

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

  7. 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'(us ...

  8. 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...

  9. Linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) "

    前言 作者在2021-07-21时遇到 linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localh ...

随机推荐

  1. volley2--volley的使用和架构

    图片: 下面只是笼统的介绍,大家可以对比自己的想法,看看自己是不是有什么考虑不周的(如果是你实现这样一个框架的话) 1,Request的设计,我们在得到response之后,我们可能根据项目需求希望有 ...

  2. Xshell启动时显示丢失MSVCP110.dll

    重装系统,装完Xshell5启动时,出现丢失MSVCP110.dll文件 这种情况不要相信网上所说的什么下载“MSVCP110.dll”文件或者下载微软的vcredist 2012 这样没用 正确的姿 ...

  3. .net core系列之《.net core中使用MySql以及Dapper》

    当我们决定使用.Net Core开发的时候,就放弃使用SqlServer的打算吧.那应该选择哪个数据库呢?一般选择MySql的比较多. 接下来我们来演示在.Net Core中使用MySQL吧. 1.原 ...

  4. SqlServer数据库(可疑)的解决办法

    当数据库发生这种操作故障时,可以按如下操作步骤可解决此方法, 打开数据库里的Sql 查询编辑器窗口,运行以下的命令. // 1.使用指定值强制重新配置:(1.0表示为真假) sp_configure ...

  5. Delphi IDHTTP用法详解

    一.IDHTTP的基本用法  IDHttp和WebBrowser一样,都可以实现抓取远端网页的功能,但是http方式更快.更节约资源,缺点是需要手动维护cook,连接等  IDHttp的创建,需要引入 ...

  6. [翻译] MSAlertController

    MSAlertController You can use AlertController in iOS7!! 你可以在iOS中使用AlertController了 MSAlertController ...

  7. MFC连接Mysql数据库执行查询和插入

    配置环境: include:mysql.h文件 lib:libmysql.lib文件 dll::libmysql.dll文件 连接代码: MYSQL m_sqlCon; MYSQL_RES *m_re ...

  8. December 25th 2016 Week 53rd Sunday

    Patience is bitter, but its fruit is sweet. 忍耐是痛苦的,但它的果实是甜蜜的. What can we do if there is no fruit of ...

  9. java查找字符串里与指定字符串相同的个数

    public class EmployeeDemo { //方法一: public int search(String str,String strRes) {//查找字符串里与指定字符串相同的个数 ...

  10. 7、Python文件操作工具 openpyxl 工具 2

    创建一个工作簿 使用openpyxl没有必要先在系统中新建一个.xlsx,我们需要做的只需要引入Workbook这个类,接着开始调用它. >>> from openpyxl impo ...