MySql 5.7. 17 Installation free configuration tutorial

  • 2021-07-26 09:00:53
  • OfStack

1. Download the mysql-5. 7.17-winx64.zip installation package (link: https://dev.mysql.com/downloads/mysql/)

2. Unzip the installation package.

D:\ DevelopTool\ mysql-5. 7.17-winx64 # Extract Directory

3. Create a folder named data under the unzipped directory to store data

D:\DevelopTool\mysql-5.7.17-winx64\data

4. Configure the startup file

Rename D:\ DevelopTool\ mysql-5. 7.17-winx64\ my-default.ini file copy1 to my.ini, and modify the parameters as follows:


# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
#########################
# basedir  Extracted Directory for Installation Files   |  basedir And datadir  You can use relative paths 
# basedir=./..
basedir=D:\\DevelopTool\\mysql-5.7.11-winx64
# datadir  Is the directory used to store data 
# datadir=./../data
datadir=D:\\DevelopTool\\mysql-5.7.11-winx64\\data
# port  Is the port number 
port=3306
# mar_connections Is the maximum number of connections 
max_connections=20
character_set_server=utf8
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 
explicit_defaults_for_timestamp=true
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

5. Initialize the data directory


mysqld --defaults-file="D:\DevelopTool\mysql-5.7.17-winx64\my.ini" --initialize-insecure

It will initialize the data directory. Please delete all files in the data directory before executing this command, otherwise it will fail

You can select--initialize-insecure or--initialize to initialize,--initialize-insecure to initialize root password is empty, if--initialize is used to initialize, a random password will be generated

After successful execution, mysql, perofrmance_schema, sys and other directory files will be generated under the data directory

6. Install and start mysql service


# Install services 
mysqld -install
# Startup service 
net start mysql
# Enter mysql
mysql -u root -p
# Remove mysql
mysqld -remove

About the mysql topic provided by this site, you can refer to the following:

Mysql Installation Tutorial in Various Systems

Operation Skills of Mysql Root Cryptography

MySql Database Getting Started

Summary of Database Operation Knowledge in MySQL


Related articles: