首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 數據庫知識 >  >> MySQL 資料庫 >> MySQL 綜合教學

MySQL 5.6 Root 密碼丟失重置:Windows 下 mysqld --skip-grant-tables 完整流程

     編輯:MySQL 綜合教學

MySQL 5.6 Root 密碼丟失重置:Windows 下 mysqld --skip-grant-tables 完整流程

現象

啟動報警:[Warning] TIMESTAMP with implicit DEFAULT value is deprecated...

修復步驟

  1. 停止服務:net stop mysql(服務名視實際而定);
  2. 編輯 my.ini,在 [mysqld] 下添加:
    explicit_defaults_for_timestamp = true
  3. 手動啟動並跳過權限表:
    mysqld --defaults-file="D:\java\MySQL\ProgramData\MySQL Server 5.6\my.ini" --skip-grant-tables
  4. 無密碼登錄並重置:
    mysql -u root
    UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root' AND Host='localhost';
    FLUSH PRIVILEGES;
  5. 正常重啟服務驗證新密碼。
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved