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

首頁 > 數據庫 > MySQL > 正文

mysql命令模式修改mysql root密碼筆記

2024-07-24 12:39:26
字體:
來源:轉載
供稿:網友

今天在服務器中安裝好了一個mysql服務器了,起初是配置好的mysql的root密碼了,但經過一些軟件的優(yōu)化之后把root密碼改成了空了,因為剛安裝好的環(huán)境沒有像mysql管理工具了,所以只有在命令模式下使用mysqladmin進行修改了,下面111cn站長為各位介紹一下mysql命令模式修改mysql root密碼方法。

修改mysql密碼過程如下:

百度搜索一文章看到使用.

格式:mysqladmin -u用戶名 -p舊密碼 password 新密碼

修改于時我下看操作:

  1. Enter password
  2.  
  3. Welcome to the MySQL monitor.  Commands end with ; or \g. 
  4. Your MySQL connection id is 10 
  5. Server version: 5.5.27-log MySQL Community Server (GPL) 
  6.  
  7. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 
  8.  
  9. Oracle is a registered trademark of Oracle Corporation and/or its 
  10. affiliates. Other names may be trademarks of their respective 
  11. owners. 
  12.  
  13. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
  14.  
  15. mysql> mysqladmin -u root password 我要設置的密碼 
  16.     -> 
  17.     -> ; 
  18. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 
  19. corresponds to your MySQL server version for the right syntax to use near 'mysql 
  20. admin -u root password 我要設置的密碼' at line 1 
  21. mysql> mysqladmin -u root -password 我要設置的密碼 
  22.     -> ; 
  23. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 
  24. corresponds to your MySQL server version for the right syntax to use near 'mysql  --Vevb.com 
  25. admin -u root -password 我要設置的密碼' at line 1 

最后小編使用了 mysqladmin -u root -password 我要設置的密碼 無法搞定,突然想到直接更新表即可.

  1. mysql> update mysql.user set password=PASSWORD('我要設置的密碼'where User ='root 
  2. '; 
  3. Query OK, 3 rows affected (0.05 sec) 
  4. Rows matched: 3  Changed: 3  Warnings: 0 
  5.  
  6. mysql> flush privileges
  7. Query OK, 0 rows affected (0.01 sec) 
  8.  
  9. mysql> 

好了這樣就搞定了,雖然過程不復雜也不簡單.

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 明水县| 虎林市| 昌宁县| 陵川县| 博野县| 娱乐| 乐陵市| 海宁市| 石景山区| 大名县| 雷山县| 油尖旺区| 永城市| 交口县| 湾仔区| 盘锦市| 始兴县| 武冈市| 噶尔县| 亚东县| 高密市| 杭锦后旗| 吴川市| 隆安县| 东乌珠穆沁旗| 新安县| 尖扎县| 化州市| 丰原市| 将乐县| 盈江县| 边坝县| 东阳市| 烟台市| 阿尔山市| 资中县| 凤庆县| 汉阴县| 龙游县| 方城县| 余江县|