A graphic tutorial on how to install MySQL in Windows

A graphic tutorial on how to install MySQL in Windows

Abstract: This article mainly explains how to install MySQL in Windows environment.

Check if MySQL is installed on your computer

Open the cmd window, enter the services.msc command, and wait for the service interface to open:

If you can find the MySQL service in the service, it means that MySQL has been installed on the system:

Download and Install Download

It is recommended to download it from the official website. You can choose the version you need on the official website. The download page on the official website is:

https://dev.mysql.com/downloads/mysql/

This page displays the latest download version by default. If you need to get the previous version, just click the link on the right, which is the red box in the picture:

Then you will find that you can choose the version number, select the system operating environment, and select the operating system bit number to download the corresponding software:

The download link is below:

Install

The official website provides a compressed version that does not need to be installed, so put the downloaded compressed package in the software installation directory and directly decompress it to complete the installation.

Configure environment variables

After unzipping to the installation directory, the next step is to configure the environment variables. Open the system's "Control Panel", then find "System and Security", then find "System", and then find "Advanced System Settings" on the left side of the interface:

After opening, the Advanced tab of the system properties pops up, and find "Environment Variables" at the bottom of the tab:

In the pop-up Environment Variables tab, find the "System Variables" area below, click "New", the variable name is "MYSQL_HOME", the variable value is the address in the folder just unzipped, mine is "D:\All\MySQL\mysql-5.6.44-winx64", click OK to save, as shown in the figure:

Find the "Path" variable in the variable list, click "Edit", in the pop-up interface, click "New" on the right, then fill in "%MYSQL_HOME%\bin", click OK to save, as shown in the figure:

Configuring system files

Open the folder you just unzipped, find the my-default.ini file, copy it and name it my.ini, open the my.ini file and modify it as follows:

[mysqld]
# Set port 3306 port=3306
# Set the installation directory of mysql basedir=D:\All\MySQL\mysql-5.6.44-winx64
# Set the storage directory of mysql database data datadir=D:\All\MySQL\mysql-5.6.44-winx64\data
# Maximum number of connections allowed max_connections=200
# The number of connection failures allowed.
max_connect_errors=10
# The default character set on the server is character-set-server=utf8mb4
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
# Set the import and export folder secure-file-priv=D:\All\MySQL\file
# default_authentication_plugin
default_authentication_plugin=mysql_native_password
# sql_mode
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
# explicit_defaults_for_timestamp
explicit_defaults_for_timestamp=true
[mysql]
# Client default character set default-character-set=utf8mb4
[client]
# The default port used by the client to connect to the server is port=3306
# The default character set when the client connects to the server is default-character-set=utf8mb4

Configuring Services

Use super administrator privileges to open a cmd window, enter the bin folder of the installation directory, and execute the following statement:

mysqld --initialize-insecure --defaults-file=D:\All\MySQL\mysql-5.6.44-winx64\my.ini

--initialize: Create the data file directory and system database, and set the root password to a random number.

--initialize-insecure: Create the data file directory and system database, and set the root password to empty.

--defaults-file: Default configuration file.

Then execute the following statement to install the service:

mysqld --install

--remove: Remove the service.

--install: Install the service and start it automatically.

--install-manual: Install the service and start it manually.

Then execute the following statement to start the service:

net start mysql

net start mysql: Start the service.

net stop mysql: Stop the service.

Login Test Login

Open the cmd window, enter mysql -u root -p to log in as the root user, then press Enter. You will be prompted to enter a password. Since the root user's password was set to empty during the previous configuration, just press Enter to log in successfully:

Change Password

Enter set password for root@localhost = password('123456'); command and press Enter to change the root user's password to 123456:

Use the exit command to log out. You will need to enter the password you just set when you log in next time.

Summarize

The above is the tutorial illustration of installing MySQL in Windows environment introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • MySQL 8.0.13 installation and configuration method graphic tutorial under Windows 64 bit
  • Detailed tutorial on installing mysql-8.0.13 (zip installation) on windows 10 system
  • Solve the problems encountered when installing mysql-8.0.11-winx64 in Windows environment
  • Tutorial diagram of installing MySQL service through MySQL Installer under Windows
  • MySQL installation tutorial under Windows with pictures and text
  • MySQL 5.7.20 installation and configuration method graphic tutorial under Windows
  • MySQL 8.0.12 installation and configuration method graphic tutorial (Windows version)
  • MySQL 8.0.12 installation and configuration method graphic tutorial (windows10)
  • How to install and configure MySQL 8.0.12 decompressed version under Windows 10 with graphic tutorials
  • Graphic tutorial on installing the latest version of MySQL server on Windows 7 64 bit
  • Detailed installation process of MySQL 8.0 Windows zip package version
  • MySQL 8.0.11 Installation Tutorial under Windows
  • mysql8.0 windows x64 zip package installation and configuration tutorial

<<:  How to use jsx syntax correctly in vue

>>:  How to expand the disk size of a virtual machine

Recommend

A brief analysis of the difference between static and self in PHP classes

Use self:: or __CLASS__ to get a static reference...

HTML meta usage examples

Example Usage Copy code The code is as follows: &l...

Docker data volume common operation code examples

If the developer uses Dockerfile to build the ima...

Why does using limit in MySQL affect performance?

First, let me explain the version of MySQL: mysql...

What are Web Slices?

IE8 new feature Web Slices (Web Slices) Microsoft...

A detailed introduction to Linux memory management and addressing

Table of contents 1. Concept Memory management mo...

An article to understand the usage of typeof in js

Table of contents Base Return Type String and Boo...

Vue simple implementation of turntable lottery

This article shares the specific code of Vue to s...

Three ways to draw a heart shape with CSS

Below, we introduce three ways to draw heart shap...

How to clear floating example code in css

Overview The framework diagram of this article is...

How to export and import .sql files under Linux command

This article describes how to export and import ....

iframe adaptive size implementation code

Page domain relationship: The main page a.html bel...

js canvas to realize the Gobang game

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