1. 程式人生 > >MySQL ERROR 1698 (28000) 錯誤

MySQL ERROR 1698 (28000) 錯誤

之前MySQL服務端本機上使用密碼登陸root賬號是沒有問題的,但是今天不知道是因為動了哪裡,登陸失敗並有這個錯誤程式碼:

~$ mysql -u root -p
Enter password: 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

解決步驟:

停止mysql服務

~$ sudo service mysql stop

以安全模式啟動MySQL

~$ sudo mysqld_safe --skip-grant-tables &

MySQL啟動之後就可以不用密碼登陸了

~$ mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10 MySQL Community Server (GPL)

檢視一下user表,錯誤的起因就是在這裡, root的plugin被修改成了auth_socket,用密碼登陸的plugin應該是mysql_native_password。

mysql> select user, plugin from mysql.user
; +-----------+-----------------------+ | user | plugin | +-----------+-----------------------+ | root | auth_socket | | mysql.sys | mysql_native_password | | dev | mysql_native_password | +-----------+-----------------------+ 3 rows in set (0.01 sec)
mysql>
update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root'; Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)

重啟服務,問題就解決了

~$ sudo service mysql stop
...
 * MySQL Community Server 5.7.10 is stopped
~$ sudo service mysql start
..
 * MySQL Community Server 5.7.10 is started
~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10 MySQL Community Server (GPL)

相關推薦

MySQL ERROR 1698 (28000) 錯誤

之前MySQL服務端本機上使用密碼登陸root賬號是沒有問題的,但是今天不知道是因為動了哪裡,登陸失敗並有這個錯誤程式碼: ~$ mysql -u root -p Enter password: ERROR 1698 (28000): Access denied for user 'root'@'

MySQL ERROR 1698 (28000): Access denied for user 'root'@'localhost'

bsp set access 圖片 ima err tac flush ack 今天在安裝MySQL的過程中竟然沒有讓我輸入密碼,登錄的時候也不需要密碼就能進入,這讓我很困惑。 進了數據庫就設置密碼,用了各種方式都不行。 雖然我這數據庫沒啥東西但也不能沒有密碼就裸奔啊,有點

mysql ERROR 1045 (28000): 錯誤解決辦法

1.進入mysql資料庫: mysql> use mysql;Database changed 2.給root使用者設定新密碼,藍色部分自己輸入:mysql> update user set password=password("123456") where user="root";Que

mysql : ERROR 1045 (28000) 錯誤的簡單處理方法

deepin安裝mysql,沒有設定密碼,之後在登入的時候出現錯誤: mysql -uroot ERROR 1045 (28000): Access denied for user 'root'@'localhost' 這時,要用sudo來進行登入:

ubuntu19.04+mysql5.7 中 Mysql:ERROR 1698 (28000): Access denied for user 'root'@'localhost'

首先出現的情況是mysql -uroot -p123456可以登入, 但是網站配置了賬號卻顯示Mysql:ERROR 1698

Ubuntu下連接mysql出現 ERROR 1698 (28000): Access denied for user 'root'@'localhost'錯誤解決方法

use ces 數據 表示 vim amp https 創建 sel ubuntu版本:18.04 mysql版本:5.7.24 ubuntu安裝mysql後用root賬戶登入會出現問題:ERROR 1698 (28000): Access denied

mysql開啟skip-name-resolve 導致[email protected](localhost)訪問引發的ERROR 1045 (28000)錯誤解決方案

its 遠程訪問 5.6 速度 base mat change http oracl 為什麽配置skip-name-resolve? 由於mysql -h${ip} 遠程訪問速度過慢, mysql -h172.16.66.171 -uroot -p123456 根據網

ubuntu下 mysql安裝以後無法登陸的的解決方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))

sta mysql安裝 nat where 數據 move sel 方法 client 1. 刪除mysql sudo apt-get autoremove --purge mysql-server-5.0 sudo apt-get remove

