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 is a detailed tutorial on setting passwords for the MySQL free installation version introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time! You may also be interested in:
|
<<: Methods for optimizing Oracle database with large memory pages in Linux
>>: Canvas draws scratch card effect
Preface Believe me, as long as you remember the 7...
Scenario simulation: The operation and maintenanc...
The nginx configuration file is mainly divided in...
introduction I discovered a problem before: somet...
Why do we need virtual dom? Virtual DOM is design...
Preface: MySQL master-slave architecture should b...
This article shares the data display code for Jav...
MySQL 5.7.18 free installation version installati...
Using mock.js in Vue project Development tool sel...
1.Mysql connection method To understand the MySQL...
MySQL Workbench - Modeling and design tool 1. Mod...
This article shares the specific code of js to ac...
Let's first look at the definition of the pos...
Pure js implements a single-click editable table ...
1. Parent div defines pseudo-classes: after and z...