MySql Error 1698(28000)问题的解决方法
网络编程 2021-07-05 14:36www.168986.cn编程入门
这篇文章主要介绍了MySql Error 1698(28000)问题的解决方法,需要的朋友可以参考下
一,问题描述:
MysqlERROR1698(28000)解决,新装了mysql-server-5.7,登录为这一问题,普通用户不能进mysql,只有root用户才能进,并且不需要任何密码。
~$ mysql -u root -p Enter password: ERROR 1698 (28000): Aess denied for user 'root'@'localhost'
二,解决步骤:
停止mysql服务
~$ sudo service mysql s
以安全模式启动MySQL
~$ sudo mysqld_safe --skip-grant-tables &
MySQL启动之后就可以不用密码登陆了
~$ mysql -u root Wele 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 | +-----------+-----------------------+ <strong>3</strong> rows in set (<strong>0.01</strong> sec)
关于auth_socket,在官方有说明: ,反正现在暂时不用它, 那就把这里改了。
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 s ... * MySQL Community Server 5.7.10 is sped ~$ sudo service mysql start .. * MySQL Community Server 5.7.10 is started ~$ mysql -u root -p Enter password: Wele 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)问题的解决方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,长沙网络推广会及时回复大家的。在此也非常感谢大家对狼蚁SEO网站的支持!
上一篇:MySQL 修改密码实例详解
下一篇:mac安装mysql初始密码忘记怎么办
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程