当前位置:网站首页>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
边栏推荐
猜你喜欢
Redis Desktop Manager for Mac
[reading notes] Chapter 5 conditional statements, circular statements and block statements of Verilog digital system design tutorial (with answers to thinking questions)
Experimental report on analysis of overflow vulnerability of assembly language and reverse engineering stack
Flink SQL realizes the integration of stream and batch
[Luke V0] verification environment 2 - Verification Environment components
Vivo, hardware safe love and thunder
Go language learning notes - exception handling | go language from scratch
资源打包关系依赖树
Detailed explanation of delete, truncate and drop principles in MySQL database
Kettle实验
随机推荐
What is monitoring intelligent playback and how to use intelligent playback to query video recording
Two methods of building Yum source warehouse locally
Unfortunately, I broke the leader's confidential documents and spit blood to share the code skills of backup files
A must see wechat applet development guide 1 - basic knowledge
Group Backpack
On array replication
[Luke V0] verification environment 2 - Verification Environment components
DJ music management software pioneer DJ rekordbox
MySQL small exercise (only suitable for beginners, non beginners are not allowed to enter)
MySQL of database -- overview and installation
RSA encryption and decryption signature verification
Colorui solves the problem of blocking content in bottom navigation
[indexof] [lastIndexOf] [split] [substring] usage details
Project upload part
web页面如何渲染
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands
[C language] document operation
Detailed explanation of delete, truncate and drop principles in MySQL database
SAP 101K 411k inventory change
What is augmented reality technology? Where can it be used?