Tutorial on installing and changing the root password of MySQL 5.7.20 decompressed version

Tutorial on installing and changing the root password of MySQL 5.7.20 decompressed version

1. Download MySQL Archive (decompressed version)

URL: https://downloads.mysql.com/archives/community/

2. Unzip the file to the custom installation directory:

There is no "data" folder and "my.ini" configuration file after decompression

3. Configure environment variables after decompression

System variables: Create a new "MYSQL_HOME" value: xxx\mysql-5.7.20-winx64 (custom installation directory root path)

Append Path:;%MYSQL_HOME%\bin

4. Create a "my.ini" configuration file in the root directory of the custom installation path

Configuration information:

[client]
port = 3306
[mysqld]
port = 3306
basedir=%MYSQL_HOME%
datadir=%MYSQL_HOME%\data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#Skip password skip-grant-tables

5. Initialize and install MySQL:

In the cmd terminal (it is recommended to run with administrator privileges)

>mysqld --initialize
>mysqld -install //Install the MySQL service. You can view the service in services.msc>net start/stop mysql //Open and close mysql

6. Set the root user password

>mysql -u root -p
enter password: Press Enter directly to enter mysql>update mysql.user set authentication_string=password('123') where user='root' and host='localhost';
mysql>flush privileges;

Exit mysql

Go to my.ini and comment out skip-grant-tables

After logging into MySQL, you will be prompted:

mysql error You must reset your password using ALTER USER statement before executing this statement.
mysql>SET PASSWORD=PASSWORD('123');
mysql>ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
mysql>flush privileges;

Just log in again.

Summarize

The above is the tutorial on how to install the decompressed version of MySQL 5.7.20 and change the root password. 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:
  • MySQL 8.0.13 decompression version installation and configuration method graphic tutorial
  • Summary of installation steps and problems encountered in decompressing the mysql5.7.24 version
  • How to install and configure MySQL 8.0.12 decompressed version under Windows 10 with graphic tutorials
  • MySQL 8.0.12 winx64 decompression version installation graphic tutorial
  • mysql8.0.0 winx64.zip decompression version installation and configuration tutorial
  • Installation and uninstallation of MySQL 5.7 decompressed version and summary of common problems
  • Detailed steps for installing the decompressed version of MySQL 5.7.20 (two methods)
  • Python connects to the database MySQL decompressed version installation configuration and encountered problems

<<:  A brief discussion on the Linux kernel's support for floating-point operations

>>:  Detailed explanation of JS ES6 coding standards

Recommend

HTML tutorial, understanding the optgroup element

Select the category selection. After testing, IE ...

Detailed installation and configuration of Subversion (SVN) under Ubuntu

If you are a software developer, you must be fami...

Two ways to write stored procedures in Mysql with and without return values

Process 1: with return value: drop procedure if e...

Native JS to implement sharing sidebar

This article shares a sharing sidebar implemented...

How to implement scheduled backup of MySQL in Linux

In actual projects, the database needs to be back...

Inspiring Design Examples of Glossy and Shiny Website Design

This collection showcases a number of outstanding ...

How to isolate users in docker containers

In the previous article "Understanding UID a...

MySQL 5.7.13 installation and configuration method graphic tutorial on Mac

MySQL 5.7.13 installation tutorial for Mac, very ...

Solution to the problem of adaptive height and width of css display table

Definition and Usage The display property specifi...

Mycli is a must-have tool for MySQL command line enthusiasts

mycli MyCLI is a command line interface for MySQL...

How to use environment variables in nginx configuration file

Preface Nginx is an HTTP server designed for perf...

Detailed explanation of MySQL information_schema database

1. Overview The information_schema database is th...

Apache Spark 2.0 jobs take a long time to finish when they are finished

Phenomenon When using Apache Spark 2.x, you may e...

How to wrap HTML title attribute

When I was writing a program a few days ago, I wan...