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

Use overflow: hidden to disable page scrollbars

Copy code The code is as follows: html { overflow...

What to do if the online MySQL auto-increment ID is exhausted

Table of contents Table definition auto-increment...

MySQL 5.7 installation and configuration method graphic tutorial

This tutorial shares the installation and configu...

Basic operation tutorial of files and permissions in centos

Preface Before we begin, we should briefly unders...

How to enable remote access permissions in MYSQL

1. Log in to MySQL database mysql -u root -p View...

Special commands in MySql database query

First: Installation of MySQL Download the MySQL s...

Native JavaScript to achieve the effect of carousel

This article shares the specific code for JavaScr...

MySQL 8.0.19 Installation Tutorial

Download the installation package from the offici...

Four modes of Oracle opening and closing

>1 Start the database In the cmd command windo...

Solution to EF (Entity Framework) inserting or updating data errors

Error message: Store update, insert, or delete st...

CSS isolation issue in Blazor

1. Environment VS 2019 16.9.0 Preview 1.0 .NET SD...

How to elegantly back up MySQL account information

Preface: I recently encountered the problem of in...

JavaScript Advanced Custom Exception

Table of contents 1. Concept 1.1 What are errors ...

61 Things Every Web Developer Should Know

Normally, you'll need to read everyone's s...