宝塔双12特惠活动,企业版2399元/3年,立省600元,还送3年SSL证书!查看活动
当前位置:论坛首页 > Windows面板 > 求助

windows极速版里使用mysql8.0会遇到很多未知问题。

发表在 Windows面板2025-11-30 09:26 [复制链接] 1 175

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:宝塔Windows面板 8.4.6

系统版本:Windows Server 2022 Datacenter

问题描述:备份或导入 如果都是 两台服务器都是 同样mysql8.0数据库,导出 导入 会遇到 GTID 报错 以及出现转义符报错问题!

相关截图(日志、错误):
转义符报错:[color=rgba(0, 0, 0, 0.85)][backcolor=rgba(0, 0, 0, 0.04)]mysql: [Warning] Using a password on the command line interface can be insecure. ERROR at line 1883: Unknown command '\''. --> exit status 1
[color=rgba(0, 0, 0, 0.85)][backcolor=rgba(0, 0, 0, 0.04)]
[color=rgba(0, 0, 0, 0.85)][backcolor=rgba(0, 0, 0, 0.04)]GTID 报错:[color=rgba(0, 0, 0, 0.85)][backcolor=rgba(0, 0, 0, 0.04)]mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 3546 (HY000) at line 24: @@GLOBAL.GTID_PURGED cannot be changed: the added gtid set must not overlap with @@GLOBAL.GTID_EXECUTED --> exit status 1
请问以下方式:修改后对于数据备份完整性或其他问题有影响吗?


我目前的解决方案:修改mysql8.0为以下配置,如果是两台服务器导出导入数据,我两台服务器都需要改为以下配置,在新备份数据在导入:
[mysqld]
# ========== 彻底禁用GTID(核心,解决3546报错) ==========
gtid_mode = OFF
enforce_gtid_consistency = OFF
binlog_gtid_simple_recovery = OFF
skip-log-bin                         # 彻底关闭binlog,杜绝GTID依赖(注释掉原log-bin后加这行)
# 注释冲突的GTID参数(无需改动)
# enforce-gtid-consistency=true
# gtid-mode=on

# ========== 解决\'转义符报错(核心,仅保留1套有效配置) ==========
sql-mode = NO_ENGINE_SUBSTITUTION    # 仅保留1行,去掉严格模式,避免转义报错
character-set-server = utf8mb4       # 统一字符集为utf8mb4(删除重复的utf8配置)
collation-server = utf8mb4_general_ci# 配合utf8mb4,避免字符转义乱码

# ========== 基础运行配置(保留有效项,删除重复) ==========
port=3306
basedir  ="D:/BtSoft/mysql/MySQL8.0/"
datadir  ="D:/BtSoft/mysql/MySQL8.0/data/"
tmpdir   ="D:/BtSoft/mysql/MySQL8.0/data/"
socket   ="D:/BtSoft/mysql/MySQL8.0/data/mysql.sock"
log-error="D:/BtSoft/mysql/MySQL8.0/data/mysql_error.log"

# ========== 存储引擎/性能配置(保留原项,无冲突) ==========
default_storage_engine = InnoDB
performance_schema_max_table_instances = 400
table_definition_cache = 400
skip-external-locking
key_buffer_size = 512M
max_allowed_packet = 100G
table_open_cache = 1024
sort_buffer_size = 2048K
net_buffer_length = 4K
read_buffer_size = 2048K
read_rnd_buffer_size = 1024K
myisam_sort_buffer_size = 16M
thread_cache_size = 192
tmp_table_size = 1024M
default_authentication_plugin = mysql_native_password
lower_case_table_names = 1

# ========== 其他基础配置(保留原项) ==========
explicit_defaults_for_timestamp = true
#skip-name-resolve
max_connections = 400
max_connect_errors = 100
open_files_limit = 65535

# ========== binlog相关(禁用GTID后无需开启) ==========
binlog_format=mixed  # 保留不生效,无影响
server-id = 1
binlog_expire_logs_seconds = 600000
# log-slave-updates=true

# ========== 慢查询日志(保留原项) ==========
slow_query_log = ON
slow-query-log-file = "D:/BtSoft/mysql/MySQL8.0/data/mysql-slow.log"
long_query_time = 3
#log_queries_not_using_indexes=on
early-plugin-load = ""

# ========== InnoDB配置(保留原项) ==========
innodb_data_home_dir = "D:/BtSoft/mysql/MySQL8.0/data/"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "D:/BtSoft/mysql/MySQL8.0/data/"
innodb_buffer_pool_size = 1024M
innodb_log_file_size = 128M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 8
innodb_write_io_threads = 8

[mysqldump]
quick
max_allowed_packet = 500M

[mysql]
no-auto-rehash
default-character-set = utf8mb4    # 客户端字符集和服务端一致

[myisamchk]
key_buffer_size = 64M
sort_buffer_size = 1M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


请问以上方式:修改后对于数据备份完整性或其他问题有影响吗?
使用道具 举报 只看该作者 回复
发表于 2025-12-1 20:27:48 | 显示全部楼层
好贴,点子
使用道具 举报 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表