MySQL 8.0.15 download and installation detailed tutorial is a must for novices!

MySQL 8.0.15 download and installation detailed tutorial is a must for novices!

This article records the specific steps for downloading and installing MySQL 8.0.15 for your reference. The specific contents are as follows

Background: A tutorial written as a product that loves technology but doesn’t understand code

1. Environment

System: Windows 64 bit
MySQL version: MySQL 8.0.15

2. Download

First, download the database installation file, go to the MySQL official website download channel https://www.mysql.com/downloads/, and click Community→MySQL Community Server, as shown below:

After entering the download page, select the operating system. Here we choose the default Microsoft Windows system. Find the version that suits your system below. I choose 64-bit download here. Click Download to start downloading, as shown below:

What is downloaded here is a ZIP compressed package. After downloading it locally, you can directly decompress it to the corresponding directory.

3. Installation

ps: After unzipping the downloaded ZIP compressed package to the corresponding directory, open the installation directory. There should be no data folder and my.ini file in the directory.

3.1 Configure environment variables

Before installation, you need to configure the environment variables. Right-click "My Computer → Properties → Advanced System Settings → Advanced → Environment Variables → System Variables", find the path variable and double-click it, or click Edit, the Edit System Variable pop-up window will pop up, add the installation path of MySQL to the variable value, and the path should be accurate to the bin directory under the installation directory.
ps: Note that this is to add after the original value, rather than overwriting the original value, otherwise unexpected results may occur.

3.2 Add configuration file

Create a new document in the unzipped mysql directory, open it, and copy and paste the following code:

[mysqld]
# Set port 3306 port=3306
# Set the installation directory of mysql basedir=D:\\Program Files\\mysql-8.0.15-winx64
# Set the storage directory for mysql database data# datadir=
# Maximum number of connections allowed max_connections=200
# The number of connection failures allowed.
max_connect_errors=10
# The default character set used by the server is UTF8
character-set-server=UTF8MB4
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
#Default authentication is done with the "mysql_native_password" plugin #mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# Set the default character set of the mysql client to default-character-set=UTF8MB4
[client]
# Set the default port used by the mysql client to connect to the server port = 3306
default-character-set=UTF8MB4

Modify the value of basedir and set it to the installation directory of mysql. The above is my installation directory. Everyone should set it according to their actual directory.
ps: Note that my file directory is connected with double slashes \, and there are also single slashes on the Internet

After the settings are completed, click Save and save the file name as my.ini. The file configuration is complete!

3.3 Initialize the database

Run cmd as an administrator. This is a good idea. cmd is in a directory on the C drive by default. First, you need to return to the root directory of the C drive, and then enter the bin directory of mysql. The operation is as follows:

insert image description here

The DOS commands needed are as follows:
cd\ Return to the root directory
d: Enter the D drive
cd\ enter the specified directory

After entering the mysql directory, enter mysqld --initialize --console to initialize the database. The correct response should be the following information. Note that the string after root@localhost needs to be written down as it will be used later.

OK, it seems to be going smoothly here, but it took me a lot of effort to install it. Now I would like to share with you some problems that occurred during the installation process:

1. During initialization, I entered mysql --initialize --console, and an error message appeared: unknown option --initialize. Did you see the problem? It was a very basic mistake. I wrote mysqld as mysql. I was very depressed. It was not mysql. When did they add a small d? But it is like this. Just remember it.

2. Post the question directly

I was confused. There was a warning and two errors. OK, let's check them one by one.

Warning: I read it with my half-baked English level and felt that the problem was with the encoding. It asked me to use UTF8MB4. I remembered that there was encoding in the configuration file, so I changed it. Please go up to 3.2 here and change all UTF8 places in the my.ini file to UTF8MB4, save and reinitialize.

Error: It seems that a file already exists. From the tone, it seems that it should not exist, so it is asked to be thrown away. The second error directly says to throw it away. Okay, I just searched on Baidu and found that the data directory was automatically generated in the MySQL installation directory (note that there is no such file in the original file downloaded and unzipped). At this time, just delete the data directory and re-run the initialization statement, and it's done!

3.4 Installation Service

Next, install the service using mysqld --install [service name]. The service name can be omitted. The default name is mysql. If multiple services are installed on the computer, you can use different names to distinguish them. The successful installation prompt is as shown below:

If the service has been installed, it will prompt "the service already exists!".

Start the service

Start the MySQL service using the command net start mysql.
Stop the service using the command net stop mysql.
Uninstall the MySQL service using the command sc delete MySQL/mysqld -remove

OK, finished!

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.7 installation tutorials for various versions

MySQL 5.6 installation tutorials for various versions

mysql8.0 installation tutorials for various 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.12 installation and environment variable configuration tutorial under win10
  • MySQL 5.6.23 Installation and Configuration Environment Variables Tutorial
  • How to configure environment variables after installing mysql5.7 database
  • The latest version of MySQL 8.0.22 download and installation super detailed tutorial (Windows 64 bit)
  • MySQL 8.0.22.0 download, installation and configuration method graphic tutorial
  • MySQL 8.0.22 download, installation and configuration method graphic tutorial
  • Detailed tutorial for downloading, installing and configuring MySQL 5.7.27
  • mysql8.0.20 download and installation and problems encountered (illustration and text)
  • MySQL 5.6.37 (zip) download installation configuration graphic tutorial
  • MySQL 5.7.18 Green Edition Download and Installation Tutorial
  • MySQL 8.0.13 download and installation tutorial with pictures and text
  • Summary of common problems in downloading and installing MySQL 5.7 on Win7 64-bit
  • Detailed graphic instructions for downloading and installing the unzipped version of MySQL 5.7.18 and starting the MySQL service
  • MySQL 5.7 Service Download and Installation Graphical Tutorial (Classic Edition)
  • MySQL 5.7.14 download, installation, configuration and use detailed tutorial
  • MySQL msi version download and installation detailed graphic tutorial for beginners

<<:  Vue.js implements music player

>>:  There is no problem with the Linux file path when deploying the window and Linux projects

Recommend

SQL Practice Exercise: Online Mall Database Product Category Data Operation

Online shopping mall database-product category da...

Things to note when writing self-closing XHTML tags

The img tag in XHTML should be written like this:...

Detailed explanation of formatting numbers in MySQL

Recently, due to work needs, I need to format num...

Detailed explanation of Linx awk introductory tutorial

Awk is an application for processing text files, ...

Best Practices for Implementing Simple Jira Projects with React+TS

A set of projects for training react+ts Although ...

XHTML 2.0 New Features Preview

<br />Before browsers can handle the next ge...

Ubuntu 16.04 installation tutorial under VMware 12

This article shares with you the installation tut...

JavaScript ES new feature block scope

Table of contents 1. What is block scope? 2. Why ...

Docker Machine in-depth explanation

Differences between Docker and Docker Machine Doc...

Website construction experience summary

<br />What principles should be followed to ...

Overview of time configuration under Linux system

1. Time types are divided into: 1. Network time (...

Detailed explanation of how to efficiently import multiple .sql files into MySQL

MySQL has multiple ways to import multiple .sql f...

Build a server virtual machine in VMware Workstation Pro (graphic tutorial)

The VMware Workstation Pro version I use is: 1. F...

Centos7 installation of Nginx integrated Lua sample code

Preface The computer I use is a Mac, and the oper...

How to implement property hijacking with JavaScript defineProperty

Table of contents Preface Descriptors Detailed ex...