当前位置:网站首页>Four methods of modifying MySQL password (suitable for beginners)
Four methods of modifying MySQL password (suitable for beginners)
2022-07-28 02:40:00 【@Code every day】
Author's brief introduction : Hello, I'm @ Typing code every day , A player of material transcoding farmer , Hope to work together , Progress together !
Personal home page :@ Every day, I have to type the personal homepage of the code
Recommend a simulated interview 、 Brush Title artifact , From basic to interview questions Click to jump to the question brushing website to register for learningAs a beginner , about MySQL Password modification , At present, I know four methods : The first three are to modify the password when you know it , Because we need to log in first ; The last one is suitable for modifying when you forget your password !
Catalog
Method 1: use set password command
Method 3: use update Direct editing user surface
Method 4: Forget password handling
Method 1: use set password command
(1) First log in first MySQL:

(2) Change the password format to :
set password for user name @localhost = password(' New password '); Don't forget the last semicolon , for example : We changed the password to 123:
set password for [email protected] = password('123');The following interface appears, indicating that the modification is successful :

Method 2: use mysqladmin
utilize mysqladmin, We don't need to log in first , But until the original password ; We can modify it directly , Change the password format to :
mysqladmin -u user name -p Old password password New password , Be careful ,password There is no - , for example : Let's change the password to 123456:
mysqladmin -uroot -p123 password 123456The following interface appears, indicating that the modification is successful

Method 3: use update Direct editing user surface
(1) First log in first MySQL
(2) Then type in :
use mysql # Connect to permission database
update user set password=password('521') where user='root' and host='localhost'; # Change password
flush privileges; # Refresh the permissions The following interface appears, indicating that the modification is successful :

Method 4: Forget password handling
1. Close running MySQL service .
win+r Input :services.msc enter , find MySQL, Manually shut down MySQL service
2. open DOS window , utilize cd The order goes to mysql Of bin Catalog : It is recommended to find mysql Of bin Enter... In the directory cmd enter
3. Input mysqld --skip-grant-tables enter .--skip-grant-tables It means start-up MySQL Skip authority list authentication when serving .
4. Open another one DOS window ( The one just now DOS The window can no longer move ), go to mysql Of bin Catalog .
5. Input mysql enter , If the above modification is successful , Will appear directly mysql> Such a prompt .
6. Connect to permission database : use mysql
6. Change password :update user set password=password("123") where user="root";
7. Refresh the permissions ( Steps must be taken ):flush privileges; ( Don't forget the semicolon )
8.exit perhaps ctrl+c sign out , Re login
Conclusion
Today's sharing is here ! Register and join the problem brushing army through the link below ! All kinds of big factory interview questions are waiting for you !
Brush Title artifact , From basic to interview questions Click to jump to the website

边栏推荐
- [solution] solve the problem of SSH connection being inactive for a long time and being stuck and disconnected
- Canonical Address
- [in depth study of 4g/5g/6g topic -42]: urllc-14 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -8-low delay technology-2-slot based scheduling and
- 树的孩子兄弟表示法
- MySQL blocking monitoring script
- TypeScript(零) —— 简介、环境搭建、第一个实例
- 【自我成长网站收集】
- Canvas 从入门到劝朋友放弃(图解版)
- [TA frost wolf \u may - hundred people plan] Figure 3.7 TP (d) r architecture of mobile terminal
- From prediction to decision-making, Chapter 9 Yunji datacanvas launched the ylearn causal learning open source project
猜你喜欢

TypeScript(零) —— 简介、环境搭建、第一个实例

Ceresdao: new endorsement of ventures Dao

regular expression

Compile and use Qwt in qt|vs2017

JS event loop synchronous task, asynchronous task (micro task, macro task) problem analysis
![[software testing] - unittest framework for automated testing](/img/7a/29b222cb0b6a5953b98f8d797cd106.png)
[software testing] - unittest framework for automated testing
![This operation may not be worth money, but it is worth learning | [batch cutting of pictures]](/img/e8/a34e471b0089f8085b140c74b5c01f.jpg)
This operation may not be worth money, but it is worth learning | [batch cutting of pictures]

Notes for the fourth time of first knowing C language

First knowledge of C language -- structure, branch and loop statements

Explore flex basis
随机推荐
[understanding of opportunity -53]: Yang Mou stands up and plots to defend himself
From prediction to decision-making, Chapter 9 Yunji datacanvas launched the ylearn causal learning open source project
Sqlserver problem solving: replication components are not installed on this server. Please run SQL Server Setup again and select the option to install replication components
Wechat campus bathroom reservation applet graduation design finished product (3) background function
修改MySQL密码的四种方法(适合初学者)
【ROS进阶篇】第十讲 基于Gazebo的URDF集成仿真流程及实例
【HCIP】路由策略、策略路由
Alipay applet authorization / obtaining user information
MySQL blocking monitoring script
关于Sqli-labs单引号不报错的问题
怎么简单实现菜单拖拽排序的功能
初识C语言 -- 结构体,分支和循环语句
Representation of children and brothers of trees
Chapter 3 business function development (batch export of market activities, Apache POI)
欢迎使用CSDN-markdown编辑器阿萨德
初识C语言 -- 操作符和关键字,#define,指针
0动态规划中等 LeetCode873. 最长的斐波那契子序列的长度
MySQL is shown in the figure. The existing tables a and B need to be associated with a and B tables through projectcode to find idcardnum with different addresses.
mysql: error while loading shared libraries: libtinfo.so. 5 solutions
获取两个集合相差数据
