Navicat multiple ways to modify MySQL database password

Navicat multiple ways to modify MySQL database password

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.
2. Open a DOS window and go to the mysql\bin directory.
3. Enter mysqld –skip-grant-tables and press Enter. –skip-grant-tables means skipping the permission table authentication when starting the MySQL service.
4. Open another DOS window (because the previous DOS window cannot be moved) and go to the mysql\bin directory.
5. Type mysql and press Enter. If successful, the MySQL prompt > will appear.
6. Connect to the privilege database: use mysql; .
6. Change the password: update user set password=password(“123”) where user=”root”; (don’t forget to add a semicolon at the end).
7. Refresh privileges (required step): flush privileges; .
8. Exit quit.
9. Log out of the system, log back in, and log in using the username root and the new password 123 you just set.

Summarize

The above are the various methods that I introduced to you about how to modify the MySQL database password using Navicat. 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!

You may also be interested in:
  • Navicat remote connection to MySQL implementation steps analysis
  • Tutorial on installing MySQL database and using Navicat for MySQL
  • Simple tutorial on using Navicat For MySQL
  • Navicat for MySql Visual Import CSV File
  • Import csv file into mysql using navicat
  • Detailed explanation of the idea of ​​installing mysql8.0.11 and changing the root password and connecting navicat for mysql
  • Navicat for MySQL 11 Registration Code\Activation Code Summary

<<:  React Native environment installation process

>>:  How to configure common software on Linux

Recommend

Reasons and solutions for MySQL selecting the wrong index

In MySQL, you can specify multiple indexes for a ...

Implementation of Redis master-slave cluster based on Docker

Table of contents 1. Pull the Redis image 2. Crea...

Detailed steps for developing WeChat mini-programs using Typescript

We don't need to elaborate too much on the ad...

How to fix some content in a fixed position when scrolling HTML page

This article mainly introduces how some content i...

Detailed explanation of Vue configuration request multiple server solutions

1. Solution 1.1 Describing the interface context-...

Example of stars for CSS rating effect

What? What star coat? Well, let’s look at the pic...

Nginx configuration file detailed explanation and optimization suggestions guide

Table of contents 1. Overview 2. nginx.conf 1) Co...

HTML code example: detailed explanation of hyperlinks

Hyperlinks are the most frequently used HTML elem...

JavaScript to achieve lottery effect

This article shares the specific code of JavaScri...

mysql solves the problem of finding records where two or more fields are NULL

Core code /*-------------------------------- Find...

React ref usage examples

Table of contents What is ref How to use ref Plac...

18 Web Usability Principles You Need to Know

You can have the best visual design skills in the...