MySql 5.7.20 installation and configuration of data and my.ini files

MySql 5.7.20 installation and configuration of data and my.ini files

1. First download from the official website of MySql

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

https://www.jb51.net/softs/451120.html

Take the version I selected as an example (free installation version), select MYSQL Community Server and then select your corresponding version on the right. Mine is 64-bit. Download the corresponding zip version

After downloading, unzip it to the location you want to store it. I unzipped it to D:\mysql-5.7.20-winx64

After decompression, there is no data file and my.ini configuration file. These need to be added by yourself (additional information is provided below).

The next step is to set the environment variables. I use w10, open the system variables, configure the mysql environment variables, the following figure is to open the system variables through the command line

Create the MYSQL_HOME variable and set the value to the location where you unzipped the files.

Add %MYSQL_HOME%\bin; to Path (note the semicolon at the end)

Finally, save and complete the MySql environment variable configuration.

Next is to add data files and my.ini

Open cmd as an administrator in the D:\mysql-5.7.20-winx64\bin directory (there are several ways for administrators to open cmd, one of which is to use win+x and then select Command Prompt (Administrator). After opening, remember to go to the D:\mysql-5.7.20-winx64\bin directory in DOS) and then run mysqld --initialize-insecure --user=mysql (note there is a space)

Then return to the directory and you will find the data directory

Create a my.ini file with the following content (the content here does not have to be the same as below, you can search on Baidu by yourself, but the content is actually similar)

[client]
port=3306
default-character-set=utf8
[mysqld] 
# Set to your own MYSQL installation directory basedir=D:\mysql-5.7.20-winx64
# Set to MYSQL data directory datadir=D:\mysql-5.7.20-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
# Enable query cache explicit_defaults_for_timestamp=true
skip-grant-tables

After completing the creation of the above two files, run cmd as an administrator under D:\mysql-5.7.20-winx64\bin and enter the command mysqld -install. If Service successfully installed appears, it means that the registration is successful.

Because I have already registered, the above picture will appear when I run the command again

Next, run the net start mysql command (start MYSQL command) and the following figure will appear

net stop mysql command (stop MYSQL command)

At this point, you have completed the download and configuration of MySql

Summarize

The above is the installation of MySql 5.7.20 and the configuration of data and my.ini files 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!

You may also be interested in:
  • Modify the maximum number of mysql connections and configuration files in docker
  • Tutorial on integrating MySQL with springboot's yml configuration file through db2
  • IDEA uses properties configuration file to connect to MySQL database
  • How to find the my.ini configuration file in MySQL 5.6 under Windows
  • How to modify the mysql configuration file under docker
  • How to configure the My.ini file when installing MySQL5.6.17 database
  • Mysql file configuration analysis

<<:  Build a Scala environment under Linux and write a simple Scala program

>>:  Detailed explanation of performance optimization ideas for React functional components

Recommend

MySql 8.0.16-win64 Installation Tutorial

1. Unzip the downloaded file as shown below . 2. ...

Detailed explanation of Docker daemon security configuration items

Table of contents 1. Test environment 1.1 Install...

Teach you how to use Portainer to manage multiple Docker container environments

Table of contents Portainer manages multiple Dock...

Analysis of Apache's common virtual host configuration methods

1. Apache server installation and configuration y...

Use Vue3 for data binding and display list data

Table of contents 1. Comparison with Vue2 1. New ...

Multiple solutions for cross-domain reasons in web development

Table of contents Cross-domain reasons JSONP Ngin...

js data types and their judgment method examples

js data types Basic data types: number, string, b...

Example of ellipsis when CSS multi-line text overflows

Ellipses appear when multi-line text overflows Th...

Summary of JS tips for creating or filling arrays of arbitrary length

Table of contents Preface Direct filling method f...

Various problems encountered in sending emails on Alibaba Cloud Centos6.X

Preface: I have newly installed an Alibaba cloud ...

Raspberry Pi msmtp and mutt installation and configuration tutorial

1. Install mutt sudo apt-get install mutt 2. Inst...

How to avoid garbled characters when importing external files (js/vbs/css)

In the page, external files such as js, css, etc. ...