日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL修改用戶密碼,新手必看

我們大家都知道MySQL修改用戶密碼這一問題一直是困擾新手的一個(gè)惡魔,在此問題的解決上新手經(jīng)常會(huì)上范錯(cuò)誤,而導(dǎo)致最終不能進(jìn)入MySQL數(shù)據(jù)庫,所以以下就是幾個(gè)相關(guān)例子的介紹,望你能有所收獲。

網(wǎng)站建設(shè)哪家好,找成都創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了綿竹免費(fèi)建站歡迎大家使用!

1、原來的密碼是123456

 
 
 
  1. C:\>type MySQL5.bat
  2. @echo off
  3. MySQL -uroot -p123456 -P3306

正確的修改MySQL用戶密碼的格式是:

我們這里用

用戶:root(可以換成其他的)

密碼:woshiduide

來演示新密碼。

 
 
 
  1. C:\>MySQLadmin -uroot -p password woshiduide
  2. Enter password: ******

于是修改成功。注意PASSWORD關(guān)鍵字后面的空格有好多人是這樣修改的:

 
 
 
  1. C:\>MySQLadmin -uroot -p password ‘woshiduide’
  2. Enter password: ******
  3. C:\>MySQLadmin -uroot -p password ‘woshiduide’
  4. Enter password: *********
  5. Warning: single quotes were not trimmed from the password by your command
  6. line client, as you might have expected.

而這個(gè)時(shí)候真正的密碼是’woshiduide’

 
 
 
  1. C:\>MySQL -uroot -p’woshiduide’
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 18
  4. Server version: 5.1.17-beta-community-nt-debug MySQL Community Server (GPL)
  5. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
  6. MySQL>

MySQL修改用戶密碼實(shí)際操作中而新手往往這樣:

 
 
 
  1. C:\>MySQL -uroot -pwoshiduide
  2. ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: Y
  3. ES)

所以非常郁悶,BAIDU、GOOGLE的搜了一大堆。

我現(xiàn)在把密碼改回去。

 
 
 
  1. C:\>MySQLadmin -uroot -p’woshiduide’ password 123456

2、還有就是可以直接進(jìn)入MySQL,然后修改密碼。

 
 
 
  1. MySQL> use MySQL
  2. Database changed
  3. MySQL> update user set PASSWORDPASSWORD = PASSWORD(‘woshiduide’) where USER=’root’ and H
  4. OST=’localhost’;
  5. Query OK, 1 row affected (0.05 sec)
  6. Rows matched: 1 Changed: 1 Warnings: 0
  7. MySQL> flush privileges;
  8. MySQL> exit
  9. Bye
  10. C:\>MySQL -uroot -pwoshiduide
  11. Welcome to the MySQL monitor. Commands end with ; or \g.
  12. Your MySQL connection id is 23
  13. Server version: 5.1.17-beta-community-nt-debug MySQL Community Server (GPL)
  14. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
  15. MySQL>
  16. Query OK, 0 rows affected (0.02 sec)

3、還有一種就是用SET PASSWORD 命令修改:

 
 
 
  1. C:\>MySQL5.bat
  2. Enter password: ******
  3. Welcome to the MySQL monitor. Commands end with ; or \g.
  4. Your MySQL connection id is 8
  5. Server version: 5.1.17-beta-community-nt-debug-log MySQL Community Server (GPL)
  6. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
  7. MySQL> set password for root@’localhost’ = password(‘woshiduide’);
  8. Query OK, 0 rows affected (0.02 sec)
  9. MySQL> flush privileges;
  10. Query OK, 0 rows affected (0.09 sec)
  11. MySQL> exit
  12. Bye

4、GRANT 也可以,不過這里不介紹。因?yàn)樯婕暗綑?quán)限的問題。

以上的相關(guān)內(nèi)容就是對(duì)MySQL修改用戶密碼的介紹,望你能有所收獲。


網(wǎng)站名稱:MySQL修改用戶密碼,新手必看
轉(zhuǎn)載源于:http://www.dlmjj.cn/article/dhhecci.html