ERROR 1698 (28000): Access denied for user 'root'@'localhost' 解决方法

Linux下MySQL出现ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘和ERROR 1045 (28000)的一些解决方法 先说环境版本号,我使用的是: 1.虚拟机:VMware® Workstation 16 Pro 版本16.2.1 2.Linux环境:Ubuntu64位 版本ubuntu-20.04.3-desktop-amd64 3.Mysql:使用apt安装 版本mysql-server-8.0,mysql-server-core-8.0 不管是用Navicat连,还是用终端连,都会出现ERROR 1698 先说原因 因为在Ubuntu下用apt装mysql是没有设置密码的环节的 所以一开始就是没有密码,而且密码也不 阅读详情

问题描述

之前MySQL服务端本机上使用密码登陆root账号是没有问题的,但是今天不知道是因为动了哪里,登陆失败并有这个错误代码:

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

解决办法

  1. 停止mysql服务
~$ sudo systemctl stop mysql
  1. 以安全模式启动MySQL
~$ sudo mysqld_safe --skip-grant-tables &
  1. 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)
  1. 查看一下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)
  1. 关于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: 1

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
  1. 重启服务,问题就解决了
~$ sodu systemctl restart mysql
~$ 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)
Debian/Ubuntu系统 MySQL安装、卸载MySQL、ERROR1698(28000):Access denied for user root@localhost错误解决方法 安装MySQL步骤 打开终端(Ctrl + Alt + T),分别输入以下三条命令 sudo apt-get install mysql-server sudo apt-get install mysql-client sudo apt-get install libmysqlclient-dev 卸载MySQL步骤 打开终端(Ctrl + Alt + T),输入以下命令 s... 阅读详情

相关推荐

服务器 出现ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘ 的解决方法

目录前言原理解决方法 前言 出现如下问题 gaokaoli@kkjz-ThinkStation-P330:/etc/init.d$ mysql -u root -p Enter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost' 截图如下: 原理 一般出现这种情况多数是安装新版本mysql,root密码是随机的,也不是空密码,所以要通过查看随机密码进入,在进行修改原来的密码 对于设置新密码具体可看我之前的文章

码农研究僧的博客 1万+

ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘解决方法

ERROR 1698 (28000): Access denied for user 'root'@'localhost'解决方法

leoatliang的博客 3万+

ubuntu18.0.4安装mysql并解决ERROR 1698 (28000): Access denied for user ''root''@''localhost''

主要介绍了ubuntu18.0.4安装mysql并解决ERROR 1698 (28000): Access denied for user 'root'@'localhost',现在将ubuntu18.0.4上安装mysql并将碰到的问题记录下来,感兴趣的朋友一起看看吧

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

错误通常发生在使用 UNIX socket 认证的 MySQL 上,这意味着 MySQL 尝试使用系统用户认证而不是传统的用户名和密码认证。

heromps的博客 5833

Waymo数据集里的隐藏彩蛋:5个激光雷达数据融合实战(附Python代码)

本文深入解析Waymo数据集中5个激光雷达的数据融合技术,提供Python实战代码,帮助开发者掌握多传感器协同工作的关键方法。通过时间同步、坐标转换和运动补偿等技术,实现高精度3D场景重建,提升自动驾驶系统的环境感知能力。

weixin_30399821的博客 81

某手 v8.x 签名计算方法(二) sig和__NS_sig3

