MySQL 8.0.17 installation and configuration graphic tutorial

MySQL 8.0.17 installation and configuration graphic tutorial

This article records the graphic tutorial of MySQL 8.0.17 installation and configuration for your reference. The specific contents are as follows

1. Download the installation package

Download address: installation package

2. Unzip the installation package to the directory

Here it is unzipped to D:\mysql-8.0.17-winx64
(Some files in the figure are generated by subsequent installation steps)

3. Configure environment variables

My Computer → Right click → Properties → Advanced System Settings → Environment Variables

Click "Edit" and add the address of the MySQL bin folder

4. Configuration File

Create a new my.ini file in the MySQL folder D:\mysql-8.0.17-winx64 and write the following information:
(Note that the path should be changed for different installation addresses)

[mysqld]
# Set port 3306 port=3306
# Set the installation directory of mysql basedir=D:\\mysql-8.0.17-winx64 # Remember to use double slashes \\ here. I will make mistakes with single slashes, but when I look at other people's tutorials, some use single slashes. Try it yourself # Set the storage directory of mysql database data datadir=D:\\mysql-8.0.17-winx64\\Data # Same as above # Allow the maximum number of connections max_connections=200
# The number of connection failures allowed. This is to prevent someone from trying to attack the database system from this host max_connect_errors = 10
# The default character set used by the server is UTF8
character-set-server=utf8
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
# By default, the "mysql_native_password" plug-in is used for authentication. default_authentication_plugin=mysql_native_password
[mysql]
# Set the default character set of the mysql client to default-character-set=utf8
[client]
# Set the default port used by the mysql client to connect to the server port = 3306
default-character-set=utf8 

5. Install MySQL

Open cmd as an administrator, go to the MySQL installation path, and enter the following command to initialize the database:

mysqld --initialize --console

Notice! The execution output contains the following paragraph:

[Note] [MY-010454] [Server] A temporary password is generated for root@localhost: zyNrYHh2yF-E

The "zyNrYHh2yF-E" after root@localhost: is the initial password (excluding the first space). Before changing the password, you need to remember this password as it will be needed for subsequent logins.

If you shut down too quickly or forget to remember it, it's okay. 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: data-directory-initialization-mysqld

6. Installation service

Enter in the MySQL installation directory D:\mysql-8.0.17-winx64\bin

mysqld --install

The original command should be: mysqld --install [service name]

However, 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.

7. Start MySQL service

Start MySQL:

net start mysql

(Stop the service with the command net stop mysql. Uninstall the MySQL service with the command sc delete MySQL/mysqld -remove)

8. Change your password

Enter in the MySQL installation directory D:\mysql-8.0.17-winx64\bin:

mysql -u root -p

Enter the previous password to enter MySQL.

Execute the command in MySQL:

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

Change the password. Pay attention to the ";" at the end of the command. This is the syntax of MySQL.

Installation Complete

You can view the default installed database

show databases;

Take a look at the default MySQL users:

select user,host,authentication_string from mysql.user;

The host of the administrator root is localhost, which means that only localhost login access is allowed. If you want to allow other IP addresses to log in, you need to add a new host. If you want to allow all IP access, you can directly change it to "%"

For other operations, refer to: MySQL user creation and authorization

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.19 winx64 installation tutorial and change the initial password under Windows 10
  • MySQL 8.0.19 installation and configuration method graphic tutorial
  • mysql 8.0.19 winx64.zip installation tutorial
  • mysql 8.0.19 win10 quick installation tutorial
  • MySQL 8.0.18 installation and configuration method graphic tutorial
  • mysql 8.0.18.zip installation and configuration method graphic tutorial (windows 64 bit)
  • MySQL 8.0.18 installation and configuration method graphic tutorial under win10 (windows version)
  • MySQL 8.0.17 installation and configuration method graphic tutorial
  • MySQL 8.0.17 installation and usage tutorial diagram
  • MySQL 8.0.19 installation and configuration tutorial under Windows 10

<<:  Detailed explanation of SELINUX working principle

>>:  Common problems in implementing the progress bar function of vue Nprogress

Recommend

Implementation of vue-nuxt login authentication

Table of contents introduce Link start Continue t...

Docker starts Redis and sets the password

Redis uses the apline (Alps) image of Redis versi...

Install and configure MySQL 5.7 under CentOS 7

This article tests the environment: CentOS 7 64-b...

JS realizes automatic playback of timeline

Recently, I have implemented such an effect: clic...

DHTML objects (common properties of various HTML objects)

!DOCTYPE Specifies the Document Type Definition (...

Complete steps to set up automatic updates in CentOS 8

The best thing you can do for your data and compu...

Vue SPA first screen optimization solution

Table of contents Preface optimization SSR Import...

js to achieve a simple magnifying glass effect

This article shares the specific code of js to ac...

Solve the problem that ElementUI custom CSS style does not take effect

For example, there is an input box <el-input r...

What kinds of MYSQL connection queries do you know?

Preface If the query information comes from multi...

Detailed explanation of mysql transaction management operations

This article describes the MySQL transaction mana...

Use of nginx custom variables and built-in predefined variables

Overview Nginx can use variables to simplify conf...

Configure VIM as a C++ development editor in Ubuntu

1. Copy the configuration file to the user enviro...

How to add Nginx to system services in CentOS7

Introduction After compiling, installing and solv...