Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What should you pay attention to when migrating mysql to 8.0?

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you what you should pay attention to when mysql migrates to 8.0, the content is simple and easy to understand, I hope you can learn, there will be gains after learning, let's take a look at it.

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, and the new mode requires a new driver, at least not given by pdo / navicat yet, so we still have to switch to the old mysql_native_password mode.

`mysql_native_ password`: below 7.0` caching_sha2_ password`: above 8.0

1. My.cnf configure 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 merge and create accounts, only grant all privileges on *. * to 'root'@'%' with grant option;flush privileges can be authorized.

Password complexity policy

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

Caused by password complexity verification policy, you can set it when it is turned off.

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

Default coding

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_passwordcharacter_set_server=utf8mb4collation_server=utf8mb4_general_ci

Remote access

1. My.conf comments out local monitoring

[mysqld] # bind_address=127.0.0.1

2. Update the host of the account

Update mysql.user set host='%' where user='root'; above is about what mysql should pay attention to when migrating to 8.0. if you have learned knowledge or skills, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report