Detailed tutorial for installing mysql5.7.21 under Windows

Detailed tutorial for installing mysql5.7.21 under Windows

This article shares the installation tutorial of MySQL 5.7.21 for your reference. The specific contents are as follows

Installation Environment

Windows version: Windows 7 Professional 64bit
MySQL version: MySQL 5.7.21

Before installing MySQL, please make sure that the net command on your computer is working properly. Some Windows systems may be missing the net command (environment variable missing).

Installation Process

1. Download MySQL Community Server

2. Unzip and "reasonably place" MySQL Server

3. Configure environment variables for MySQL Server

---In the "User variables" section, select "New". In the dialog box that opens, write MySQL as the variable name and the full path of the MySQL folder (D:\MYSQL\mysql-5.7.21-winx64) as the variable value.

---Look for the PATH environment variable in the User section, if it is there, click "Edit". Use a semicolon at the end of the variable value; to separate it, then add %MySQL%\bin;
If not, click "New" and add an environment variable named Path. In the variable value of this environment variable, add %MySQL%\bin.

4. Register MySQL service

-----cd to the bin folder of the folder where MySQL Server is located----------------mysqld -install command, register MySQL service

5. Create the my.ini file in the MySQL directory (D:\MYSQL\mysql-5.7.21-winx64) with the following content:

[mysql] 
# Set the default character set of the mysql client to default-character-set=utf8 
[mysqld] 
#Set port 3306 port = 3306 
# Set the installation directory of mysql to basedir=F:\mysql-5.7.21-winx64 
# Set the storage directory of mysql database data datadir=F:\mysql-5.7.21-winx64\data 
# Maximum number of connections allowed max_connections=200 
# The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8 
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

6. Generate data directory:

----In the "Command Prompt" just now, execute mysqld --initialize

7. Start MySQL Server

----Execute net start mysql in the "Command Prompt" to start MySQL Server

8. Configure the MySQL root account.

In the Command Prompt, execute net stop mysql to shut down the MySQL Server.

Then execute mysqld --skip-grant-tables to start the password-less MySQL Server.

Open a new Command Prompt and execute mysql -u root to log in to the MySQL Server.

Run the flush privileges command to refresh permissions.

Execute grant all privileges on *.* to 'root'@'localhost' identified by 'the password you want to set' with grant option;.

Run the flush privileges command to refresh the new root user password.

Execute exit to exit MySQL.

Run net start mysql in the Command Prompt to restart MySQL Server, and then use mysql -u root -p again with the password you set to log in to MySQL securely.

9. Possible problems:

After installing mysql, I changed the ROOT password and used net start mysql ------ and it said that it could not be started

Solution: Execute mysqladmin -u root -p shutdown and enter the set password to start successfully

The above command line must be opened with administrator privileges .

Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for various versions of MySQL 5.7

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:
  • Detailed tutorial for installing mysql5.7.21 under Windows system
  • MySQL 5.7.19 installation tutorial under Windows 10 How to change the root password of MySQL after forgetting it
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7 installation tutorial (windows)
  • Detailed graphic tutorial on how to install the unzipped version of MySQL under Windows 10
  • How to install and configure MySQL 8.0.12 decompressed version under Windows 10 with graphic tutorials
  • How to install and uninstall MySQL service under Windows (MySQL 5.6 zip decompression version installation tutorial)
  • Detailed tutorial for installing the unzipped version of mysql5.7.28 winx64 on windows

<<:  Detailed steps for installing Harbor, a private Docker repository

>>:  How to use JS to parse the excel content in the clipboard

Recommend

VMware Workstation 14 Pro installation and activation graphic tutorial

This article shares the installation and activati...

HTML Basics: HTML Content Details

Let's start with the body: When viewing a web ...

An article teaches you how to use js to achieve the barrage effect

Table of contents Create a new html file: Create ...

How to implement a single file component in JS

Table of contents Overview Single file components...

How to use JSX in Vue

What is JSX JSX is a syntax extension of Javascri...

Vue.js manages the encapsulation of background table components

Table of contents Problem Analysis Why encapsulat...

Detailed explanation of the solution to image deformation under flex layout

Flex layout is a commonly used layout method nowa...

Implementation of docker view container log command

Why should we read the log? For example, if the c...

How to build a redis cluster using docker

Table of contents 1. Create a redis docker base i...

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...

MySQL million-level data paging query optimization solution

When there are tens of thousands of records in th...

JS array deduplication details

Table of contents 1 Test Cases 2 JS array dedupli...