MySQL使用普通使用者訪問返回ERROR 1698 (28000): Access denied for user 'root'@'localhost'

這個問題最開始查資料都說要改密碼,密碼不對。其實不是這個樣子都。 解決方法 修改/etc/mysql/my.cnf,新增以下內容 [mysqld] skip-grant-tables 重啟mysql服務/etc/init.d/mysql restart 使用mysql -u root連線

MySQL使用普通用戶訪問返回ERROR 1698 (28000): Access denied for user 'root'@'localhost'

解決 plugin flush use 通用 ant 普通用戶 user 顯示 這個問題最開始查資料都說要改密碼,密碼不對。其實不是這個樣子都。 解決方法 修改/etc/mysql/my.cnf,添加以下內容 [mysqld] skip-grant-tables 重啟m

Ubuntu/Debian(Raspbian)進入MySQL報錯:ERROR 1698 (28000): Access denied for user 'root'@'localhost'的解決方法

樹莓派安裝MySQL未提示設定密碼,之後在sudo下無需密碼即可連線,其它輸入報錯ERROR 1698 (28000) 附:遠端連線MySQL出現1130錯誤解決方法 問題場景: 在樹莓派3B+,系統Raspbian(Debian9.4),安裝MySQL: sudo apt-g

mysql登入時,ERROR 1045 (28000): 錯誤解決辦法

    錯誤問題的描述:   ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) ERROR 1045 (28000): Access denied for user 'ODBC'@'loc

ERROR 1698 (28000): Access denied for user 'root'@'localhost' 錯誤的解決辦法

sock 正在 解決辦法 span ant nat sta ror rom $ sudo mysql -u root mysql> USE mysql; mysql> SELECT User, Host, plugin FROM mysql.use

MYSQL: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

tar new ica host star init upd pass skip 1) /etc/init.d/mysqld stop2) mysqld_safe --skip-grant-tables &3) mysql -u root4) Setup new M

mysql ERROR 1045 (28000): Access denied for user解決方法

部分 set pda 數據庫 update 密碼登錄 重啟 password 沒有權限 問題重現(以下討論範圍僅限Windows環境): C:\AppServ\MySQL> mysql -u root -pEnter password:ERROR 1045 (2800

xampp自帶mysql命令深入分析MySQL ERROR 1045 (28000)

erro 內存 輸入 多個 mysql pro div 登錄 組成 在命令行輸入mysql -u root –p,輸入密碼,或通過工具連接數據庫時,經常出現下面的錯誤信息,詳細該錯誤信息很多人在使用MySQL時都遇到過。 ERROR 1045 (28000): Access

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

mys where 新版 class 切換 並且 正常的 htm upd 在新版的 Ubuntu (如 16.04,18.04)中,安裝好 MySQL 後直接用下面的命令連接總是會報錯: $ mysql ERROR 1045 (28000): Access denied f

mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

此錯誤一般為密碼錯誤 1.停止mysql服務 service mysqld stop 2.修改配置檔案無密碼登入 vim /etc/my.cnf 在此檔案最後追加 skip-grant-tables(跳過密碼驗證) 3.啟動mysql service my

MYSQL重置密碼 MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:YES)

一般這個錯誤是由密碼錯誤引起,解決的辦法自然就是重置密碼。 假設我們使用的是root賬戶。 1.重置密碼的第一步就是跳過MySQL的密碼認證過程,方法如下: #vim /etc/my.cnf(注:windows下修改的是my.ini) 在文件內搜尋mysqld定位

Ubuntu server裡登入mySql時報錯:Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'的纖細解決方案

問題如下: 輸入正確密碼後,卻出現錯誤 首先我們用vi編輯器進入mysql的配置檔案mysqld.cnf 我們在檔案裡內容找到mysqld這一目錄,在其目錄下新增一行skip-grant-tables 隨後按esc鍵輸入:wq儲存退出 退出後