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

Ideas and methods for incremental backup of MySQL database

To perform incremental backup of the MySQL databa...

How to check where the metadata lock is blocked in MySQL

How to check where the metadata lock is blocked i...

Docker installs redis 5.0.7 and mounts external configuration and data issues

Redis is an open source NoSQL database written in...

Setting up a proxy server using nginx

Nginx can use its reverse proxy function to imple...

Example code for implementing page floating box based on JS

When the scroll bar is pulled down, the floating ...

Vue realizes the whole process of slider drag verification function

Rendering Define the skeleton, write HTML and CSS...

Detailed introduction and usage examples of map tag parameters

Map tags must appear in pairs, i.e. <map> .....

Basic security settings steps for centos7 server

Turn off ping scanning, although it doesn't h...

How to embed flash video format (flv, swf) files in html files

Flash file formats: .FLV and .SWF There are two ex...

JavaScript implements password box input verification

Sometimes it is necessary to perform simple verif...

Front-end JavaScript housekeeper package.json

Table of contents 1. Required attributes 1. name ...