【发布时间】:2019-01-30 10:17:17
【问题描述】:
我有一个 MySQL 服务器,自 2015 年 12 月以来一直安装 MySQL。然后我在大约 2 周前(2018-08-07)将其升级到 MySQL 8.0.12。
- 我从旧数据库创建了一个大约 20GB 的转储文件
- 然后我通过 Windows 控制面板中的添加/删除功能卸载了 MySQL 5.7。
- 然后我通过 msi 安装文件安装了新的 MySQL 8.0.12 数据库。
- 我从转储文件中导入了所有数据 - 并将所有数据库和表等的字符集更改为 utf8mb4。
一切正常 - 新数据库现在也可以正常工作 - 但我想知道一件事:MySQL 工作台中没有关键效率:
服务器是具有 8GB RAM 的 Windows Server 2012 64 位。而且每天人流量很大。我在配置文件中尝试了很多不同的选项——为了提高数据库的性能——但似乎没有任何帮助。 我认为奇怪的另一件事是旧文件夹 \ProgramData\MySQL\MySQL 5.7 仍然包含包含当前配置的 my.ini 文件。 当我将 MySQL 服务器升级到 8.0.12 时,它还创建了另一个名为 \ProgramData\MySQL\MySQL 8.0\ 的文件夹 - 其中包含所有数据。新版本的mysql自动使用旧版本的配置文件,如果mysql..,这正常吗?
我已在此处附加了 my.ini 配置文件。关于为什么在关键效率方面什么都没有发生的任何好主意 - 以及我应该在配置文件中进行哪些更改的任何好主意? (所有路径都替换为“??????”)
[mysqld]
skip_name_resolve=on
innodb_buffer_pool_size=6G
innodb_buffer_pool_instances=8
innodb_buffer_pool_chunk_size=64M
disconnect_on_expired_password=off
port=3306
datadir=????
character-set-server=utf8mb4
collation-server=utf8mb4_0900_ai_ci
default_authentication_plugin=mysql_native_password
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="????"
slow-query-log=1
slow_query_log_file="????"
long_query_time=10
log-error="????"
server-id=1
lower_case_table_names=1
secure-file-priv="????"
max_connections=151
table_open_cache=2000
tmp_table_size=16M
thread_cache_size=10
myisam_max_sort_file_size = 100M
myisam_sort_buffer_size = 100M
key_buffer_size=104857600
read_buffer_size=0
read_rnd_buffer_size=0
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=256M
innodb_log_file_size=2G
innodb_thread_concurrency=17
innodb_autoextend_increment=64
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=100M
max_allowed_packet = 16M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=100M
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000
loose_mysqlx_port=33060
skip-character-set-client-handshake
mysql_firewall_mode = off
auto_generate_certs = off
sha256_password_auto_generate_rsa_keys = off
caching_sha2_password_auto_generate_rsa_keys = off
innodb_doublewrite = off
max_binlog_size = 1G
binlog_row_image = minimal
binlog_stmt_cache_size = 32768
binlog_expire_logs_seconds = 3600
binlog_cache_size = 32768
max_binlog_stmt_cache_size = 1G
binlog_row_metadata = MINIMAL
binlog-do-db = hmailserver
max_relay_log_size = 0
【问题讨论】:
-
另外,请发布完整的当前错误日志(在 pastebin.com 或此处)以直观地验证内容。谢谢。
-
这里是 txt-file 的链接,您要求的所有内容都是:1drv.ms/t/s!Ak5nrcTR_zUIxVcOHxNJFlmfG4rx 该文件的大小对于此文本区域来说太大了...
-
搜索 mysqltuner.pl 以下载 PERL 脚本,该脚本从正在运行的 MySQL 实例生成报告。请获取 Windows 64 位版本。请将报告复制到剪贴板,保存到 Wordpad.txt 文件并上传。谢谢
-
我在时区 UTC +2 小时。是的,我可以访问 Skype - 我的 Skype ID 是 dannielsen1982 (atsign) gmail.com
-
我认为“关键效率”指的是 MyISAM 表。
标签: mysql performance configuration mysql-workbench