Method 1: Use the SET PASSWORD command First log in to MySQL. Format: mysql> set password for username@localhost = password('new password'); Example:mysql> set password for root@localhost = password('123'); Method 2: Using mysqladmin Format: mysqladmin -u username -p old password password new password Example: mysqladmin -uroot -p123456 password 123 Method 3: Use UPDATE to edit the user table directly First log in to MySQL. 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, you can do this Take Windows as an example: 1. Shut down the running MySQL service. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: jQuery realizes the scrolling effect of table row data
>>: Implementation of FIFO in Linux process communication
--When connecting to the database, the matching r...
Table of contents 1. Introduction 2. Switching 1....
1. Add the following code to http{} in nginx.conf...
Table of contents Overview 0. JavaScript and Web ...
<base target=_blank> changes the target fram...
Table of contents Overview Static type checking C...
I use tengine, the installation directory is /usr...
Using the official MySQL image requires some modi...
Table of contents Preface How to switch between m...
<br />Generally speaking, the file organizat...
I am using centos 7 64bit system here. I have tri...
For security reasons, Alibaba Cloud Server ECS co...
Last year, the open letter was a huge hit, even a...
Table of contents Preface Error Object throw try…...
1. Mirror images disappear in 50 and 93 [root@h50...