MySQL 5.7.21 winx64 green version installation and configuration method graphic tutorial

MySQL 5.7.21 winx64 green version installation and configuration method graphic tutorial

This article records the installation and configuration method of MySQL 5.7.21. The specific contents are as follows

1. Download

Download

Unzip it to a location you like (do not include Chinese characters in the directory)

For example: D:\Program Files\

2. System environment variable configuration

(1) Adding system variables

Variable Name: MYSQL_HOME
Variable value: Mysql decompression directory, such as D:\Program Files\mysql-5.7.21-winx64

(2) Append PATH

;%MYSQL_HOME%\bin;

3. Configure the my.ini file

Create a new my.ini file in the unzipped root directory

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during installation, and will be replaced if you
# *** upgrade to a newer version of MySQL.
 
[mysqld]
 
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
 
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
 
# These are commonly set, remove the # and set as required.
 basedir = "D:\\Program Files\mysql-5.7.21-winx64"
 datadir = "D:\\Program Files\mysql-5.7.21-winx64\data"
 port = 3306
 character_set_server = utf8
 
# server_id = .....
 
 
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 
 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

4. Start the command prompt window as an administrator

Enter the mysql decompression directory to the bin directory

For example: D:\Program Files\mysql-5.7.21-winx64\bin

Execute separately:

(1) Initialization: mysqld -initialize-insecure

If the error message "failed to set datadir to" is displayed, execute mysqld --initialize --user=mysql --console, and then execute (1).

After it is correct, the data folder and related files will be generated in the root directory of MySQL.

(2) mysqld -install

*If the message "Install/Remove of the Service Denied" appears, it means that the command prompt is not entered as an administrator.

(3) Start the service: net start mysql

(4) Log in and change the password: mysql -u root -p

【Successful login will lead you directly to (5)】

Mine showed up

Add in my.ini

Restart the service and log in successfully

(5) Execute the password change statement (for normal login, use set password = password('new password'); )

update user set authentication_string = password("new password") where user='root';

(6) exit; net stop mysql

(7) If you have successfully logged in, ignore this step

Comment out in my.ini

After restarting, set password = password('new password');

Now you can use it normally.

(8) Test show databases;

5. Write two bat files to start and shut down the mysql service

(1) Start the MySQL service

@echo off
echo Are you sure you want to start the MySQL service?
pause
net start mysql
echo The MySQL service has been started. Please check if there are any errors.
Pause

Save it as mysql service startup .bat file and run it as an administrator

(2) Shut down the MySQL service

@echo off
echo Are you sure you want to shut down the MySQL service?
pause
net stop mysql
echo The shutdown of MySQL service is complete. Please check if there are any errors.
Pause

Save as mysql service shutdown.bat file and run it as an administrator

The MySql installation is now complete.

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.7 installation tutorials for various versions

MySQL 5.6 installation tutorials for various versions

mysql8.0 installation tutorials for various versions

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 5.7.21 winx64 free installation version configuration method graphic tutorial
  • MySQL 5.7.21 winx64 installation and configuration method graphic tutorial under Windows 10
  • MySQL 5.7.21 winx64 installation and configuration method graphic tutorial
  • mysql-5.7.21-winx64 free installation version installation--Windows tutorial detailed explanation

<<:  Detailed explanation of nginx-naxsi whitelist rules

>>:  How to implement parallel downloading of large files in JavaScript

Recommend

20 JavaScript tips to help you improve development efficiency

Table of contents 1. Declare and initialize array...

Detailed explanation of PHP+nginx service 500 502 error troubleshooting ideas

Overview When a 500 or 502 error occurs during ac...

Web front-end performance optimization

Web front-end optimization best practices: conten...

In-depth analysis of the diff algorithm in React

Understanding of diff algorithm in React diff alg...

CSS flex several multi-column layout

Basic three-column layout .container{ display: fl...

WeChat Mini Program Lottery Number Generator

This article shares the specific code of the WeCh...

Docker View the Mount Directory Operation of the Container

Only display Docker container mount directory inf...

How does MySQL achieve multi-version concurrency?

Table of contents MySQL multi-version concurrency...

How to recover accidentally deleted table data in MySQL (must read)

If there is a backup, it is very simple. You only...

How to view Linux ssh service information and running status

There are many articles about ssh server configur...

About the problem of writing plugins for mounting DOM in vue3

Compared with vue2, vue3 has an additional concep...

How to deploy Spring Boot using Docker

The development of Docker technology provides a m...

Tutorial on installing PHP on centos via yum

First, let me introduce how to install PHP on Cen...