Two ways to reset the root password of MySQL database using lnmp

Two ways to reset the root password of MySQL database using lnmp

The first method: Use Junge's one-click script to modify the MYSQL database password in the LNMP environment

One-click scripts are certainly very convenient. Specifically execute the following commands:

wget http://soft.vpser.net/lnmp/ext/reset_mysql_root_password.sh
sh reset_mysql_root_password.sh

Convenient, right?

The second method: Modify through commands, as follows:

a. Stop MySQL service

Execute: /etc/init.d/mysql stop

b. Skip verification and start MySQL

/usr/local/mysql/bin/mysqld_safe –skip-grant-tables >/dev/null 2>&1 &

Then:

mysql mysql -uroot //Login to mysql> UPDATE user SET Password=PASSWORD('new password') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

Then restart mysql

/etc/init.d/mysql start

Summarize

The above are two methods that I introduced to you about how to use lnmp to reset the root password of the MySQL database. 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. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • The best solution for resetting the root password of MySQL 8.0.23
  • How to reset the root password in Linux mysql-5.6
  • The easiest way to reset mysql root password
  • Solve the problem of resetting the Mysql root user account password
  • Complete steps to reset the root user password in mysql8
  • How to reset the root password in mysql8.0.12
  • MySQL/MariaDB Root Password Reset Tutorial
  • Tutorial on resetting the root password of Mac MySQL
  • How to reset MySQL root password under Windows
  • How to Reset MySQL or MariaDB Root Password in Linux
  • Tutorial on resetting the root password of MySQL under CentOS
  • How to reset MySQL root password

<<:  How to configure two-way certificate verification on nginx proxy server

>>:  Analysis of Vue element background authentication process

Recommend

Summary of event handling in Vue.js front-end framework

1. v-on event monitoring To listen to DOM events,...

Explanation of the concept and usage of Like in MySQL

Like means "like" in Chinese, but when ...

How to implement the singleton pattern in Javascript

Table of contents Overview Code Implementation Si...

Use the njs module to introduce js scripts in nginx configuration

Table of contents Preface 1. Install NJS module M...

Centos7 installation of MySQL8 tutorial

MySQL 8 new features: My personal opinion on MySQ...

MySQL partition table is classified by month

Table of contents Create a table View the databas...

How to use nginx as a proxy cache

The purpose of using cache is to reduce the press...

Let's talk in detail about how the NodeJS process exits

Table of contents Preface Active withdrawal Excep...

XHTML Getting Started Tutorial: Using the Frame Tag

<br />The frame structure allows several web...

Optimizing the slow query of MySQL aggregate statistics data

Written in front When we operate the database in ...

How to configure nginx to return text or json

Sometimes when requesting certain interfaces, you...

How to use skeleton screen in vue project

Nowadays, application development is basically se...

JavaScript function call classic example code

Table of contents JavaScript function call classi...