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

首頁 > 數據庫 > MySQL > 正文

MySql Error 1698(28000)問題的解決方法

2024-07-24 13:13:48
字體:
來源:轉載
供稿:網友

一,問題描述:

MysqlERROR1698(28000)解決,新裝了mysql-server-5.7,登錄為這一問題,普通用戶不能進mysql,只有root用戶才能進,并且不需要任何密碼。

~$ mysql -u root -pEnter 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 rootWelcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 2Server 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 |+-----------+-----------------------+<strong>3</strong> rows in set (<strong>0.01</strong> sec)

關于auth_socket,在官方有說明: https://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/socket-authentication-plugin.html ,反正現在暫時不用它, 那就把這里改了。

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)

重啟服務,問題就解決了

~$ 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 -pEnter password: Welcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 2Server version: 5.7.10 MySQL Community Server (GPL)

以上所述是小編給大家介紹的MySql Error 1698(28000)問題的解決方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VeVb武林網網站的支持!


注:相關教程知識閱讀請移步到MYSQL教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 芦溪县| 翁源县| 体育| 汉中市| 宜阳县| 高要市| 依兰县| 舟曲县| 泰宁县| 广汉市| 龙江县| 扎兰屯市| 德阳市| 遂平县| 汤阴县| 天等县| 永修县| 康定县| 云梦县| 三明市| 郎溪县| 乌苏市| 嘉义县| 嘉祥县| 彰武县| 兴文县| 孟村| 岑溪市| 大理市| 霍州市| 民县| 罗定市| 贵阳市| 阳谷县| 靖江市| 仪征市| 神农架林区| 怀集县| 白银市| 长岛县| 奇台县|