数据库之MySQL ERROR 1698 (28000) 错误:Access denied for user 'root'@'localhost' error【摘抄】...
声明:全文均摘抄于MySQL ERROR 1698 (28000) 错误
//错误起源:~$ 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 |+-----------+-----------------------+3 rows in set (0.01 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, 1 row affected, 1 warning (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 1mysql> 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 -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)
7.linux云主机端:开启远程连接
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf 注释掉bind-address = 127.0.0.1sudo service mysql restart
转载于:https://www.cnblogs.com/johnnyzen/p/7924154.html
数据库之MySQL ERROR 1698 (28000) 错误:Access denied for user 'root'@'localhost' error【摘抄】...相关推荐
- MySQL安装错误——Access denied for user 'root'@'localhost' (using password: YES)
错误: [root@VM_205_38_centos home]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied ...
- MySQL10061错误Access denied for user root@localhost(Windows下)
1,首先是MySQL10061错误解决(Access denied for user root@localhost错误的直接转到第五步) 打开你当初安装MySQL的那个安装包,如上图 2,安装,点击n ...
- Mac os上MAMP连接mysql失败 和mysql访问问题。关于Access denied for user root @ localhost (using password: YES)的解决
Mac上下载MAMP pro后可以通过MAMP直接访问phpadmin,但是我在学mysql的过程中因为登录mysql出现问题,所以卸载之后选择重装,然后再次用MAMP打开phpadmin失败,显示A ...
- 报错:Error querying database. Cause: java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘
报错:Error querying database. Cause: java.sql.SQLException: Access denied for user 'root'@'localhost' ...
- 因为一个MySQL权限问题引发的填坑之一(ERROR1045:Access Denied for user 'root'@'localhost' (using password:YES))
我觉得我应该改名字叫填坑掌柜, 本来只是改个MySQL导入文件的权限问题,结果引发了一系列的踩坑,填坑过程- 好吧,还是开始正题,我们开始填坑第一个: ERROR1045(28000):Access ...
- mysql Access denied for user 'root'@'localhost' (using password: YES)
[现象说明] C/S程序远程访问正常,本地访问报以下异常 MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to h ...
- MySQL: linux mysql access denied for user ‘root’@’localhost'(using password:YES)
linux安装完mysql后,使用程序连接报以上错误 Access denied for user 'root'@'localhost' (using password:YES) 解决方法,重新设置密 ...
- 1698无法登录mysql服务器_解决MySql ERROR 1698 (28000) 错误:Access denied for user 'root'@'localhost'...
今天尝试在Ubuntu虚拟机上安装MySql 数据库(版本是:5.7.23-0Ubuntu0.18.04.1),数据库安装很简单,就是三行命令:html sudo apt-get install my ...
- MariaDB/MySQL 报错解决:ERROR 1698 (28000): Access denied for user 'root'@'localhost'
我在安装好MariaDB后,发现一个问题:我必须用root用户才能登录数据库,普通用户不能登录数据库,会报错: -> % mysql -h localhost -u root -p Enter ...
最新文章
- cto denalil
- 是时候取消Scrum的产品负责人角色了吗?
- linux do_irq 报错 代码,linux - 内核函数asm_do_IRQ()中的irq与我在模块中请求的不同 - 堆栈内存溢出...
- CVPR2016:Improving Person Re-identification via Pose-aware Multi-shot Matching
- 自定义Dictionary支持线程安全
- IDEA创建GIT分支并提交
- 权威认证闭环 | 国内首家DevSecOps体系全栈产品通过CWE国际兼容性认证
- net3.5离线一键安装工具_一键获取抖音直播源地址(无水印高清下载),无需安装Fiddler抓包工具...
- 破旧手机改造系列:最牛逼的行车记录仪
- ResizeObserver loop completed with undelivered notifications.
- Docker容器时间与宿主机时间不一致
- ASP网页与HTML网页的区别是什么
- 博主熬夜手写个SpringMVC框架
- Qt利用openGL绘制三棱锥
- a标签与button按钮
- 工信部备案成功后 网站公安备案详细流程![图]
- 教育知识与能力简答题汇总
- Python实战教程专栏完整目录
- opengl画点线面
- Walker智慧农业物联网云平台(Version:3.0.1)「源码」