Testers do not know the password, how to use the mysql database on Linux?

In practice, the testers often met with an awkward question, and that is a long time since there is no database operations, or the transfer of work, because of negligence is not transferred to the database password, causing the test does not know the password database.

How to do it? It would need to modify the database configuration file my.cnf, reset the password.

This article explains how the Linux server to reset the password details. This article will expand in accordance with the following steps:

  1. The first step, download the corresponding software from a network drive
  2. The second step, navicat mysql client connections
  3. The third step, using linux terminal (also available PuTTY) modify the configuration file mysql
  4. A fourth step 123 to reset the password
  5. The fifth step, check whether the password is successfully reset

The first step - installing navicat

Goal: Download the complete Software + Software Installation

Step: downloaded from the Baidu network disk and install software directly navicat

download link:

Links: https://pan.baidu.com/share/init?surl=tLLNKTkcrtp4-H6BzwYx0w  extraction code: 8e67

Tip: navicat testers during the operation of the database when a navicat the most commonly used software.

Installation: Baidu navicat the Web site to download the software, double-click the icon navicat software, all the way to the next step, the installation can be completed.

Step Two - navicat try to connect mysql

Target: client connection MySQL server (the server can be connected using putty tool may be used directly linux terminal)

Step: As shown below

Summary: because they do not know the password, preventing the connection mysql database error. How to do? Modify the configuration file mysql

Step - using linux terminal (also available PuTTY) modify the configuration file mysql

Goal: use mysql linux terminal modifies the configuration file to achieve testers can also log in without a password

Step: backup procedure is divided into four steps:

step1: Query mysql configuration file my.cnf position in Linux


step2: increasing the skip-grant-tables in the configuration file my.cnf (skip authorization table)

 


step3: restart the server, the configuration file my.cnf take effect


step4: authentication does not require a password to access

Note: MySQL database to ensure data security, important data will be encrypted, password as important data, it will be encrypted.

 

Step 4 - 123 to reset the password

Goal: If data is accidentally deleted, know how to recover data

Steps: the step of opening only the following two-step

step1 : Input update navicat modification statements in Query Editor



step2:  Refresh permissions: flush privileges;

Tip: Be sure not to forget to refresh permission or modify the password is invalid

Step 5 - Check the password is successfully reset

Goal: to check whether the password is successfully reset

Step: Check the following method is only one step, login is successful

to sum up

5 steps above, all of the steps is performed mysql password changes. We come under review

The first step, download software from the network drive corresponding to
the second step, the client connection mysql Navicat
third step, using linux terminal (also available PuTTY) mysql modify profile
a fourth step 123 to reset the password to
the fifth step, check the password is successfully reset

Well, according to our technical articles quickly to try to reset the secrets. mysql no longer have to forget your password.

Published 682 original articles · won praise 1391 · Views 1.71 million +

Guess you like

Origin blog.csdn.net/itcast_cn/article/details/105389304