国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > MySQL > 正文

windows下忘記MySQL密碼的修改方法

2024-07-24 12:47:34
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

一、windows下修改MySQL密碼的方法
如果在Windows下忘記了MySQL的密碼,可以這樣做:
1.關(guān)閉正在運(yùn)行的MySQL服務(wù):net stop mysql或 在windows 任務(wù)管理器中結(jié)束 mysqld.exe 進(jìn)程或在 管理工具里面的服務(wù)找到 mysql服務(wù) ,將其停止;

復(fù)制代碼 代碼如下:
C:/Users/Administrator>net stop mysql
MySQL 服務(wù)正在停止.
MySQL 服務(wù)已成功停止。

2.打開命令行,轉(zhuǎn)到mysql的bin目錄下;
復(fù)制代碼 代碼如下:
C:/Users/Administrator>cd C:/Program Files/MySQL/MySQL Server 5.5/bin

C:/Program Files/MySQL/MySQL Server 5.5/bin>


3.輸入:mysqld -nt --skip-grant-tables
然后回車,如果沒(méi)有錯(cuò)誤信息,就行了;
注:skip-grant-tables參數(shù)用了之后,就可以跳過(guò)登錄校驗(yàn);
復(fù)制代碼 代碼如下:
C:/Program Files/MySQL/MySQL Server 5.5/bin>mysqld -nt --skip-grant-tables
140317 13:23:11 [Warning] option 'new': boolean value 't' wasn't recognized. Set
 to OFF.

4.再打開一個(gè)命令行(因?yàn)閯偛拍莻€(gè)DOS窗口已經(jīng)不能動(dòng)了),同樣轉(zhuǎn)到mysql的bin目錄下;
5.直接輸入 mysql 并回車,如果成功,將出現(xiàn)MySQL提示符 >
復(fù)制代碼 代碼如下:
C:/Users/Administrator>cd C:/Program Files/MySQL/MySQL Server 5.5/bin

C:/Program Files/MySQL/MySQL Server 5.5/bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id is 1
Server version: 5.5.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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>


6.切換到mysql表
復(fù)制代碼 代碼如下:
mysql>USE mysql;

7.可以修改密碼了:
復(fù)制代碼 代碼如下:
UPDATE user SET password=PASSWORD("123456") WHERE user="root";

8.刷新權(quán)限,不要忘記了:
復(fù)制代碼 代碼如下:
mysql>FLUSH PRIVILEGES;

9.退出:(退出的方法很多 有quit、exit、ctrl+c、/q 等等);
10.注銷或重啟計(jì)算機(jī),然后打開MySQL服務(wù),使用用戶名root和設(shè)置的新密碼就可以登錄了。

二、更改mysql密碼常用的三種方法
大部分情況下,一般用戶沒(méi)有權(quán)限更改密碼,只有申請(qǐng)了權(quán)限或root用戶才可以更改密碼;
1.方法1:用mysqladmin

復(fù)制代碼 代碼如下:
mysqladmin -u root password "123456";

如果root已經(jīng)設(shè)置過(guò)密碼,采用如下方法
復(fù)制代碼 代碼如下:
mysqladmin -u root password -p "123456";
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 水城县| 南江县| 翼城县| 顺义区| 汶川县| 昂仁县| 高密市| 博乐市| 怀宁县| 惠安县| 涞水县| 安仁县| 卓资县| 基隆市| 综艺| 连城县| 万州区| 北辰区| 台山市| 南丹县| 寿光市| 抚顺县| 新营市| 滨海县| 托克逊县| 建昌县| 新宁县| 仙居县| 乐都县| 忻城县| 巴彦县| 巴东县| 天津市| 遂溪县| 枣庄市| 板桥市| 广饶县| 太白县| 大宁县| 略阳县| 禹城市|