重置linux mysql root密码
2.修改MySQL的登录设置:
# vi /etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
例如:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-grant-tables
保存并且退出vi。
3.重新启动mysqld
# /etc/init.d/mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
4.登录并修改MySQL的root密码
# /usr/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.23.56
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> USE mysql ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> flush privileges ;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
5.将MySQL的登录设置修改回来
# vi /etc/my.cnf
将刚才在[mysqld]的段中加上的skip-grant-tables删除
保存并且退出vi。
6.重新启动mysqld
# /etc/init.d/mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
重置linux mysql root密码的更多相关文章
- linux mysql root密码重置
MySQL安装解决方法:重改密码 先停止 Mysql # stop mysql 重要:输入下面的代码# mysqld_safe --user=mysql --skip-grant-tables --s ...
- MAC 重置MySQL root 密码
重置MySQL root 密码:当忘记密码,或者想要强行重置 MySQL 密码的时候,可以像下面这样: 1.停止 MySQL 服务 sudo /usr/local/mysql/support-file ...
- wamp5 忘记mysql root密码 重置方法
wamp5比较恶心,忘记mysql root密码了,重新安装都没用,网上找了个文章可以修改root的密码. http://www.kuqin.com/database/20080306/4249.ht ...
- 使用SKIP-GRANT-TABLES 解决 MYSQL ROOT密码丢失(转)
B.5.3.2 How to Reset the Root Password If you have never assigned a root password for MySQL, the ser ...
- 【wenqi】重置Centos 7 Root密码
重置Centos 7 Root密码的方式和Centos 6完全不同.下面展示一下到底如何操作. 1 - 在启动grub菜单,选择编辑选项启动 2 - 按键盘e键,来进入编辑界面 3 - 找到Linux ...
- 几种破解MySQL root密码的几种方法:
几种破解MySQL root密码的几种方法: 方法一 使用phpmyadmin,这是最简单的了,修改mysql库的user表,不过别忘了使用PASSWord函数. 方法二 使用mysqladmin,这 ...
- 不重启修改mysql root密码
不重启修改mysql root密码 --------------------2014/09/28 一.一般忘记密码的解决办法,需要重启Mysql1.skip-grant-tables我们常用的方法是使 ...
- Linux找回root密码
Linux忘记root密码时,密码重置步骤: 1.将虚拟机重启: 2.当进入GRUB倒计时界面,点击键盘e键: 3.点击键盘上下键选择第二行(kernel /vmlinuz-2.6.32-71.29. ...
- openSUSE Linux 忘记root密码的解决方法
openSUSE Linux 忘记root密码的解决方法 : 对于大部分linux发行版本,忘记root密码的时候,是可以通过单用户模式来重设密码的. 如在redhat/fedora 下,可以通过在启 ...
随机推荐
- 操作系统--IO系统任务简述
内核IO---操作系统对于IO的职责 1.对文件和设备命名空间的管理 2.文件和设备访问的控制 3.IO操作控制 4.文件系统的空间分配 5.设备分配 6.IO缓冲管理 7.IO调度方式 8.设备状态 ...
- Educational Codeforces Round 8 C. Bear and String Distance 贪心
C. Bear and String Distance 题目连接: http://www.codeforces.com/contest/628/problem/C Description Limak ...
- Microsoft SQL Server 2012 Internals
http://blog.csdn.net/column/details/learnsqlserver2012.html
- Linux操作系统下的常见系统资源共享
转:http://www.360doc.com/content/07/0420/10/25127_457022.shtml linux下如何挂接(mount)光盘镜像文件.移动硬盘.U盘.Window ...
- Android源代码编译apk导入第三方包报错
报错内容例如以下: make: *** 没有规则能够创建"out/target/common/obj/APPS/ AndroidWFS_intermediates/classes-full- ...
- zabbix3.2 报错 Database error
一.Database errorThe frontend does not match Zabbix database. Current database version (mandatory/opt ...
- ISP图像调试工程师——对比度增强(熟悉图像预处理和后处理技术)
经典对比度增强算法: http://blog.csdn.net/ebowtang/article/details/38236441
- Microsoft.Office.Workflow.Actions Namespace
Microsoft.Office.Workflow.Actions Namespace SharePoint 2010 Contains the workflow activities that ...
- DevExpress 项目目录列表参考(收集的 350个cs project)
DevExpress.ExpressApp.Tools\DBUpdater\DBUpdater.csproj DevExpress.BonusSkins\DevExpress.BonusSkins.c ...
- ssh远程连接
SSH 是Secure Shell protocol 的简写,经由将联机的封包加密的技术,来进行资料的传递,安全. telnet: tcp:23 基于字符 任意客户端登录远程服务器 明文 无需验证 易 ...