Method 1: Use the SET PASSWORD command mysql> set password for username@localhost = password('new password'); -- Examplemysql> set password for root@localhost = password('123'); Method 2: Using mysqladmin mysql> mysqladmin -u username -p old password password new password; -- Examplemysql> mysqladmin -uroot -p123456 password 123; Method 3: Use UPDATE to edit the user table directly mysql> use mysql; mysql> update user set password=password('123') where user='root' and host='localhost'; mysql> flush privileges; Method 4: When you forget the root password Take Windows as an example:
The above is the details of how to modify the password of the root user in MySQL. For more information about modifying the password of the root user in MySQL, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: How to use gdb to debug core files in Linux
>>: JavaScript to achieve digital clock effects
Table of contents Introduction Using Strict mode ...
The first and most important step is how to insta...
Table of contents Requirement: Query ongoing acti...
W3Cschool explains it this way The <meta> el...
An event is an action performed by the user or th...
This article example shares the specific code of ...
The event scheduler in MySQL, EVENT, is also call...
1. Use frameset, frame and iframe to realize mult...
In Windows operating system, the program to query...
Preface This article introduces the use of vue-ro...
Apollo open source address: https://github.com/ct...
mysql query with multiple conditions Environment:...
Effect The effect diagram is as follows Implement...
yum install vsftpd [root@localhost etc]# yum -y i...
Preface I recently used a virtual machine to inst...