Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to change the reset password above mysql server8.0

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to change the reset password above mysql server8.0". The explanation in the article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to change the reset password above mysql server8.0".

Change the reset password above mysql server 8.0

[mysqld]

Character-set-server=utf8

# use # skip-grant-tables # to set the protocol authentication method when you forget your password (key point)

Default_authentication_plugin=mysql_native_password

The specific operation procedure is as follows:

Method 1: use the-- init-file parameter to solve the problem that specifies that when the service starts, a file containing sql commands will be executed first.

Therefore, you only need to write the command to reset the password in the file, use this parameter to specify that the command is executed at startup, and the system password can be reset when startup is complete.

The first step is to turn off the system service net stop mysql

The second step is to create a text file with a password modification command ALTER USER 'root'@'localhost' IDENTIFIED BY'

Step 3: start the server on the command line, and specify the above password modification command file mysqld-init-file=reset.sql-console to be executed at startup

-

Method 2, find a way to make the-- skip-grant-tables parameter work.

In the first method, the service of the system is first turned off. Under the mysql8 system, the service can be started without a password by using mysqld-console-skip-grant-tables-shared-memory.

After the service starts, log in to the system mysql.exe-u root with an empty password

Then execute the sql command to set the root user password to empty

UPDATE mysql.user SET authentication_string='' WHERE user='root' and host='localhost'

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY'1234567'; -' location'% means it can be remotely

CREATE USER 'super'@'%'IDENTIFIED WITH mysql_native_password BY' 1234567'

SHOW VARIABLES LIKE 'validate_password%'; set global validate_password.policy = LOW

# check the user table select host, user, authentication_string, plugin from user;-- plugin: password encryption method

Thank you for reading, the above is the content of "how to modify the reset password above mysql server8.0". After the study of this article, I believe you have a deeper understanding of how to modify the reset password above mysql server8.0, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report