MySQL忘记root密码的找回方法
(1)登录到数据库所在服务器,手工kill掉MySQL进程:
kill ' cat /mysql-data-directory/hostname.pid'
[root@iZ28dr6w0qvZ mysql]# ./bin/mysqld_safe --skip-grant-tables --user=root &
[1] 17299
[root@iZ28dr6w0qvZ mysql]# 151006 13:14:41 mysqld_safe Logging to '/alidata/log/mysql/error.log'.
151006 13:14:41 mysqld_safe Starting mysqld daemon with databases from /alidata/server/mysql/data
[root@iZ28dr6w0qvZ ~]# mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.37-log MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set password = password('ysj123');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> update mysql.user set password=password('123456') where user='root' and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
[root@iZ28dr6w0qvZ ~]# mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@iZ28dr6w0qvZ ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.37-log MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL忘记root密码的找回方法的更多相关文章
- mysql忘记root密码的解决方法
Windows下mysql忘记root密码的解决方法 1. 首先检查mysql服务是否启动,若已启动则先将其停止服务,可在开始菜单的运行,使用命令:net stop mysql 或者在windows任 ...
- 【转】mysql忘记root密码的解决方法
本文收集于本人的笔记本,由于找不到原文出处.在此省略,如哪位知道可以联系我加上. 方法一:在windows下:1.打开命令行(DOS)窗口,停止mysql服务: net stop mysql 2.在D ...
- windows下的mysql忘记root密码的解决方法
1.首先,需要关闭MySQL Server服务.在"运行"窗口,输入"services.msc",进入"服务"窗口. 2. 在服务窗口,可以 ...
- mysql忘记root密码的处理方法
在linux下,如果忘记了mysql中root用户的密码可以采用以下办法解决. 1. 修改my.cnf,加入skip-grant-tables 修改mysql的配置文件my.cnf,在[mysqld] ...
- Windows下mysql忘记root密码的解决方法
1. 首先检查mysql服务是否启动,若已启动则先将其停止服务,可在开始菜单的运行,使用命令: net stop mysql 打开第一个cmd窗口,切换到mysql的bin目录,运行命令: mysql ...
- 关于Windows下mysql忘记root密码的解决方法
原文链接: http://www.cnblogs.com/andy_tigger/archive/2012/04/12/2443652.html 1. 首先检查mysql服务是否启动,若已启动则先将其 ...
- CentOS7下mysql忘记root密码的处理方法
1. vi /etc/my.cnf,在[mysqld]中添加 skip-grant-tables 例如: [mysqld] skip-grant-tables datadir=/var/lib/my ...
- mysql 忘记root 密码的解决方法
LINUX 1.切换root 用户 2.停止mysqld 服务 /etc/inid.d mysqld stop 3.跳过验证登录 mysqld_safe --skip-grant-tables &am ...
- Mac mysql 忘记root密码的解决方法
1.执行命令以安全模式启动MySQL cd /usr/local/mysql/bin sudo ./mysqld_safe --skip-grant-tables 2.同上面目录下执行 '\) whe ...
随机推荐
- C#:注册机的实现【提供源代码下载】
代码下载 C#软件注册机 软件运行结果 参考文章 http://www.cnblogs.com/hanzhaoxin/archive/2013/01/04/2844191.html
- Asp.Net实现FORM认证的一些使用技巧(转)
最近因为项目代码重构需要重新整理用户登录和权限控制的部分,现有的代码大体是参照了.NET的FORM认证,并结合了PORTAL KITS的登录控制,代码比较啰嗦,可维护性比较差.于是有了以下的几个需求( ...
- 【转】对 Xcode 菜单选项的详细探索(干货)
http://www.cocoachina.com/ios/20151204/14480.html 本文调研Xcode的版本是 7.1,基本是探索了菜单的每一个按钮.虽然从xcode4一直用到了xco ...
- MySQL vs. MongoDB: Choosing a Data Management Solution
原文地址:http://www.javacodegeeks.com/2015/07/mysql-vs-mongodb.html 1. Introduction It would be fair to ...
- [LeetCode] Find Median from Data Stream
Find Median from Data Stream Median is the middle value in an ordered integer list. If the size of t ...
- nginx location 的配置
一.基本语法:location [=|~|~*|^~] /uri/ { … } 二.分类: 1.基本location:以“ = ”或“ ^~ ”为前缀或者没有任何前缀的 /uri/ 2.正则locat ...
- javascript - 简单实现一个图片延迟加载的jQuery插件
最近在看一本书<Third-Party Javascript>很不错,推荐给大家,下载地址各位自己搜索了. 步骤: 1.打开google,鉴于google基本打不开,那么就打开这个网址吧. ...
- OAuth2.0和SSO授权
一.OAuth2.0授权协议 一种安全的登陆协议,用户提交的账户密码不提交到本APP,而是提交到授权服务器,待服务器确认后,返回本APP一个访问令牌,本APP即可用该访问令牌访问资源服务器的资源.由于 ...
- 使用PopupWindow实现Menu功能
参考:http://www.cnblogs.com/sw926/p/3230659.html 注意: PopupWindow会给PopupView设置Padding,会导致ContentView的左右 ...
- fflua更新-增加对引用的支持
简介: fflua 发布了有段时间了,很多网友都用了,并且提供了一些很好的反馈.其中一个就是c++接口注册到lua中时,对引用的支持.这样使用起来更加方便. 原有方式: fflua 中注册c++的类用 ...