当前位置:网站首页>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
边栏推荐
- GoLand debug go use - white record
- LeetCode 1611. The minimum number of operations to make an integer 0
- MySQL - Chapter 1 (data types in MySQL)
- 三、6【Verilog HDL】基础知识之门级建模
- 小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
- Rembg split mask
- Production practice elk
- Enter "net start MySQL" and "system error 5. Access denied" appears. Detailed explanation of the problem
- I don't understand time, timestamp and time zone. Look at this article
- kettle庖丁解牛第14篇之JSON输入
猜你喜欢

501. 二叉搜索树中的众数

Kettle experiment conversion case

Chapter VIII project stakeholder management of information system project manager summary

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

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

Summary of wrong questions 1

错题汇总1

資源打包關系依賴樹

EmuElec 编译总结

小程序报错:Cannot read property 'currentTarget' of undefined
随机推荐
Group Backpack
MySQL小练习(仅适合初学者,非初学者勿进)
tsdf +mvs
[SQL Server fast track] view and cursor of database
Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
1 + X cloud computing intermediate -- script construction, read-write separation
【SQL server速成之路】数据库的视图和游标
2D 01 Backpack
653. 两数之和 IV - 输入 BST
Write down the post order traversal of the ~ binary tree
How to read excel table to database
Common errors of VMware building es8
Summary of common concepts and problems of linear algebra in postgraduate entrance examination
Program, process, thread; Memory structure diagram; Thread creation and startup; Common methods of thread
Two ways for flutter providers to share data
Arbre de dépendance de l'emballage des ressources
npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
Find the sum of simple types of matrices
EmuElec 编译总结
How to protect open source projects from supply chain attacks - Security Design (1)