如何進入MySQL

2022-08-22 23:00:17 字數 1249 閱讀 9358

c:\users\電腦id>d:

d:\> cd d:\wamp\wamp64\bin\mysql\mysql5.7.19\bin

d:\wamp\wamp64\bin\mysql\mysql5.7.19\bin>mysql -hlocalhost -uroot -p

enter password:

welcome to the mysql monitor. commands end with ; or \g.

your mysql connection id is 11

server version: 5.7.19 mysql community server (gpl)

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> show databases;

如果報錯

「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 password=password("rootadmin") where user='root';」(修改root的密碼)

(期間我還select下user表中的記錄,查詢全部的時候顯示了一些亂碼,然後我只查詢了user表中的host、user、password欄位,貌似當時顯示了3條記錄,有1個沒有名稱。當然,為了解決問題,這些我也管不了了。)

6、開啟mysql目錄下的my.ini檔案,刪除最後一行的「skip-grant-tables」,儲存並關閉檔案。

7、重啟mysql服務。

8、在命令列中輸入「mysql -uroot -prootadmin」,問題搞定!

如何進入mysql模式 資料庫如何進入限制模式

有時我們資料庫需要進入限制模式,比如維護時。那麼,如何才能讓系統進入限制模式呢 1.開啟資料庫直接進入限制模式 startup open restricted 2.修改開啟的資料庫進行限制模式 alter system enable restricted session 看監聽服務的狀態 lsnrc...

如何 進入 Oracle isqlplus

以上,希望對你有所幫助。回答者 賓士m888 十四級 2009 12 10 08 15 沒啟動服務吧!不知道你是那個版本的 10g的話要先啟動監聽,再啟動isqlplus才行。命令如下 echo 啟動oracle服務 net start oracleserviceorcl echo 啟動監聽 net...

如何進入Shell

在 linux 發展的早期,唯一能用的工具就是 shell,linux 使用者都是在 shell 中輸入文字命令,並檢視文字輸出 如果有必要的話,shell 也能顯示一些基本的圖形。而如今 linux 的環境已經完全不同,幾乎所有的 linux 發行版都使用某種圖形桌面環境 例如 gnome kde...