Things to note when migrating MySQL to 8.0 (summary)

Things to note when migrating MySQL to 8.0 (summary)

Password Mode

PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]

After mysql8, the default password mode is changed to caching_sha2_password. The new mode requires a new driver. At least pdo/navicat has not been given yet, so we still have to switch to the old mysql_native_password mode.

`mysql_native_password`: 7.0 or below `caching_sha2_password`: 8.0 or above

1. my.cnf configures the default password mode

[mysqld]
default_authentication_plugin=mysql_native_password

2. Update the password mode of the account

# Create a new account create user 'root'@'%' identified with mysql_native_password by '123456';

# Existing account alter user 'root'@'%' identified with mysql_native_password by '123456';

3. If you need authorization

# Authorization cannot be combined with account creation. You can only grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;

Password complexity policy

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

This is caused by the password complexity verification policy. You can set it after turning it off.

set global validate_password.policy=0;
set global validate_password.length=6;

Default encoding

PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers

Set the default encoding for the mysql service

# Default Homebrew MySQL server config
[client]
default_character_set=utf8mb4

[mysql]
default_character_set=utf8mb4

[mysqld]
default_authentication_plugin=mysql_native_password
character_set_server=utf8mb4
collation_server=utf8mb4_general_ci

Remote Access

1. Comment out local monitoring in my.conf

[mysqld]
#bind_address=127.0.0.1

2. Update the host of the account

update mysql.user set host='%' where user='root';

This is the end of this article about the precautions (summary) when migrating MySQL to 8.0. For more relevant content about migrating MySQL to 8.0, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • A brief discussion on the pitfalls and solutions of the new features of MySQL 8.0 (summary)
  • How to install and connect Navicat in MySQL 8.0.20 and what to pay attention to
  • How to solve various errors when using JDBC to connect to Mysql 8.0.11
  • Detailed explanation of the pitfalls of MySQL 8.0
  • Notes on matching MySql 8.0 and corresponding driver packages

<<:  Alibaba Cloud domain name and IP binding steps and methods

>>:  Vue+echarts realizes stacked bar chart

Recommend

Tutorial on installing mysql5.7.18 on windows10

This tutorial shares the installation and configu...

Implementation principle and configuration of MySql master-slave replication

Database read-write separation is an essential an...

Javascript implements simple navigation bar

This article shares the specific code of Javascri...

Have you really learned MySQL connection query?

1. Inner Join Query Overview Inner join is a very...

Solution to the failure of 6ull to load the Linux driver module

Table of contents 0x01 Failed to load the driver ...

JavaScript dynamically generates a table with row deletion function

This article example shares the specific code of ...

How to deploy Tencent Cloud Server from scratch

Since this is my first post, if there are any mis...

Solution to inconsistent display of cursor size in input box

The cursor size in the input box is inconsistent T...

Windows 10 + mysql 8.0.11 zip installation tutorial detailed

Prepare: MySQL 8.0 Windows zip package download a...

The difference between html empty link href="#" and href="javascript:void(0)"

# contains a location information. The default anc...

Detailed explanation of Linux text processing command sort

sort Sort the contents of a text file Usage: sort...

Detailed explanation of how to gracefully delete a large table in MySQL

Preface To delete a table, the command that comes...

Windows 10 installation vmware14 tutorial diagram

Software Download Download software link: https:/...

Summary of commonly used CSS encapsulation methods

1. pc-reset PC style initialization /* normalize....

How to display and format json data on html page

JSON data is displayed and formatted on the HTML ...