All prerequisites require root permissions 1. End the mysql process //Linux sudo services mysql stop //Mac brew services stop mysql 2.mysql background running mysqld_safe --skip-grant-tables & mysql &, means running in the background without opening a new terminal 3. Change password use mysql; update user set password = password("new password") where user='root'; flush privileges; Knowing the original password Use the mysqladmin command on the command line mysqladmin -u root -p oldpassword "newpassword" Or you can enter the MySQL database and modify it directly, refer to the third step above [Change Password] The above is the method of changing the password of Linux/Mac MySQL command line when you forget the password. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of docker command to backup linux system
>>: How to use Dayjs to calculate common dates in Vue
Nginx is configured with the same domain name, wh...
When you are working on a shared system, you prob...
Table of contents 2. Field concatenation 2. Give ...
Preface Some of the earlier codes on Github may r...
In Linux, there are two types of file connections...
Which historical version can the current transact...
Importing data with incorrect MySQL character set...
Table of contents Preface text 1. Panel 2. Huaron...
Part 1 Overview of SSH Port Forwarding When you a...
Table of contents 1. Process Control 2. Sequentia...
<br /> English original: http://desktoppub.a...
Today, let's talk about a situation that is o...
Add table fields alter table table1 add transacto...
I wrote some Qt interface programs, but found it ...
This article mainly introduces the sample code of...