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

abbr mark and acronym mark

The <abbr> and <acronym> tags represen...

Detailed explanation of how components communicate in React

1. What is We can split the communication between...

How to monitor oracle database using zabbix agent2

Overview In zabbix version 5.0 and above, a new f...

Solution to Linux CentOS 6.5 ifconfig cannot query IP

Recently, some friends said that after installing...

Solution to forgetting MySQL root password in MACOS

MySQL is a relational database management system ...

Why is it not recommended to use index as key in react?

1. Compare the old virtual DOM with the new virtu...

Introduction to deploying selenium crawler program under Linux system

Table of contents Preface 1. What is selenium? 2....

Automatically load kernel module overlayfs operation at CentOS startup

To automatically load kernel modules in CentOS, y...

MySQL 8.0.12 installation and configuration graphic tutorial

Recorded the download and installation tutorial o...

How to connect Django 2.2 to MySQL database

1. The error information reported when running th...

Code analysis of user variables in mysql query statements

In the previous article, we introduced the MySQL ...

3 ways to add links to HTML select tags

The first one : Copy code The code is as follows: ...

React implements a highly adaptive virtual list

Table of contents Before transformation: After tr...