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

Detailed explanation of fuser command usage in Linux

describe: fuser can show which program is current...

Mysql 5.7.18 Using MySQL proxies_priv to implement similar user group management

Use MySQL proxies_priv (simulated role) to implem...

Detailed explanation of where Docker saves log files

Table of contents Where are the logs stored? View...

How to change the encoding of MySQL database to utf8mb4

The utf8mb4 encoding is a superset of the utf8 en...

Installation method of MySQL 5.7.18 decompressed version under Win7x64

Related reading: Solve the problem that the servi...

Simple implementation method of Linux process monitoring and automatic restart

Purpose: Under Linux, the server program may be d...

SQL injection vulnerability process example and solution

Code example: public class JDBCDemo3 { public sta...

Solution to ERROR 1366 when entering Chinese in MySQL

The following error occurs when entering Chinese ...

Vue uses GraphVis to develop an infinitely expanded relationship graph

1. Go to the GraphVis official website to downloa...

Two ways to enable firewall in Linux service

There are two ways: 1. Service method Check the f...

SQL fuzzy query report: ORA-00909: invalid number of parameters solution

When using Oracle database for fuzzy query, The c...

Native JS to implement breathing carousel

Today I will share with you a breathing carousel ...

Understanding innerHTML

<br />Related articles: innerHTML HTML DOM i...