hti 发表于 2018-9-30 06:19:59

mysql5.6忘记密码的恢复方法

# systemctl stop mysql //停止mysql  
//由于我本身使用的是root账号,mysql运行需要mysql账号所以,增加了--user=mysql,
  
//这里主要是使用--skip-grant-tables参数跳过授权表
  
# mysqld --user=mysql --skip-grant-tables &
  
6022
  
# 2017-04-11 09:36:41 0 TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  
2017-04-11 09:36:41 0 mysqld (mysqld 5.6.35) starting as process 6022 ...
  
2017-04-11 09:36:41 6022 Plugin 'FEDERATED' is disabled.
  
2017-04-11 09:36:41 6022 InnoDB: Using atomics to ref count buffer pool pages
  
2017-04-11 09:36:41 6022 InnoDB: The InnoDB memory heap is disabled
  
2017-04-11 09:36:41 6022 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  
2017-04-11 09:36:41 6022 InnoDB: Memory barrier is not used
  
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 instructions
  
2017-04-11 09:36:41 6022 InnoDB: Initializing buffer pool, size = 128.0M
  
2017-04-11 09:36:41 6022 InnoDB: Completed initialization of buffer pool
  
2017-04-11 09:36:41 6022 InnoDB: Highest supported file format is Barracuda.
  
2017-04-11 09:36:41 6022 InnoDB: 128 rollback segment(s) are active.
  
2017-04-11 09:36:41 6022 InnoDB: Waiting for purge to start
  
2017-04-11 09:36:42 6022 InnoDB: 5.6.35 started; log sequence number 1626007
  
2017-04-11 09:36:42 6022 Server hostname (bind-address): '*'; port: 3306
  
2017-04-11 09:36:42 6022 IPv6 is available.
  
2017-04-11 09:36:42 6022    - '::' resolves to '::';
  
2017-04-11 09:36:42 6022 Server socket created on IP: '::'.
  
2017-04-11 09:36:42 6022 mysqld: ready for connections.
  
Version: '5.6.35'socket: '/var/lib/mysql/mysql.sock'port: 3306MySQL Community Server (GPL)
  

  
# netstat -lnpt|grep 3306 //确定服务开启成功
  
tcp6       0      0 :::3306               :::*                  LISTEN      6022/mysqld
  
# mysql//无密码进入mysql
  
Welcome to the MySQL monitor.Commands end with ; or \g.
  
Your MySQL connection id is 1
  
Server version: 5.6.35 MySQL Community Server (GPL)
  

  
Copyright (c) 2000, 2016, 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> //成功进入^_^


页: [1]
查看完整版本: mysql5.6忘记密码的恢复方法