Detailed tutorial on installation and configuration of compressed version of MySQL database

Detailed tutorial on installation and configuration of compressed version of MySQL database

1. Download MySQL

Download address:

https://dev.mysql.com/downloads/mysql/
https://dev.mysql.com/downloads/mysql/5.7.html#downloads (MySQL Community Server 5.7.34)

insert image description here

2. Unzip the compressed package

After the download is complete, decompress the compressed package directly.

insert image description here

3. Initialize mysql

Create a new data file and a new my.ini configuration file

Create an empty folder called data under the unzipped mysql directory, and then create a new configuration file called my.ini under D:\Program Files\mysql-8.0.25-winx64. Write the following code in the file:

[mysqld]
#Set the character set used by the server to utf-8
character-set-server=UTF8MB4
#Bind IPv4 address bind-address=0.0.0.0
#Set the mysql port number port = 3306
#Set the installation directory of mysql basedir=F:/mysql-5.7.23
#Set the storage directory of mysql database data datadir=C:/mysql-5.7.23/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 of 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

The # sign and the Chinese characters behind it must be deleted. The final effect is as shown below: 

insert image description here

One thing to note here is that if the data file is not empty, an error will be reported: The designated data directory D:\Program Files\mysql-8.0.25-winx64\data\ is unusable. You can remove all files that the server added to it.

Solution: Delete the files in the data folder.

insert image description here

Run cmd as an administrator and enter the bin directory of mysql

insert image description here
insert image description here

4. Install MySQL service

Execute the command: mysqld --install

If you need to uninstall, use the command mysqld --remove

insert image description here

Execute the command: mysqld --initialize --user=root --console

insert image description here

Here I encountered an error:

insert image description here

The reason is that the encoding format in my my.ini file is incorrect. Just modify it according to the error prompts.

insert image description here

Start the mysql service. Use the command: net start mysql

insert image description here

Log in to mysql and execute the command: mysql -uroot -p: The random password just initialized encountered an error:

insert image description here

Change password command: set password = password('new password') Stop service

Use the command: net stop mysql

insert image description here

This is the end of this article about the detailed tutorial on MySQL database installation and configuration. For more relevant MySQL installation and configuration content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Python regularly backs up MySQL data by date and compresses it
  • MySQL database backup command sharing (MySQL compressed database backup)
  • MySQL data compression performance comparison details

<<:  Use Docker to create a distributed lnmp image

>>:  A detailed introduction to for/of, for/in in JavaScript

Recommend

How to achieve seamless token refresh

Table of contents 1. Demand Method 1 Method 2 Met...

Html page supports dark mode implementation

Since 2019, both Android and IOS platforms have s...

Dissecting the advantages of class over id when annotating HTML elements

There are very complex HTML structures in web pag...

MySQL database operations and data types

Table of contents 1. Database Operation 1.1 Displ...

Use js to write a simple snake game

This article shares the specific code of a simple...

5 basic skills of topic page design (Alibaba UED Shanmu)

This topic is an internal sharing in the second h...

Detailed explanation of the difference between var, let and const in JavaScript

Table of contents As a global variable Variable H...

Some parameter descriptions of text input boxes in web design

In general guestbooks, forums and other places, t...

Packetdrill's concise user guide

1. Packetdrill compilation and installation Sourc...

Vue implements QR code scanning function (with style)

need: Use vue to realize QR code scanning; Plugin...

WML tag summary

Structure related tags ---------------------------...

How to access MySql through IP address

1. Log in to mysql: mysql -u root -h 127.0.0.1 -p...

Why is the MySQL auto-increment primary key not continuous?

Table of contents 1. Introduction 2. Self-increme...