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

A complete guide to CSS style attributes css() and width() in jQuery

Table of contents 1. Basic use of css(): 1.1 Get ...

How to build a DHCP server in Linux

Table of contents 1. Basic knowledge: 2. DHCP ser...

HTML Tutorial: Unordered List

<br />Original text: http://andymao.com/andy...

Best Practices Guide for MySQL Partitioned Tables

Preface: Partitioning is a table design pattern. ...

How to use JS to check if an element is within the viewport

Preface Share two methods to monitor whether an e...

CSS to achieve single-select folding menu function

Don’t introduce a front-end UI framework unless i...

Nest.js authorization verification method example

Table of contents 0x0 Introduction 0x1 RBAC Imple...

Detailed explanation of the execution plan explain command example in MySQL

Preface The explain command is the primary way to...

How to deploy gitlab using Docker-compose

Docker-compose deploys gitlab 1. Install Docker I...

Detailed steps to install VMware Tools from scratch (graphic tutorial)

VMware Tools is a tool that comes with VMware vir...

MySQL conditional query and or usage and priority example analysis

This article uses examples to illustrate the usag...

Implementation of importing and exporting docker images

Docker usage of gitlab gitlab docker Startup Comm...

Web Design Experience: Efficiently Writing Web Code

Originally, this seventh chapter should be a deep ...