-
mysql的基本安裝
參考文章
在windows10上安裝mysql詳細圖文教程
-
安裝報錯
在本地使用指令連結mysql的時候,有如下報錯
mysql -u root -p
Access denied for user 'root'@'localhost' (using password:YES) 解決方案
問題的解決
解決方案:
1、打開MySQL目錄下的my.ini檔案,在檔案的最後添加一行“skip-grant-tables”,儲存并關閉檔案。
2、重新開機MySQL服務。
3、在指令行中輸入“mysql -uroot -p”(不輸入密碼),回車即可進入資料庫。
4、執行,“use mysql;”使用mysql資料庫。
5、執行,“update user set authentication_string=PASSWORD("youpasswd") where user='root';”(修改root的密碼)
成功提示如下:
Query OK, 1 row affected, 1 warning (0.15 sec)Rows matched: 1 Changed: 1 Warnings: 1
6、打開MySQL目錄下的my.ini檔案,删除最後一行的“skip-grant-tables”,儲存并關閉檔案。
7、重新開機MySQL服務。
8、在指令行中輸入“mysql -u root -p ”,
在老版本中,更新密碼使用的是如下的指令:
mysql資料庫下已經沒有password這個字段了,password字段改成了authentication_string。
update mysql.user set password=password('password') where user='root';