Method 1: Use the SET PASSWORD command MySQL -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass'); Method 2: Using mysqladmin mysqladmin -u root password "newpass" If the root password has been set, use the following method mysqladmin -u root password oldpass "newpass" Method 3: Use UPDATE to edit the user table directly mysql -u root mysql> use mysql; mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root'; mysql> FLUSH PRIVILEGES; When you lose your root password, you can mysqld_safe --skip-grant-tables& mysql -u root mysql mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root'; mysql> FLUSH PRIVILEGES; The above are the various methods of changing the root password of MySQL that I introduced to you. 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:
|
<<: Native JavaScript implementation of progress bar
>>: How to use Docker container to access host network
Six effectsImplementation Code html <h1>CSS...
Recently, a database in the production environmen...
Sometimes, we don't want the content presente...
Table of contents 1. Mapped Types 2. Mapping Modi...
Regarding the connection method between Java and ...
It has to be said that a web designer is a general...
Table of contents Achieve results Introduction to...
Table of contents Preface first step: Step 2: Mod...
Example: We use the Python code loop_hello.py as ...
Preface In project development, there are many wa...
Pop-up news is common in domestic Internet servic...
Table of contents Preface What does yarn create d...
Page replacement algorithm: The essence is to mak...
Table of contents fold (reduce) Using for...of Us...
Table of contents 1. Reverse proxy preparation 1....