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

Example of implementing todo application with Vue

background First of all, I would like to state th...

JS uses map to integrate double arrays

Table of contents Preface Simulating data Merged ...

Docker deploys mysql to achieve remote connection sample code

1.docker search mysql查看mysql版本 2. docker pull mys...

MySQL 8.0.16 Win10 zip version installation and configuration graphic tutorial

This article shares with you the installation and...

MySQL query optimization: causes and solutions for slow queries

Friends who are doing development, especially tho...

Some indicators of excellent web front-end design

The accessibility of web pages seems to be somethi...

Design perspective technology is an important capital of design ability

A design soldier asked: "Can I just do pure ...

Automatically build and deploy using Docker+Jenkins

This article introduces Docker+Jenkins automatic ...

Detailed explanation of location and rewrite usage in nginx

1. Summary of location usage Location can locate ...

How to completely delete the MySQL 8.0 service under Linux

Before reading this article, it is best to have a...

Detailed explanation of nodejs built-in modules

Table of contents Overview 1. Path module 2. Unti...