MySQL implements an example method of logging in without a password

MySQL implements an example method of logging in without a password

Specific method:

Step 1: Stop the mysql service

/etc/init.d/mysqld stop

Step 2: Skip password verification

/usr/bin/mysqld_safe --skip-grant-tables

or

mysqld_safe --skip-grant-tables

Start mysql by skipping the privilege tables.

Step 3: Open another command prompt window

use mysql;#Insert the deleted records and then change the password update user set password=password("new_pass") where user="root";

Step 4: Refresh permissions

flush privileges;

Content extension:

Solve the problem of MySQL logging in without a password

Because I executed a command to change the database root user password. After I changed it, I found that I could log in with both the new and old passwords. So I thought I could log in without entering a password and just press Enter. I did not perform password-free login in the configuration. Finally, I executed a command to solve the problem: update user set plugin = "mysql_native_password";

Changing passwords and solving password-less login problems are all in the following commands:

> use mysql;

> update user set authentication_string=password("your password") where user='root'; #(version without password field, that is, version <=5.7)
> update user set password=password('your password') where user='root'; #(version with password field, version>5.7)

> update user set plugin="mysql_native_password"; 

> flush privileges;

> exit;

Restart mysql service

The above is the details of the example method of implementing MySQL login without a password. For more information on how to implement MySQL login without a password, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Introduction to some operations of MySQL secure password input
  • How to change the secure processing password in MySQL 5.6
  • Quick solution for forgetting MySQL8 password
  • How to retrieve password for mysql 8.0.22 on Mac
  • Detailed explanation of MySQL 8.0 password expiration policy
  • How to change the root user's password in MySQL
  • How to reset the root password in Linux mysql-5.6
  • How to safely shut down MySQL
  • How to gracefully and safely shut down the MySQL process
  • It's the end of the year, is your MySQL password safe?

<<:  js object to achieve data paging effect

>>:  Modification of the default source sources.list file of ubuntu20.04 LTS system

Recommend

An Uncommon Error and Solution for SQL Server Full Backup

1. Error details Once when manually performing a ...

How to install MySQL database on Debian 9 system

Preface Seeing the title, everyone should be thin...

Form submission refresh page does not jump source code design

1. Design source code Copy code The code is as fol...

el-table in vue realizes automatic ceiling effect (supports fixed)

Table of contents Preface Implementation ideas Ef...

How to use a field in one table to update a field in another table in MySQL

1. Modify 1 column update student s, city c set s...

Analysis of several reasons why Iframe should be used less

The following graph shows how time-consuming it is...

Why not use UTF-8 encoding in MySQL?

MySQL UTF-8 encoding MySQL has supported UTF-8 si...

MySQL 5.6.36 Windows x64 version installation tutorial detailed

1. Target environment Windows 7 64-bit 2. Materia...

Docker volume deletion operation

prune To use this command, both the client and da...

How to modify the initial password of a user in mysql5.7

When users install MySQL database for the first t...

In-depth analysis of the Linux kernel macro container_of

1. As mentioned above I saw this macro when I was...

Let's talk about the storage engine in MySQL

Basics In a relational database, each data table ...

Detailed explanation of Vue filter implementation and application scenarios

1. Brief Introduction Vue.js allows you to define...