当前位置:网站首页>Yyds dry goods inventory ubuntu18 0.4 install MySQL and solve error 1698: access denied for user ''root' '@' 'localhost' '
Yyds dry goods inventory ubuntu18 0.4 install MySQL and solve error 1698: access denied for user ''root' '@' 'localhost' '
2022-04-23 09:23:00 【Swiss cabbage】
Recent learning linux, And then win Instead of ubuntu. Previously installed mysql It can't be used , Now it will be in ubuntu18.0.4 Installation on mysql And record the problems encountered as follows :
Download and install mysql
Execute statement sudo apt-get install mysql-server

Because I have installed it here , So this will happen . Can pass mysql –version Check the installed version .
Sign in mysql
Execute statement mysql -u root -p
Its -u yes user -p Is the port . Appears at login ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’. This should be when we installed ,pass Forget or don't remember to initialize pass Caused by the :

Now let's talk about how to solve this problem :
1. Input instruction sudo vim /etc/mysql/debian.cnf We will see the following information :
among debian-sys-maint Account is installed mysql The system automatically generates mysql user , Corresponding pass This is the user's pass.
2. Login account debian-sys-maint:
mysql -u debian-sys-maint -p You can log in. mysql:
3. modify root Account number pass:
Input instruction use mysql;
Then enter the command :
UPDATE
user
SET
authentication_string
=
PASSWORD(
‘ What you want to set pass
') where USER=‘root';
This is the setup root account pass.
- 1.
Then enter the command quit, sign out mysql, restart mysql Instructions sudo service mysql restart;
Then login mysql, When executed mysql -u root -p, Found or reported wrong :ERROR 1524 (HY000): Plugin ‘msyql_native_password’ is not loaded

Now pass In fact, it has been modified successfully , yes plugin root The field of is auth_socket, It needs to be modified .
4. modify plugin:
Continue to use debian-sys-maint Account login ;
Execution instruction :
use mysql
Execution instruction :
select user,plugin from user;
Then execute the instructions :
update
user
set
authentication_string
=
password(
‘ What you want to set
'),plugin=‘mysql_native_password'
where
user
=
‘root
';
- 1.
Finally, exit and restart mysql that will do :

版权声明
本文为[Swiss cabbage]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230757551417.html
边栏推荐
- Cross domain configuration error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
- Your guide to lowering your cholesterol with TLC (continuously updated)
- #yyds干货盘点#ubuntu18.0.4安装mysql并解决ERROR 1698: Access denied for user ''root''@''localhost''
- Detailed explanation of delete, truncate and drop principles in MySQL database
- [indexof] [lastIndexOf] [split] [substring] usage details
- Buuctf [actf2020 freshman competition] include1
- 501. Mode in binary search tree
- 108. 将有序数组转换为二叉搜索树
- Unfortunately, I broke the leader's confidential documents and spit blood to share the code skills of backup files
- 小女孩行走
猜你喜欢

Go language learning notes - structure | go language from scratch

三、6【Verilog HDL】基础知识之门级建模

資源打包關系依賴樹

653. Sum of two IV - input BST

Distributed message oriented middleware framework selection - Digital Architecture Design (7)

kettle庖丁解牛第14篇之JSON输入

kettle实验

npm ERR! network

MySQL小练习(仅适合初学者,非初学者勿进)

数据清洗 ETL 工具Kettle的安装
随机推荐
Get trustedinstaller permission
On array replication
Production practice elk
Emuelec compilation summary
Go language learning notes - slice, map | go language from scratch
js 原型链的深入
Withholding agent
web页面如何渲染
成功的DevOps Leader 应该清楚的3个挑战
Flink SQL realizes the integration of stream and batch
Two methods of building Yum source warehouse locally
653. Sum of two IV - input BST
Group Backpack
Kettle实验
NLLLoss+log_ SoftMax=CE_ Loss
Brush classic topics
Creation of raid0 and RAID5 and Simulation of how RAID5 works
Go language self-study series | golang method
Failed to prepare device for development
Rembg split mask