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

Web Design Teaching or Learning Program

Section Course content Hours 1 Web Design Overvie...

Will mysql's in invalidate the index?

Will mysql's IN invalidate the index? Won'...

ReactJs Basics Tutorial - Essential Edition

Table of contents 1. Introduction to ReactJS 2. U...

Summary of Linux file directory management commands

touch Command It has two functions: one is to upd...

Ideas and practice of multi-language solution for Vue.js front-end project

Table of contents 1. What content usually needs t...

Tips for writing concise React components

Table of contents Avoid using the spread operator...

Detailed explanation of Nginx proxy_redirect usage

Today, I encountered a little problem when I was ...

Use of Linux ifconfig command

1. Command Introduction The ifconfig (configure a...

How to quickly modify the root password under CentOS8

Start the centos8 virtual machine and press the u...

Web front-end performance optimization

Web front-end optimization best practices: conten...

MySQL database architecture details

Table of contents 1. MySQL Architecture 2. Networ...

How to configure anti-hotlinking for nginx website service (recommended)

1. Principle of Hotlinking 1.1 Web page preparati...