Detailed installation process of MySQL 8.0 Windows zip package version

Detailed installation process of MySQL 8.0 Windows zip package version

The installation process of MySQL 8.0 Windows zip is introduced as follows

Prepare:

Download address of MySQL 8.0 Windows zip package.

Environment: Windows 10

1. Installation

1. Unzip the zip package to the installation directory

For example, my installation directory is: D:\Program\MySQL

2. Configuration File

In Windows systems, the default configuration file is the my.ini file in the installation directory. Some configurations need to be configured during the initial installation, and most can be changed after the installation is complete. Of course, in extreme cases, everything can be changed.

Add my.ini to the installation root directory, for example, mine is: D:\Program\MySQL\my.ini, write the basic configuration:

[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 = D:\Program\MySQL
datadir = D:\DBs\MySQL
port = 3306
# server_id = .....


# 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 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

character-set-server = utf8mb4

performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256

[mysql]
default-character-set = utf8mb4

[client]
default-character-set = utf8mb4

Note that basedir is my local installation directory, and datadir is where my database data files are stored. Each configuration needs to be configured according to your own environment.

To view all configuration items, refer to: MySQL 8.0 Reference Manual

3. Initialize the database

Execute the command in the bin directory of the MySQL installation directory:

mysqld --initialize --console

After the execution is complete, the initial default password of the root user will be printed, for example:

2018-04-20T02:35:01.507037Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-04-20T02:35:01.507640Z 0 [System] [MY-013169] [Server] D:\Program\MySQL8\bin\mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 11064
2018-04-20T02:35:01.508173Z 0 [ERROR] [MY-010340] [Server] Error message file 'D:\Program\MySQL\share\english\errmsg.sys' had only 1090 error messages, but it should contain at least 4512 error messages. Check that the above file is the right version for this program!
2018-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: APWCY5ws&hjQ
2018-04-20T02:35:07.017280Z 0 [System] [MY-013170] [Server] D:\Program\MySQL8\bin\mysqld.exe (mysqld 8.0.11) initializing of server has completed

Among them, "APWCY5ws&hjQ" in the fourth line is the initial password. Before changing the password, you need to remember this password as it will be needed for subsequent logins.

If you accidentally close the directory too quickly or forget to remember, it's OK. Just delete the initialized datadir directory and execute the initialization command again, and it will be regenerated. Of course, you can also use security tools to force a password change, using any method you like.

Reference: Link address

4. Installation service

Execute the command in the bin directory of the MySQL installation directory:

mysqld --install [service name]
The service name behind it can be omitted, the default name is mysql. Of course, if you need to install multiple MySQL services on your computer, you can distinguish them with different names, such as mysql5 and mysql8.

After the installation is complete, you can start the MySQL service through the command net start mysql .

Reference: Link address

2. Change password and password authentication plug-in

Execute the command in the bin directory of the MySQL installation directory:

mysql -uroot -p

At this time, you will be prompted to enter a password. Remember the password in step 3 and fill it in to log in successfully and enter the MySQL command mode.

Before MySQL 8.0.4, execute

SET PASSWORD=PASSWORD('[modified password]');

You can change the password, but starting with MySQL 8.0.4, this is not possible by default. Because before, the password authentication plugin for MySQL was "mysql_native_password", and now it uses "caching_sha2_password".

Because many database tools and link packages currently do not support "caching_sha2_password", for convenience, I temporarily changed back to the "mysql_native_password" authentication plug-in.

Execute the command in MySQL:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Modify the password verification plug-in and modify the password at the same time.

If you want to use the "mysql_native_password" plug-in authentication by default, you can configure the default_authentication_plugin item in the configuration file.

[mysqld]
default_authentication_plugin=mysql_native_password

Reference: Link address

3. Speed ​​Test

No need to test, the official says MySQL 8 is twice as fast as 5.

Appendix: CentOS tar.gz package installation

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz
shell> tar zxvf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/local
shell> ln -s mysql-8.0.11-linux-glibc2.12-x86_64 mysql
shell> cd mysql
shell> mkdir mysql-files
shell> chown mysql:mysql mysql-files
shell> chmod 750 mysql-files
shell> bin/mysqld --initialize --user=mysql
shell> bin/mysql_ssl_rsa_setup
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

Reference: Link address

Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for MySQL 5.7 versions Installation tutorials for MySQL 5.6 versions

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 8.0.16 installation and configuration tutorial under Windows 10
  • MySQL 8.0.16 installation and configuration method graphic tutorial under Windows
  • Solve the problems encountered when installing mysql-8.0.11-winx64 in Windows environment
  • MySQL 8.0.12 installation and configuration method graphic tutorial (Windows version)
  • MySQL 8.0.12 installation and configuration method graphic tutorial (windows10)
  • MySQL 8.0.11 Installation Tutorial under Windows
  • Steps for installing MySQL 8.0.16 on Windows and solutions to errors

<<:  The whole process of developing a Google plug-in with vue+element

>>:  How to configure ssh to log in to Linux using git bash

Recommend

Let's talk about the performance of MySQL's COUNT(*)

Preface Basically, programmers in the workplace u...

MySQL database implements OLTP benchmark test based on sysbench

Sysbench is an excellent benchmark tool that can ...

Tips for writing concise React components

Table of contents Avoid using the spread operator...

CSS implements a pop-up window effect with a mask layer that can be closed

Pop-up windows are often used in actual developme...

Solution to mysql error when modifying sql_mode

Table of contents A murder caused by ERR 1067 The...

Implementation steps for docker deployment lnmp-wordpress

Table of contents 1. Experimental Environment 2. ...

How to install OpenSuse on virtualbox

The virtual machine is installed on the host mach...

Vue implements a simple shopping cart example

This article example shares the specific code of ...

Understanding what Node.js is is so easy

Table of contents Official introduction to Node.j...

Parsing Apache Avro Data in One Article

Abstract: This article will demonstrate how to se...

HTML+CSS+jQuery imitates the search hot list tab effect with screenshots

Copy code The code is as follows: <!DOCTYPE ht...