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

Docker builds python Flask+ nginx+uwsgi container

Install Nginx First pull the centos image docker ...

Two types of tab applications in web design

Nowadays, tabs are widely used in web design, but...

CentOS7 deployment Flask (Apache, mod_wsgi, Python36, venv)

1. Install Apache # yum install -y httpd httpd-de...

TypeScript interface definition case tutorial

The role of the interface: Interface, in English:...

MySQL 5.7.17 installation and configuration method graphic tutorial

This article shares the installation and configur...

Detailed explanation of MySQL user and permission management

This article uses examples to describe the manage...

JavaScript to achieve the effect of clicking on the self-made menu

This article shares the specific code of JavaScri...

MySQL replication table details and example code

MySQL replication table detailed explanation If w...

Mysql date formatting and complex date range query

Table of contents Preface Query usage scenario ca...

Example of implementing skeleton screen with Vue

Table of contents Skeleton screen use Vue archite...

Problems and solutions encountered when installing mininet on Ubuntu 16.04.4LTS

Mininet Mininet is a lightweight software defined...