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

How to configure /var/log/messages in Ubuntu system log

1. Problem Description Today I need to check the ...

Detailed explanation of js's event loop event queue in the browser

Table of contents Preface Understanding a stack a...

Vuex modularization and namespaced example demonstration

1. Purpose: Make the code easier to maintain and ...

MySQL data compression performance comparison details

Table of contents 1. Test environment 1.1 Hardwar...

Implementation steps for installing java environment in docker

This article is based on Linux centos8 to install...

Zabbix implements monitoring of multiple mysql processes

Three MySQL instance processes are started on one...

Vue defines private filters and basic usage

The methods and concepts of private filters and g...

MySql5.7.21 installation points record notes

The downloaded version is the Zip decompression v...

After docker run, the status is always Exited

add -it docker run -it -name test -d nginx:latest...

Use and understanding of MySQL triggers

Table of contents 1. What is a trigger? 2. Create...

jQuery achieves seamless scrolling of tables

This article example shares the specific code of ...

How to start jar package and run it in the background in Linux

The Linux command to run the jar package is as fo...