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

Vue implements anchor positioning function

This article example shares the specific code of ...

Several ways to implement 0ms delay timer in js

Table of contents queueMicrotask async/await Mess...

Detailed explanation of Redis master-slave replication practice using Docker

Table of contents 1. Background 2. Operation step...

Change the MySQL database engine to InnoDB

PS: I use PHPStudy2016 here 1. Stop MySQL during ...

This article teaches you how to play with CSS border

Border Style The border-style property specifies ...

How to build nfs service in ubuntu16.04

Introduction to NFS NFS (Network File System) is ...

How to configure NAS on Windows Server 2019

Preface This tutorial installs the latest version...

Learning Vue instructions

Table of contents 1. v-text (v-instruction name =...

Jmeter connects to the database process diagram

1. Download the MySQL jdbc driver (mysql-connecto...

How to optimize logic judgment code in JavaScript

Preface The logical judgment statements we use in...

12 Javascript table controls (DataGrid) are sorted out

When the DataSource property of a DataGrid control...

15 Best Practices for HTML Beginners

Here are 30 best practices for HTML beginners. 1....

SQL fuzzy query report: ORA-00909: invalid number of parameters solution

When using Oracle database for fuzzy query, The c...

How to modify the IP restriction conditions of MySQL account

Preface Recently, I encountered a requirement at ...

Detailed explanation of the use of redux in native WeChat applet development

premise In complex scenarios, a lot of data needs...