===========================================================
二,忘记本地root的登录密码
解决过程:
1、编辑/mysql/my.ini
在[mysqld] 配置部分添加一行
skip-grant-tables
 
2、保存后重启mysql
[root@localhost etc]# service mysqld restart
Shutting down MySQL.                                       [  OK  ]
Starting MySQL.                                                   [  OK  ]

3、登录数据库重新设置root密码
[root@localhost ~]# mysql -u root -p mysql
Enter password:
直接回车进入

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.47-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

执行下列语句

mysql>use mysql;
mysql> update user set password=password("mysql") where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
4、删除/etc/my.cnf文件中添加的“skip-grant-tables”行,重启mysql;
用新设的密码就能正常登录了;

MySQL root密码重置 报错:mysqladmin: connect to server at 'localhost' failed的解决方案的更多相关文章

  1. MySQL忘记密码,或:root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案

    MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案   1  登陆失败,mysqladmin修改密码失败 ...

  2. MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案!

    -- ==================================================================== --  mysqladmin: connect to s ...

  3. MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed

    MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed 1.安装完MySQL设置root密码报错如下 [root@vm ...

  4. mysql修改密码与password字段不存在mysqladmin connect to server at localhost failed

    mysqladmin: connect to server at 'localhost' failed 停止mysql服务 systemctl stop mysql 安全模式启动 chown -R m ...

  5. mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'

    就当作自己忘记Mysql密码把,忘记密码的解决方法 一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Acce ...

  6. MYSQL登录错误:mysqladmin: connect to server at ‘localhost’ failed

    一.mysql登录错误 mysqladmin: connect to server at 'localhost' failed       error: 'Access denied for user ...

  7. mysqladmin: connect to server at 'localhost' failed

    1:mysqladmin: connect to server at 'localhost' failed 2: 3: 4:

  8. MariaDB:登陆报错:mysqladmin: connect to server at 'localhost' failed

    见图: 解决办法: /etc/init.d/mysqld stop mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended ...

  9. wamp5 忘记mysql root密码 重置方法

    wamp5比较恶心,忘记mysql root密码了,重新安装都没用,网上找了个文章可以修改root的密码. http://www.kuqin.com/database/20080306/4249.ht ...

随机推荐

  1. 图解Nosql(hbase)与传统数据库的区别

    图解Nosql(hbase)与传统数据库的区别http://www.aboutyun.com/thread-7804-1-1.html(出处: about云开发) 问题导读:1.nosql数据库能否删 ...

  2. 阿里公共DNS 正式发布了

    喜大普奔!集阿里巴巴集团众多优秀工程师开发维护的公共DNS---AliDNS终于上线啦!作为国内最大的互联网基础服务提供商,阿里巴巴在继承多年优秀技术的基础上,通过提供性能优异的公共DNS服务,为广大 ...

  3. 2013年8月份第3周51Aspx源码发布详情

    BaiduMusic Cache源码  2013-8-23 [VS2012]功能介绍:可以读取并保存百度音乐(Win8应用程序商店版本)的缓存.可以检测电脑是否安装了百度音乐,支持缓存音乐的导出功能. ...

  4. 算法(第4版)-1.1.1 Java程序的基本结构

    开始之前,引用书中的一段话: "学习算法的主要原因是它们能节约非常多的资源,甚至能够让我们完成一些本不可能完成的任务.在某些需要处理上百万个对象的应用程序,设计优良的算法甚至可以将程序运行的 ...

  5. swift系统学习第二章

    第五节:可选类型 optional //: Playground - noun: a place where people can play import UIKit /* Swift学习第五节 可选 ...

  6. coreData旧版本增加字段,新版本是否可以继续使用旧版本内容的测试(MagicalRecord的使用)

    coreData使用第三方库MagicalRecord, 参考文章:http://blog.csdn.net/kuizhang1/article/details/21200367 coreData数据 ...

  7. IOS 封装类的时候注释格式,使用的时候可以想官方库一样快捷显示

    /** @brief 详情 @param 参数 @note 注意 @return 返回值类型 @code 这里写例题代码 @endcode @see 相似的方法参考 */

  8. 浅谈Android应用性能之内存

    本文来自http://blog.csdn.net/liuxian13183/ ,引用必须注明出处! 文/ jaunty [博主导读]在Android开发中,不免会遇到许多OOM现象,一方面可能是由于开 ...

  9. MVC - Code First Migration Command line

    当开发MVC应用程序, 使用.NET Entity Framework的Code First model试, 若是需要将model层对象的改动更新进数据库, 需要使用Package Manager C ...

  10. 中级iOS开发面试题

    1:MVC的理解 MVC设计模式考虑三种对象:数据模型对象,视图对象和控制器对象. 数据模型:负责存储.定义.操作数据: 视图:展示数据给用户,和用户进行操作交互: 控制器:M与V的协调者,控制获取数 ...