《MYSQL教程MySql Error 1698(28000)問(wèn)題的解決方法》要點(diǎn):
本文介紹了MYSQL教程MySql Error 1698(28000)問(wèn)題的解決方法,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
MYSQL必讀一,問(wèn)題描述:
MYSQL必讀MysqlERROR1698(28000)解決,新裝了mysql-server-5.7,登錄為這一問(wèn)題,普通用戶不能進(jìn)mysql,只有root用戶才能進(jìn),并且不需要任何密碼.
MYSQL必讀
~$ mysql -u root -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
MYSQL必讀二,解決步驟:
MYSQL必讀停止mysql服務(wù)
MYSQL必讀
~$ sudo service mysql stop
MYSQL必讀以安全模式啟動(dòng)MySQL
MYSQL必讀
~$ sudo mysqld_safe --skip-grant-tables &
MYSQL必讀MySQL啟動(dòng)之后就可以不用密碼登陸了
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)
MYSQL必讀查看一下user表,錯(cuò)誤的起因就是在這里, root的plugin被修改成了auth_socket,用密碼登陸的plugin應(yīng)該是mysql_native_password.
MYSQL必讀
mysql> select user, plugin from mysql.user;
+-----------+-----------------------+
| user | plugin |
+-----------+-----------------------+
| root | auth_socket |
| mysql.sys | mysql_native_password |
| dev | mysql_native_password |
+-----------+-----------------------+
<strong>3</strong> rows in set (<strong>0.01</strong> sec)
MYSQL必讀關(guān)于auth_socket,在官方有說(shuō)明: https://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/socket-authentication-plugin.html ,反正現(xiàn)在暫時(shí)不用它, 那就把這里改了.
MYSQL必讀
mysql> update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';
Query OK, <strong>1</strong> row affected, <strong>1</strong> warning (<strong>0.00</strong> sec)
Rows matched: <strong>1</strong> Changed: <strong>1</strong> Warnings: <strong>1</strong>
mysql> flush privileges;
Query OK, <strong>0</strong> rows affected (<strong>0.00</strong> sec)
MYSQL必讀重啟服務(wù),問(wèn)題就解決了
MYSQL必讀
~$ 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必讀以上所述是小編給大家介紹的MySql Error 1698(28000)問(wèn)題的解決方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的.在此也非常感謝大家對(duì)維易PHP網(wǎng)站的支持!
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.snjht.com/jiaocheng/1101.html