当前位置:网站首页>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
边栏推荐
- kettle实验
- LeetCode396. Rotate array
- Wechat applet catchtap = "todetail" event problem
- GoLand debug go use - white record
- Go language self-study series | golang structure pointer
- LeetCode 1611. The minimum number of operations to make an integer 0
- Redis Desktop Manager for Mac
- How to render web pages
- MySQL小练习(仅适合初学者,非初学者勿进)
- Arbre de dépendance de l'emballage des ressources
猜你喜欢

数据清洗 ETL 工具Kettle的安装

EmuElec 编译总结

Canary publishing using ingress

Four pictures to understand some basic usage of Matplotlib
![[geek challenge 2019] havefun1](/img/8b/b15bf31771d54db25f24d630e64093.png)
[geek challenge 2019] havefun1

Harbor enterprise image management system

653. Sum of two IV - input BST

SAP 101K 411k inventory change

MySQL small exercise (only suitable for beginners, non beginners are not allowed to enter)

kettle庖丁解牛第14篇之JSON输入
随机推荐
GoLand debug go use - white record
Failed to prepare device for development
NPM reports an error: operation not allowed, MKDIR 'C: \ program files \ node JS \ node_ cache _ cacache’
Two ways for flutter providers to share data
资源打包关系依赖树
Get trustedinstaller permission
Kettle实验 (三)
Kettle实验 转换案例
小程序报错:Cannot read property 'currentTarget' of undefined
LeetCode 1611. The minimum number of operations to make an integer 0
Emuelec compilation summary
1 + X cloud computing intermediate -- script construction, read-write separation
NPM installation yarn
【SQL server速成之路】数据库的视图和游标
DJ music management software pioneer DJ rekordbox
#yyds干货盘点#ubuntu18.0.4安装mysql并解决ERROR 1698: Access denied for user ''root''@''localhost''
node安装
ALV tree (ll LR RL RR) insert delete
NLLLoss+log_ SoftMax=CE_ Loss
Two methods of building Yum source warehouse locally