MySQL root密码重置 报错:mysqladmin: connect to server at 'localhost' failed的解决方案
===========================================================
二,忘记本地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的解决方案的更多相关文章
- MySQL忘记密码,或:root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案
MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案 1 登陆失败,mysqladmin修改密码失败 ...
- MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案!
-- ==================================================================== -- mysqladmin: connect to s ...
- MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed
MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed 1.安装完MySQL设置root密码报错如下 [root@vm ...
- mysql修改密码与password字段不存在mysqladmin connect to server at localhost failed
mysqladmin: connect to server at 'localhost' failed 停止mysql服务 systemctl stop mysql 安全模式启动 chown -R m ...
- 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 ...
- MYSQL登录错误:mysqladmin: connect to server at ‘localhost’ failed
一.mysql登录错误 mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user ...
- mysqladmin: connect to server at 'localhost' failed
1:mysqladmin: connect to server at 'localhost' failed 2: 3: 4:
- 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 ...
- wamp5 忘记mysql root密码 重置方法
wamp5比较恶心,忘记mysql root密码了,重新安装都没用,网上找了个文章可以修改root的密码. http://www.kuqin.com/database/20080306/4249.ht ...
随机推荐
- javascript prototype 剖析
学过javascript的一定对prototype不陌生,但是这个究竟是个什么东西,就不一定很清楚. 我们先对prototype进行一个定义:每个函数都有一个prototype属性,这个属性是指向一个 ...
- ZOJ 2672 Fibonacci Subsequence(动态规划+hash)
题意:在给定的数组里,寻找一个最长的序列,满足ai-2+ai-1=ai.并输出这个序列. 很容易想到一个DP方程 dp[i][j]=max(dp[k][i])+1. (a[k]+a[i]==a[j], ...
- Canopy使用教程 (2)
1.下载https://reputation.alienvault.com/reputation.data alienvault公司的IP信誉数据库文件到本地,手动或者wget 2.使用 read_c ...
- Note_Master-Detail Application(iOS template)_06_ YJYDetailViewController.h
// YJYDetailViewController.h #import <UIKit/UIKit.h> @interface YJYDetailViewController : UIV ...
- C++11 std::copy
这个函数并不是简单的 while(first != last) { *result = *first; result++; first++; } 事实上这种写法是最具普适性的,值要求inputIter ...
- Python ~~~ 面向对象的利器
class Rectangle(): # 有没有括号都行 . def __init__(self,x,y): self.x=x self.y=y def getPeri(self): def getA ...
- Testing the CATCHER_DP
Description A military contractor for the Department of Defense has just completed a series of preli ...
- 图例解析四大UML关系【转】
转自http://developer.51cto.com/art/201007/209644.htm 本文和大家重点讨论一下UML关系图,UML中有五类图,共有九种图形,UML类之间的UML关系图你是 ...
- 转:UniqueID和ClientID的来源
转:http://www.cnblogs.com/GrayZhang/archive/2009/03/05/how-uniqueid-is-generated.html 在<漫话ID>一文 ...
- SQL中使用WITH AS提高性能-使用公用表表达式(CTE)简化嵌套SQL
转:http://wudataoge.blog.163.com/blog/static/80073886200961652022389/ 一.WITH AS的含义 WITH AS短语,也叫做子 ...