• <span id="ycodp"></span>
    <span id="ycodp"><small id="ycodp"></small></span>
    1. <label id="ycodp"></label>
      <rt id="ycodp"><tr id="ycodp"><strike id="ycodp"></strike></tr></rt>
      <i id="ycodp"><strong id="ycodp"><ul id="ycodp"></ul></strong></i>
    2. 幫助中心

      這里有最新的使用文檔和教程

      < 返回

      Windows下mysql忘記root密碼的解決方法

      2023-05-01 23:10 作者:31IDC 閱讀量:3477 所屬分類:Windows系統(tǒng)

      Windowsmysql忘記root密碼的解決方法:

      Windows下mysql忘記root密碼的解決方法

      Mysql版本:5.1.55-community MySQL Community Server (GPL)

       

      1、 首先檢查mysql服務(wù)是否啟動(dòng),若已啟動(dòng)則先將其停止服務(wù),可在開(kāi)始菜單的運(yùn)行,使用命令:

      net stop mysql

      或者在windows任務(wù)管理器中結(jié)束mysqld.exe進(jìn)程,或者在控制面板,管理工具里面的服務(wù)找到mysql,將其停止服務(wù)。

       

      打開(kāi)第一個(gè)cmd窗口,切換到mysqlbin目錄,運(yùn)行命令:

      mysqld --defaults-file="C:Program FilesMySQLMySQL Server 5.1my.ini" --console --skip-grant-tables

      注釋:

      該命令通過(guò)跳過(guò)權(quán)限安全檢查,開(kāi)啟mysql服務(wù),這樣連接mysql時(shí),可以不用輸入用戶密碼。

      "C:Program FilesMySQLMySQL Server 5.1my.ini"指配置文件my.ini,一般在mysql安裝目錄里面。

      如:

      ===============================================================================

      C:Program FilesMySQLMySQL Server 5.1bin>mysqld --defaults-file="C:Program FilesMySQLMySQL Server 5.1my.ini" --console --skip-grant-tables

      110301 9:20:07 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.

      110301 9:20:07 [Note] Plugin 'FEDERATED' is disabled.

      110301 9:20:07 InnoDB: Initializing buffer pool, size = 46.0M

      110301 9:20:07 InnoDB: Completed initialization of buffer pool

      110301 9:20:07 InnoDB: Started; log sequence number 0 44233

      110301 9:20:07 [Note] mysqld: ready for connections.

      Version: '5.1.55-community' socket: '' port: 3306 MySQL Community Server (GPL)

       

       

      2、打開(kāi)第二個(gè)cmd窗口,連接mysql

      輸入命令:

      mysql -uroot -p

      出現(xiàn):

      Enter password:

      在這里直接回車,不用輸入密碼。

      然后就就會(huì)出現(xiàn)登錄成功的信息,

      如:

      ===============================================================================

      Welcome to the MySQL monitor. Commands end with ; or g.

      Your MySQL connection id is 3

      Server version: 5.1.55-community MySQL Community Server (GPL)

       

      Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

      This software comes with ABSOLUTELY NO WARRANTY. This is free software,

      and you are welcome to modify and redistribute it under the GPL v2 license

       

      Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

       

      mysql>

       

      ===============================================================================

      使用命令:

      show databases;

      顯示已有數(shù)據(jù)庫(kù):

      +--------------------+

      | Database |

      +--------------------+

      | information_schema |

      | mysql |

      | test |

      +--------------------+

      3 rows in set (0.00 sec)

       

      使用命令切換到mysql數(shù)據(jù)庫(kù):

      use mysql;

      使用命令更改root密碼:

      UPDATE user SET Password=PASSWORD('newpassword') where USER='root';

       

      刷新權(quán)限:

      FLUSH PRIVILEGES;

      然后退出,重新登錄:

      quit

      重新登錄:

      mysql -uroot -p

      出現(xiàn)輸入密碼提示,輸入新的密碼即可登錄:

      Enter password: ***********

      顯示登錄信息:

      Welcome to the MySQL monitor. Commands end with ; or g.

      Your MySQL connection id is 9

      Server version: 5.1.55-community MySQL Community Server (GPL)

       

      Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

      This software comes with ABSOLUTELY NO WARRANTY. This is free software,

      and you are welcome to modify and redistribute it under the GPL v2 license

       

      Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

       

      mysql>

       

      到這里root密碼就已經(jīng)修改成功了,用Ctrl+C將第一個(gè)cmd窗口結(jié)束,那樣就會(huì)停止mysql服務(wù),如:

      =============================================================================== C:Program FilesMySQLMySQL Server 5.1bin>mysqld --defaults-file="C:Program F

      ilesMySQLMySQL Server 5.1my.ini" --console --skip-grant-tables

      110301 10:29:47 [Warning] '--default-character-set' is deprecated and will be re

      moved in a future release. Please use '--character-set-server' instead.

      110301 10:29:47 [Note] Plugin 'FEDERATED' is disabled.

      110301 10:29:47 InnoDB: Initializing buffer pool, size = 46.0M

      110301 10:29:47 InnoDB: Completed initialization of buffer pool

      110301 10:29:48 InnoDB: Started; log sequence number 0 44233

      110301 10:29:48 [Note] mysqld: ready for connections.

      Version: '5.1.55-community' socket: '' port: 3306 MySQL Community Server (GPL)

      (此處輸入ctrl+c

      110301 10:30:58 [Note] mysqld: Normal shutdown

       

      110301 10:30:58 InnoDB: Starting shutdown...

      110301 10:31:03 InnoDB: Shutdown completed; log sequence number 0 44233

      110301 10:31:03 [Note] mysqld: Shutdown complete

      Mysql服務(wù)停止了,輸入命令:

      net start mysql,即可重新啟動(dòng)mysql服務(wù),如:

      ===============================================================================

      C:Program FilesMySQLMySQL Server 5.1bin>net start mysql

      MySQL 服務(wù)正在啟動(dòng) .

      MySQL 服務(wù)已經(jīng)啟動(dòng)成功。

       

      C:Program FilesMySQLMySQL Server 5.1bin>

      31IDC - 12 年深耕海外 IDC 高端資源

      主站蜘蛛池模板: 女人和拘做受全程看视频日本综合a一区二区视频| 色婷婷综合久久久久中文一区二区| 激情综合色五月丁香六月亚洲| 亚洲乱码中文字幕综合234| 久久久久综合中文字幕| 亚洲AV综合色区无码一区| 国产精品亚洲综合五月天| 伊人久久成人成综合网222| 亚洲另类激情综合偷自拍| 亚洲第一综合天堂另类专| 伊人亚洲综合青草青草久热| AV色综合久久天堂AV色综合在| 九九综合VA免费看| 国产成人综合一区精品| 婷婷综合久久中文字幕蜜桃三| 亚洲色欲久久久久综合网| 18和谐综合色区| 久久婷婷五月综合97色一本一本| 天啪天天久久天天综合啪| 狠狠色综合久久婷婷| 狠色狠色狠狠色综合久久| 狠狠色噜噜狠狠狠狠色综合久| 一本色道久久88亚洲精品综合 | 区三区激情福利综合中文字幕在线一区亚洲视频1 | 97色婷婷成人综合在线观看| 亚洲国产天堂久久综合| 婷婷久久综合九色综合绿巨人| 亚洲综合国产成人丁香五月激情 | 精品久久人人做人人爽综合| 婷婷久久香蕉五月综合| 亚洲丁香婷婷综合久久| 国产综合成人亚洲区| 婷婷六月久久综合丁香可观看| 国产精品亚洲综合| 亚洲国产免费综合| 久久婷婷五月综合尤物色国产 | 国产综合成人色产三级高清在线精品发布| 亚洲色偷偷偷综合网| 国产亚洲综合久久| 综合色就爱涩涩涩综合婷婷| 久久国产精品亚洲综合|