系统环境:centos
操作方法:
1.杀掉mysql进程
方法1、[root@localhost /]#killall mysqld
方法2、[root@localhost /]#ps -aux //查看所有进程,找到mysql进程的pid
然后
[root@localhost /]#kill pid //pid是mysql的进程号
2.用--skip-grant-tables参数启动mysqld
[root@localhost /]#/usr/local/mysql/bin/mysqld_safe --skip-grant-tables&
// 其中/usr..../bin是我的mysql安装目录
[root@localhost /]#/usr/local/mysql/bin/
[root@localhost /]# ./mysql
eg:
[root@localhost bin]# ./mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.60-log Source distribution
Copyright (c) 2000, 2011, 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> use mysql //切换到mysql database
mysql> UPDATE user SET password=password('123456') WHERE user='root';
//将root密码该为123456了
搞定!
分享到:
相关推荐
windows下忘记mysql的root用户密码详细解决方法
ubuntu 11.10 mysql忘记root密码解决
本文介绍了MySQL修改root密码的多种方法,忘记密码时,管理员可以在服务器上修改ROOT密码,防止忘记密码导致数据无法导出或使用工具连接数据库。
新装MySQL不知道密码,忘记MySQL密码,都可以安装该方法改过来,在Ubuntu和CentOS上用过多次。
mysql8.0及以上版本,root密码忘记解决方案,自己总结,亲自测试。
在实际工作中,忘记了mysql的ROOT 密码,可就糟糕了,本教程分步骤教会你如何重置ROOT密码,绝对能用!放心下载,一看就会!!
MySQL忘记root密码解决方案.docx
linux下mysql的root密码忘记解决方法
整理了以下四种在MySQL中修改root密码的方法
忘记mysql中root密码和zabbix登陆密码[整理].pdf
windows7下MySQL5.6忘记root密码方法,仅供参考
通常在使用Mysql数据库时,如果长时间没有登陆,或者由于工作交接完成度不高,会导致数据库root登陆密码忘记,本文给大家介绍一种当忘记mysql root密码时的解决办法,一起看看吧
mysql忘记root密码,重置密码
linux下mysql的root密码忘记解决方法.pdf
忘记mysql的root密码怎么办?
MySQL忘记密码的解决方法
在上篇文章给大家介绍了Mysql5.7忘记root密码及mysql5.7修改root密码的方法 Mysql5.7忘记密码快速且简单的解决方法,具体方法详情如下所示: # 最简单最粗暴的方法 找到mysql的配置文件直接编辑 vim /etc/my.cnf #...
如果你忘记了mysqlroot密码 这个文档可以帮助你找回密码
方法一: 1、在DOS窗口下输入net stop mysql5 或 net stop mysql 2、开一个DOS窗口,这个需要...3、再开一个DOS窗口,mysql -u root 4、输入: 代码如下: use mysql update user set password=password(“new_pa
windows下忘记mysql的root用户密码详细解决方法.docx