MySQL 8.0.12 Installation and Configuration Tutorial

MySQL 8.0.12 Installation and Configuration Tutorial

This article records the detailed tutorial for installing and configuring MySQL 8.0.12. The specific contents are as follows

1. Download

Link: Download page

After selecting the system platform, click download (select 64 or 32 bits according to the system)

2. Configuration

1. After the download is successful, unzip the installation package to the location where you want to install it. I installed it in "D:\MySql\"

If the installation directory contains a data folder, delete it.

2. Add the bin directory to the environment variable PATH

3. Installation

1. Run cmd as an administrator

2. Enter the bin folder under the installation directory

3. Execute mysqld --initialize or mysqld --initialize-insecure --user=mysql

If the execution is successful, a data folder will be generated in the installation directory. Open the folder to find the .err file and open it with a text editor.

Search for "root", and the colon is followed by a randomly generated temporary password

4. Continue and enter mysqld --install

5. Check the installation and enter mysql --version

6. Start the MySQL service and enter net start mysql. PS: To stop the service, enter net stop mysql.

4. Client Testing

1.mysql –uroot –p as shown below

5. Change username and password

1. Create a new mysql-init.txt in the installation directory, enter ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';, save

PS: For versions 5.7.5 and earlier, enter SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

2. Close the MySQL service, then enter the bin directory in cmd, enter mysqld --init-file=D:\MySql\mysql-8.0.12-winx64\mysql-init.txt, after the execution is complete, delete the mysql-init.txt file and restart the MySQL service

3. Enter mysql -u root -p, then enter the password to log in (if you cannot log in, enter the random password in .err to enter mysql and proceed to step 4)

4. After entering the mysql shell, retype the command in mysql-init.txt

Enter exit and log in again with the new password

5. Verify that MySQL is working properly

Type show databases;

Enter use mysql;

Input SELECT User,Host,authentication_string FROM user;

6. Configure encoding to UTF-8

1. View the default encoding

show variables like '%character%';

2. In the root directory of D:\MySql\mysql-8.0.12-winx64, create a new my.ini file (this file does not exist after 5.7, create it yourself), as shown below:

3. Edit my.ini

Under the [mysqld] node, configure the server encoding and add two items

character_set_server=utf8

[mysql] node, this is to configure the client information

We also add the [mysql] node and configure the encoding to UTF8

[mysql]

default-character-set=utf8


[mysqld]
default-character-set = utf8
character_set_server = utf8
[mysql]
default-character-set = utf8
[mysql.server]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
default-character-set = utf

As shown below:

7. Test query

1. After modifying the configuration file, you must restart the service first

2. Log in as root user normally

3. Run the command show variables like "%character%" to view the system character set variables, as shown below:

Client connection:

Navicat For MySQL

Error message: 1251- Client does not support authentication protocol requested by server; consider upgrading MYSQL

Solution:

1. Enter the unzipped MySQL root directory through the command line.

2. Log in to the database

mysql -uroot -p

3. Enter the root password again:

4. Change the encryption method:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

5. Change password: In this example, 123456 is the new password

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

6. Refresh:

FLUSH PRIVILEGES;

Finally the connection was successful:

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 5.7.23 installation and configuration graphic tutorial
  • mysql 5.7.23 winx64 decompression version installation tutorial
  • MySQL 5.7.23 installation and configuration method graphic tutorial
  • MySQL 5.7.18 winx64 installation and configuration method graphic tutorial
  • MySQL 5.7.18 free installation version configuration tutorial
  • MySQL 5.7 and above version installation and configuration method graphic tutorial (mysql 5.7.12\mysql 5.7.13\mysql 5.7.14)
  • MySQL 5.7.14 installation and configuration method graphic tutorial
  • MySQL Server 8.0.3 Installation and Configuration Methods Graphic Tutorial
  • MySQL 8.0.12 installation and configuration method graphic tutorial (Windows version)
  • MySQL 5.7.23 winx64 installation and configuration method graphic tutorial under win10

<<:  Linux Domain Name Service DNS Configuration Method

>>:  Detailed explanation of SSH password-free login configuration under Linux

Recommend

In-depth exploration of whether Mysql fuzzy query is case-sensitive

Preface Recently, I have been busy writing a smal...

Summary of Linux file directory management commands

touch Command It has two functions: one is to upd...

Example code of CSS layout at both ends (using parent's negative margin)

Recently, during the development process, I encou...

How to compile and install PHP and Nginx in Ubuntu environment

This article describes how to compile and install...

Pure HTML and CSS to achieve JD carousel effect

The JD carousel was implemented using pure HTML a...

How familiar are you with pure HTML tags?

The following HTML tags basically include all exis...

What is COLLATE in MYSQL?

Preface Execute the show create table <tablena...

Detailed process of drawing three-dimensional arrow lines using three.js

Demand: This demand is an urgent need! In a subwa...

Detailed tutorial on installing harbor private warehouse using docker compose

Overview What is harbor? The English word means: ...

HTML Basics_General Tags, Common Tags and Tables

Part 1 HTML <html> -- start tag <head>...

Tutorial analysis of quick installation of mysql5.7 based on centos7

one. wget https://dev.mysql.com/get/mysql57-commu...

In-depth understanding of Vue transition and animation

1. When inserting, updating, or removing DOM elem...

Detailed explanation of React setState data update mechanism

Table of contents Why use setState Usage of setSt...

Several ways to submit HTML forms_PowerNode Java Academy

Method 1: Submit via the submit button <!DOCTY...

Eight implementation solutions for cross-domain js front-end

Table of contents 1. jsonp cross-domain 2. docume...