一、目标 今天的目标是 sig和__NS_sig3,咱们抓个包先 二、步骤 sig目测像是MD5 先jadx搜索 sig= ,没有找到结果。 再试试 sig ,晕倒 6k多个结果,突然灵光一闪,这些参数,必然是要加入到 Map中,那么我们搜索 "sig" 应该就是这个 CPU.getClock,Hook之 var signCls = Java.use('com.yxcorp.xxx.util.CPU'); signCls.getClock.implementation = function(a,b,c

fenfei331的博客 2428

mysql出现ERROR 1698 (28000): Access denied for user 'root'@'localhost'错误解决方法

我的操作系统是ubuntu18.04,以下是我的mysql版本: 安装完成后,登录mysql的时候就出现了如下错误: 因为安装的过程中没让设置密码,可能密码为空,但无论如何都进不去mysql。 那么该怎么做呢,接下来就将这个解决方法总结记录一下。 step1:在ubuntu的terminal(也即终端)上输入sudo vim /etc/mysql/mysql.conf.d/mys...

洪流之源 1万+

LM Studio 模型加载与转换实战指南:从GGUF格式到本地部署

本文提供了使用LM Studio加载与转换GGUF格式大语言模型的完整实战指南。详细阐述了为何GGUF格式是本地部署的最佳选择,并逐步指导用户如何将非GGUF模型(如Transformers格式)转换为GGUF格式,以及在LM Studio中进行加载、配置GPU卸载等关键优化,最终实现流畅的本地离线对话体验。

weixin_29061425的博客 921

Ubuntu下安装mysql后登陆时出现ERROR 1698 (28000): Access denied for user 'root'@'localhost'的解决方法

mysql的版本 安装完成后,登录mysql的时候就出现了如下错误: 原因可能是安装过程中没让设置密码,所以登陆不进去 解决方法如下: 第一步:在ubuntu的terminal(也即终端)上输入sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf,进入到这个配置文件,然后在这个配置文件中的[mysqld]这一块中加入skip-grant-tables这句话。 ...

Tengrui的博客 2128

linux下wayland协议修改键盘映射

linux下wayland协议,修改键盘映射,实验环境是Ubuntu24,其他wayland协议窗口应该也是可以的。

qq_15027967的博客 1068

国际参考电离层2020模型Matlab(IRI-2020)

国际参考电离层 (IRI) 是一个国际项目 由空间研究委员会 (COSPAR) 和国际 无线电科学联盟 (URSI)。这些组织组成了一个工作组 (在 60 年代后期产生了电离层的经验标准模型, 基于所有可用数据源 (几个稳步改进的版本 模型已经发布。电子密度、电子温度、离子温度、 离子组成(O+、H+、He+、N+、NO+、O+2、簇离子)、赤道垂直离子漂移、垂直电离层电子含量(vTEC;

weixin_44392003的博客 4882

安装mysql后登陆时出现ERROR 1698 (28000): Access denied for user 'root'@'localhost'的解决方法

mysql安装完成后,登录mysql的时候就出现了如下错误: 解决办法:编辑配置文件my.cnf 在/etc/my.cnf中【mysqld】下面添加 skip-grant-tables保存退出。 重启MySQL服务 service mysql restart 在终端上输入mysql -u root -p,遇见输入密码的提示直接回车即可,进入mysql后,分别执行下面三句话: 1.use ...

ITwangxiaoxu的博客 1112

保姆级教程:在Windows 10上为QT5.15.2配置Android开发环境(含SDK/NDK/JDK避坑指南)

本文提供了一份详细的Windows 10环境下为QT5.15.2配置Android开发环境的保姆级教程,涵盖SDK、NDK、JDK的安装与配置,以及常见问题的避坑指南。通过优化安装流程、解决Gradle下载慢等痛点,帮助开发者快速搭建稳定的编译环境,并提供了模拟器配置和调试技巧,确保开发效率。

weixin_30919571的博客 528

mysql连接测试错误 deny_mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost')...

mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))解决步骤:[====>>https://www.cnblogs.com/leolztang/p/5094930.html.sudo mysql -u root -p.select user, plugin from my...

weixin_42363600的博客 242

GD32F130之USART多机通信

简介 在多机通信中,一个从机应该只接收它需要接收的数据,且只应该在它需要接收数据时才检测串口。而始终接收RX线上的数据对从机来说是一种负担。 多机通信硬件设计 远距离方案:RS485 板级方案: 静默模式 静默模式有什么作用? 答:如果 USART 处于静默模式,所有的接收状态标志位将不会被置位。 如何进入静默模式? 答:软件可以通过将 USART_CMD 寄存器中MMCMD 位置 1 使 USART 进入静默模式。 如何从静默模式中唤醒? 答:有两种方式可选,①检测到总线

luliplus的博客 299

OpenClaw(Clawdbot/Moltbot)如何正确的配置浏览器,实现对浏览器的自动化操作功能(浏览器状态为running:false怎么办)

OpenClaw(Clawdbot/Moltbot)浏览器自动化功能无效?🤖 本文详细介绍如何解决这个问题🔧,让你的OpenClaw(Clawdbot/Moltbot)真正具备"睁眼看世界"的能力,支持网页搜索、点击操作和截图等功能 ✅

XiaoqiangClub的博客 8109

解决ubuntu首次安装Mysql之后,首次登录出现ERROR 1698 (28000): Access denied for user 'root'@'localhost'的方法

解决步骤: 1.打开终端,输入sudo vi /etc/mysql/debian.cnf 打开/etc/mysql/debian.cnf文件,显示如下: 2.mysql -udebian-sys-maint -p 打开mysql 输入密码为上图中password字段 3.修改root密码 ALTER USER 'root'@'localhost' IDENTIFIED WITH...

fanxindong0620的博客 1204

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

mysql出现ERROR1698(28000):Access denied for user root@localhost错误解决方法

mysql出现ERROR1698(28000):Access denied for user root@localhost错误解决方法 当你按照标准文档安装好mysql之后,你有时候发现一点问题也没有(告诉你,你装成功了),同时你也有可能安装失败哦 对于mysql出现以上的问题:推荐方案(个人亲测有效),使用的系统是ubuntu18.04哦!!! references: https://www.cnblogs.com/cpl9412290130/p/9583868.html 按照里面的步骤操作之后就可以解决

nbxuwentao的博客 449

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))

解决步骤: 1.~$ sudo mysql -u root -p 2.mysql&gt;select user, plugin from mysql.user; 3.mysql&gt;update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='...

高木木的博客 1255

ERROR 1698 (28000): Access denied for user 'root'@'localhost' (后面没有多余的东西) -------解决方法

这个问题很多安装配置教程里都没有提到,找了好久好久。。。 转载一下。 转载:https://www.linuxidc.com/Linux/2019-08/159900.htm 测试的Linux操作系统是Ubuntu 18.04 LTS,MySQL版本如下: linuxidc@linuxidc:~/www.linuxidc.com$ mysql --version mysql Ver 14.14...

博客周 550

mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))...

mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost')) 解决步骤: [====>>https://www.cnblogs.com/leolztang/p/5094930.html 1.sudo mysql -u root -p 2...

weixin_30734435的博客 602

MySQL提示ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘错误解决办法

MySQL提示ERROR 1698 (28000): Access denied for user ‘root’@'localhost’错误解决办法 1.输入:service mysql restart(重启数据库) 如果还是报错,第二种方法: 1.输入:sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 进入到mysqld.cnf配置文件,然后在这个配置文件中的[mysqld]这一块中加入skip-grant-tables skip-grant-tables随便插入即可

qq_44913716的博客 993

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-get install mysql-server sudo apt-get install mysql-cli...

slvayf.top 559
上一篇: php7 编译 collect2: error: ld returned 1 exit status
下一篇: Ubuntu18.04 + PHP7.2 安装 Redis
dadeity
博客等级 码龄10年 1172粉丝 225原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dadeity

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值