Detailed graphic and text tutorial on downloading, installing and configuring mysql-5.7.28 under Windows

Detailed graphic and text tutorial on downloading, installing and configuring mysql-5.7.28 under Windows

Recently I need to change the version of MySQL database, write an article to record it

1. Download MySQL database

There are two types of MySQL downloads, one is a zip compressed file, and the other is an MSI installer. Official 5.7 version zip compressed file download page Official 5.7 version MSI installer download page

I choose 5.7.28-Windows 64 bit here


Click on the lower left corner to start downloading


Use Thunder or IDM to download faster.


Two files after downloading


2. Install MySQL database

I use the zip compressed file to install here, which is free to install and has more configuration content

1. Unzip the installation file


Note: Do not include Chinese characters in the decompressed path! ! !


2. Configure MySQL

Double-click to enter the bin directory


Create a new data folder and then create a new text file, rename it to my.ini (note that the computer may not display the file extension, so do not put the my.ini file in the data folder)


Use a text editor to open the my.ini file and copy the following configuration text into the my.ini file

Modify to the configuration content of your own computer (be sure to delete all the lines containing Chinese characters)


Save and close the editor

[mysqld]
# Set the character set used by the server to utf-8
character-set-server=utf8
# Bind IPv4 address bind-address = 0.0.0.0
# Set the mysql port number port = 3306
# Set the installation directory of mysql (you can see bin)
basedir=D:\Applocations\64_mysql\mysql-5.7.28-winx64
# Set the storage directory of mysql database data (the directory where you can see the my.ini file)
datadir=D:\Applocations\64_mysql\mysql-5.7.28-winx64\data
# Maximum number of connections allowed max_connections=2000
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
# Set the default encoding for mysql and database [mysql]
default-character-set=utf8
[mysql.server]
default-character-set=utf8
# Set the client default character set [client]
default-character-set=utf8

3. Install MySQL

Go to bin/ directory and enter cmd in the address bar, then press Enter to open the cmd command line terminal


The address path cannot contain Chinese characters. If you didn't notice it before, you can cut the MySQL installation file to a pure English path.


Execute the installation command in the cmd terminal

# Installation command mysqld --install
# Uninstall command mysqld --remove

Prompt that the installation is successful


4. Initialize mysql

Continue to execute the initialization command in the terminal (you can initialize multiple times, but you must clear the data folder each time)

# Initialize mysql database mysqld --initialize --user=root --console

After the execution is completed, a random password will be assigned to the mysql root user, as shown in the figure


5. Log in to MySQL

Start the mysql service by command in the terminal

# Start the mysql service net start mysql
# Stop the mysql service net stop mysql 

Use the command to connect to mysql

Note: This password is the random password generated by initializing MySQL before

mysql -uroot -p passwordmysql -uroot -p 

6. Change the mysql password

The default random password can also be used, but it is too difficult to remember. You can set a simple password

Execute the following command to set the mysql password

# Set the mysql password set password = password('password');
# Exit mysql database exit 

7. Configure MySQL environment variables

Go to 'This Computer' --> 'Properties' --> 'Advanced System Settings' --> 'Environment Variables'


Create a new system variable under System Variables

Variable Name: MYSQL_HOME
Variable value: D:\Applocations\64_mysql\mysql-5.7.28-winx64 (you can see the mysql decompression path in the bin directory) 

Add environment variables under path

Copy the code as follows:
%MYSQL_HOME%\bin

Reopen the cmd terminal at will, use the command plus the modified password, and you can directly connect to mysql


3. Add users to MySQL database

root user is the super user of the MySQL database. It has high permissions and is not safe to use. It is recommended to create a new user. Of course, it is also possible not to create a new user.

Use the following command in the terminal to create a new user and grant permissions

# Format description grant permission on database.table to username@connected ip address identified by 'password';
# For example, grant all permissions on all tables in all databases to the test user with password 1234. grant all on *.* to test@'%' identified by'1234'; 

So far, mysql installation is complete, and you can use navicat to connect to the database

Summarize

The above is a detailed graphic tutorial on downloading, installing, and configuring mysql-5.7.28 under Windows. I hope it will be helpful to you. If you have any questions, please leave me a message and I 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 5.7.30 Installation and Upgrade Issues Detailed Tutorial
  • Detailed steps to install MySQL 5.7 via YUM on CentOS7
  • Tutorial on installing MySQL 5.7.28 on CentOS 6.2 (mysql notes)
  • MySQL 5.7.27 installation and configuration method graphic tutorial
  • MySQL5.7.27-winx64 version win10 download and installation tutorial diagram
  • MySQL 5.7 installation and configuration tutorial under CentOS7 64 bit
  • MySQL 5.7.33 installation process detailed illustration

<<:  Native js imitates mobile phone pull-down refresh

>>:  How to implement scheduled backup and incremental backup of uploaded files in Linux

Recommend

A brief discussion on why daemon off is used when running nginx in docker

I'm very happy. When encountering this proble...

Methods of adaptive web design (good access experience on mobile phones)

1. Add the viewport tag to the HTML header. At th...

mysql5.7.20 installation and configuration method graphic tutorial (mac)

MySQL 5.7.20 installation and configuration metho...

Basic syntax of MySQL index

An index is a sorted data structure! The fields t...

Practical record of handling MySQL automatic shutdown problems

I recently helped someone with a project and the ...

js to upload pictures to the server

This article example shares the specific code of ...

JS gets the position of the nth occurrence of a specified string in a string

Learn about similar methods for getting character...

Detailed explanation of the use of router-view components in Vue

When developing a Vue project, you often need to ...

How to use filters to implement monitoring in Zabbix

Recently, when I was working on monitoring equipm...

Solve the Linux Tensorflow2.0 installation problem

conda update conda pip install tf-nightly-gpu-2.0...

JavaScript to implement login slider verification

This article example shares the specific code of ...