本文主要给大家简单讲讲mysql5.6密码忘记了该如何恢复,相关专业术语大家可以上网查查或者找一些相关书籍补充一下,这里就不涉猎了,我们就直奔主题吧,希望mysql5.6密码忘记了该如何恢复这篇文章可以给大家带来一些实际帮助。
实验环境:
,,,, 1, centos7.3
,,,, 2, mysql5.6.35
实验描述:
,,,,原mysql仅根账号可以登录且有密码保护,现在密码已经忘记无法找回。今天的目标就是通过破解,重置mysql的根密码。
实验进行时:
,,,, 1,开始之前确定mysql不用密码已经不能登录了
(root@c73 mysql) #, mysql ERROR 1045, (28000):, Access denied for user & # 39;根# 39;@ # 39;localhost # 39;,(密码:using 没有) (root@c73 mysql) # (root@c73 ~) #, mysql -u root -p654321 //用654321这个密码也进不了。 警告:,Using a  password 提醒,command line interface 还要be 没有安全感。 ERROR 1045, (28000):, Access denied for user & # 39;根# 39;@ # 39;localhost # 39;, (using 密码:,YES)
,,,, 2,跳过授权进入mysql
(root@c73 mysql) #, systemctl stop mysql //停止mysql//由于我本身使用的是根账号,mysql运行需要mysql账号所以,增加了——用户=mysql,//这里主要是使用,skip-grant-tables参数跳过授权表 (root@c73 mysql) #, mysqld ——用户=mysql ——skip-grant-tables 及 [1],6022 (root@c73 mysql) #, 2017 - 04 - 11, 09:36:41 0,[警告],TIMESTAMP with implicit DEFAULT value is 弃用只Please use ——explicit_defaults_for_timestamp server option (阅读documentation for more 细节)。 2017 - 04 - 11,09:36:41 0,[注],mysqld (mysqld 5.6.35), starting as process 6022年,… 2017 - 04 - 11,09:36:41 6022年,[注],Plugin & # 39;联邦# 39;is 残疾。 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Using atomics 用ref count buffer pool 页面 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:,, InnoDB memory heap is 禁用 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Mutexes 以及rw_locks use GCC atomic 内置命令 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Memory barrier is not 使用 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Compressed tables use zlib 1.2.3 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB: Using Linux native AIO 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB: Using CPU crc32 指令 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Initializing buffer 池,size =128.0 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Completed initialization of buffer 池 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Highest supported file format is 梭鱼。 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, 128, rollback 段(s),断开连接,活跃。 2017 - 04 - 11,09:36:41 6022年,[注],InnoDB:, Waiting for purge 用开始 2017 - 04 - 11,09:36:42 6022年,[注],InnoDB:, 5.6.35 开始;log sequence number 1626007 2017 - 04 - 11,09:36:42 6022年,[注],Server hostname (bind-address):, & # 39; * & # 39;;,端口:3306 2017 - 04 - 11,09:36:42 6022年,[注],IPv6 is 可用。 2017 - 04 - 11,09:36:42 6022年,[注],,,女人;& # 39;::& # 39;,resolves 用& # 39;::& # 39;; 2017 - 04 - 11,09:36:42 6022年,[注],Server socket created 提醒IP:, & # 39;:: & # 39;。 2017 - 04 - 11,09:36:42 6022年,[注],mysqld: ready for 连接。 版本:& # 39;5.6.35& # 39;,,套接字:,& # 39;/var/lib/mysql/mysql.sock& # 39;,,端口:,3306,,MySQL Community Server (GPL) (root@c73 mysql) #, netstat -lnpt | grep 3306年,//确定服务开启成功 tcp6 ,,,,,, 0,,,,,, 0,::: 3306,,,,,,,,,,,,,,,,,::: *,,,,,,,,,,,,,,,,,,,, LISTEN ,,,,, 6022/mysqld ,,,,,,,, (root@c73 mysql) #, mysql ,//无密码进入mysql Welcome 用,MySQL 监控只,Commands 最终获得with ,趁机\ g。 Your MySQL  connection id  is 1 版本:Server 5.6.35 MySQL  Community Server (GPL) null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null nullmysql5.6密码忘记了该如何恢复