Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of the download, installation and configuration tutorials of mysql-5.7.28 under Windows

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Recently, you need to change the version of the mysql database. Write an article and record it.

Download mysql database

There are two kinds of downloads for mysql, one is zip compressed file, the other is msi installer

Official version 5.7 zip zip file download page

Official version 5.7 msi installer download page

I choose 5.7.28-Windows64 bit here.

Click on the lower left corner to start downloading directly

Use downloaders such as Xunlei or IDM to download faster.

Two files after the download is completed

Second, install the mysql database

I use zip compressed files to install here, which is installation-free and has a little more configuration.

1. Extract the installation file

Note: do not appear Chinese in the decompressed path!

two。 Configure mysql

Double-click to enter the directory where you can see the bin

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

Open the my.ini file using a text editor and copy the following configuration text content to the my.ini file

Change it to the configuration of your computer (be sure to delete all the lines of Chinese text)

Save and close the editor

[mysqld] # set the character set used by the server as utf-8character-set-server=utf8# binding IPv4 address bind-address = 0.0.0." set the port number of mysql port = 330 set the installation directory of mysql (you can see the bin) basedir=D:\ Applocations\ 64_mysql\ mysql-5.7.28-winx64# set the directory where the data of the mysql database is stored (the directory where you can see the my.ini files) datadir=D :\ Applocations\ 64_mysql\ mysql-5.7.28-winx64\ data# allows the maximum number of connections the default storage engine default-storage-engine=INNODB# setting mysql and database default encoding [mysql] default-character-set=utf8 [mysql.server] default-character-set=utf8# setting client default character set [client] default-character-set=utf8 that max_connections=2000# will use when creating a new table

3. Install mysql

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

The address path cannot contain Chinese. If you haven't noticed before, you can cut the mysql installation file to the pure English path.

Execute the installation command in the cmd terminal

# installation command mysqld-- install# uninstall command mysqld-- remove

Prompt installation is successful

4. Initialize mysql

Continue to execute initialization commands on the terminal (you can initialize multiple times, but you must empty the data folder each time)

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

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

5. Log in to mysql

Start the mysql service by command at the terminal

# start mysql service net start mysql# stop mysql service net stop mysql

Use the command to connect to mysql

Note: this password is the random password generated by the previous initialization mysql.

Mysql-uroot-p password mysql-uroot-p

6. Change the password of mysql

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 password for mysql

# set mysql password set password = password ('password'); # exit mysql database exit

7. Configure the environment variables for mysql

So 'this computer'-> 'Properties'-> 'Advanced system Settings'-> 'Environment variables'

Create a new system variable under system variabl

Variable name: MYSQL_HOME variable value: d:\ Applocations\ 64_mysql\ mysql-5.7.28-winx64 (you can see the mysql decompression path of the bin directory)

The copy code for adding environment variables under path is as follows:% MYSQL_HOME%\ bin

Re-open the cmd terminal at will, use the command and the modified password, you can connect to mysql directly.

3. Add users to mysql database

Root user is a super user of mysql database, which has high privileges and is not safe to use. It is recommended to create a new user. Of course, it is OK not to create a new user.

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

# format description grant permissions on database. Table to username @ connected ip address identified by' password'; # instance, give the test user with password 1234 all permissions grant all on *. * to test@'%' identified by'1234' for all tables in all databases

At this point, the mysql installation is complete, and you can connect to the database using navicat

Summary

The above is a detailed description of the download, installation and configuration of mysql-5.7.28 under Windows introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report