如何配置MySQL 8.4 LTS兼容性参数及新特性启动开关以实现最佳兼容性?

2026-04-29 01:280阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计842个文字,预计阅读时间需要4分钟。

如何配置MySQL 8.4 LTS兼容性参数及新特性启动开关以实现最佳兼容性?

MySQL 8.4 默认禁用了 `mysql_native_password` 插件,旧客户端(如某些 PHP PDO、Navicat 旧版、Python MySQLdb)直接连接会报错 `Plugin caching_sha2_password could not be loaded` 或连接被拒绝。

这不是密码错误,是服务端根本没加载该插件。必须在启动前配置,运行中无法补救:

  • my.cnf[mysqld] 段落添加:default_authentication_plugin=mysql_native_password
  • 同时需启用插件本身:mysql_native_password=ON(注意不是 mysql_native_password_plugin=ON
  • 若用命令行启动,加参数:--default-authentication-plugin=mysql_native_password --mysql-native-password=ON
  • 配置后务必重启 mysqld,仅 reload 不生效

innodb_change_buffering=none 影响写密集型业务性能

MySQL 8.4 将 innodb_change_buffering 默认值从 all 改为 none,意味着插入、删除标记等变更不再缓存在 buffer pool 中,而是直接刷盘或走更重的路径。

阅读全文
标签:Mysql

本文共计842个文字,预计阅读时间需要4分钟。

如何配置MySQL 8.4 LTS兼容性参数及新特性启动开关以实现最佳兼容性?

MySQL 8.4 默认禁用了 `mysql_native_password` 插件,旧客户端(如某些 PHP PDO、Navicat 旧版、Python MySQLdb)直接连接会报错 `Plugin caching_sha2_password could not be loaded` 或连接被拒绝。

这不是密码错误,是服务端根本没加载该插件。必须在启动前配置,运行中无法补救:

  • my.cnf[mysqld] 段落添加:default_authentication_plugin=mysql_native_password
  • 同时需启用插件本身:mysql_native_password=ON(注意不是 mysql_native_password_plugin=ON
  • 若用命令行启动,加参数:--default-authentication-plugin=mysql_native_password --mysql-native-password=ON
  • 配置后务必重启 mysqld,仅 reload 不生效

innodb_change_buffering=none 影响写密集型业务性能

MySQL 8.4 将 innodb_change_buffering 默认值从 all 改为 none,意味着插入、删除标记等变更不再缓存在 buffer pool 中,而是直接刷盘或走更重的路径。

阅读全文
标签:Mysql