From 78642222cc5255136101619b4702902eb157555b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=8D=9A=E5=87=AF?= <2291200076@qq.com> Date: Sun, 24 Dec 2023 03:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mysql配置备份/my - version 1.ini | 49 ++++++++++++++ .../mysql配置备份/my - version 2.ini | 65 +++++++++++++++++++ netease_music/sql/neteasemusic.sql | 10 +-- 3 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 netease_music/mysql配置备份/my - version 1.ini create mode 100644 netease_music/mysql配置备份/my - version 2.ini diff --git a/netease_music/mysql配置备份/my - version 1.ini b/netease_music/mysql配置备份/my - version 1.ini new file mode 100644 index 0000000..edc5e27 --- /dev/null +++ b/netease_music/mysql配置备份/my - version 1.ini @@ -0,0 +1,49 @@ +# 家笔记本Win11中配置 +[mysql] +default-character-set=utf8mb4 + +[mysqld] +port=3306 +default_authentication_plugin=mysql_native_password +basedir=D:/Program/Development/Environment/phpstudy_pro/Extensions/MySQL8.0.12/ +datadir=D:/Program/Development/Environment/phpstudy_pro/Extensions/MySQL8.0.12/data/ +character-set-server=utf8mb4 +default-storage-engine=InnoDB +max_connections=1000 +collation-server=utf8mb4_unicode_ci +init_connect='SET NAMES utf8mb4' +innodb_buffer_pool_size=64M +# 64M 1G 4G 5G +innodb_flush_log_at_trx_commit=1 +innodb_lock_wait_timeout=120 +innodb_log_buffer_size=4M +innodb_log_file_size=256M +interactive_timeout=120 +join_buffer_size=2M +key_buffer_size=32M +log_error_verbosity=1 +max_allowed_packet=16M +max_heap_table_size=64M +myisam_max_sort_file_size=64G +myisam_sort_buffer_size=32M +read_buffer_size=512kb +read_rnd_buffer_size=4M +skip-external-locking=on +sort_buffer_size=256kb +table_open_cache=256 +thread_cache_size=16 +tmp_table_size=64M +wait_timeout=120 + +skip-log-bin + +server_id=100 +gtid_mode=off_permissive +enforce_gtid_consistency=on +replicate_do_db=neteasemusic +replicate_ignore_db=mysql +slave_skip_errors=all + +[client] +port=3306 +default-character-set=utf8mb4 diff --git a/netease_music/mysql配置备份/my - version 2.ini b/netease_music/mysql配置备份/my - version 2.ini new file mode 100644 index 0000000..52fd0a9 --- /dev/null +++ b/netease_music/mysql配置备份/my - version 2.ini @@ -0,0 +1,65 @@ +# 当前配置文件 +# 针对网易云音乐爬虫 + 家台式机做了特别调整 +[mysql] +default-character-set=utf8mb4 + +[mysqld] +port=3306 +default_authentication_plugin=mysql_native_password +# basedir=D:/Program/Development/Environment/phpstudy_pro/Extensions/MySQL8.0.12/ +# datadir=D:/Program/Development/Environment/phpstudy_pro/Extensions/MySQL8.0.12/data/ +basedir=D:/Program/Develop/Environment/phpstudy_pro/Extensions/MySQL8.0.12/ +datadir=D:/Program/Develop/Environment/phpstudy_pro/Extensions/MySQL8.0.12/data/ +character-set-server=utf8mb4 +default-storage-engine=InnoDB +max_connections=1000 +collation-server=utf8mb4_unicode_ci +init_connect='SET NAMES utf8mb4' +# 这个参数决定了InnoDB存储引擎的缓冲池大小,缓冲池用于缓存数据和索引,提高查询和写入的性能。一般建议将这个参数设置为物理内存的50%~80% +# 默认 64M +# 64M 1G 4G 5G +innodb_buffer_pool_size=32G +# 这个参数决定了事务提交时,日志刷新到磁盘的频率。如果设置为1(默认值),则每次事务提交时都会刷新日志,这样可以保证数据的一致性和恢复能力,但会降低写入性能。如果设置为0或2,则每秒刷新一次日志,这样可以提高写入性能,但会增加数据丢失的风险。可以根据您的业务需求和容忍度选择合适的值 +# 默认 1 +innodb_flush_log_at_trx_commit=0 +innodb_lock_wait_timeout=120 +innodb_log_buffer_size=4M +# 这个参数决定了重做日志文件的大小,重做日志文件用于记录数据的变化,以便在崩溃恢复时重放。这个参数的大小影响着数据库的性能和恢复时间。一般建议将这个参数设置为1~2倍的缓冲池大小,但不要超过4G。您的配置文件中将这个参数设置为256M,这可能太小了,您可以根据您的缓冲池大小适当增大这个值 +# 默认 256M +innodb_log_file_size=1G +interactive_timeout=120 +join_buffer_size=2M +key_buffer_size=32M +log_error_verbosity=1 +max_allowed_packet=16M +max_heap_table_size=64M +myisam_max_sort_file_size=64G +myisam_sort_buffer_size=32M +read_buffer_size=512kb +read_rnd_buffer_size=4M +skip-external-locking=on +sort_buffer_size=256kb +table_open_cache=256 +thread_cache_size=16 +tmp_table_size=64M +wait_timeout=120 + +# 这个参数表示关闭二进制日志功能,二进制日志用于记录数据的变化,以便进行复制或点恢复。如果您不需要这些功能,您可以关闭二进制日志,这样可以节省磁盘空间和I/O开销,提高写入性能。但是,如果您需要进行复制或点恢复,您必须开启二进制日志,并且选择合适的格式和过期时间 +skip-log-bin + +# replicate_do_db, replicate_ignore_db参数指定复制的数据库。但是,如果您关闭了二进制日志功能,这些参数就没有意义了,因为复制依赖于二进制日志。您可以删除这些参数,或者根据您的复制需求重新开启二进制日志 +# gtid_mode, enforce_gtid_consistency参数用于开启全局事务标识(GTID)模式,GTID模式可以简化复制的管理和故障恢复。但是,如果您关闭了二进制日志功能,这些参数也没有意义了,因为GTID模式依赖于二进制日志。您可以删除这些参数,或者根据您的复制需求重新开启二进制日志 +server_id=100 +# gtid_mode=off_permissive +# enforce_gtid_consistency=on +# replicate_do_db=neteasemusic +# replicate_ignore_db=mysql +# slave_skip_errors=all + +# Forcing InnoDB Recovery +# https://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html +# innodb_force_recovery = 6 + +[client] +port=3306 +default-character-set=utf8mb4 diff --git a/netease_music/sql/neteasemusic.sql b/netease_music/sql/neteasemusic.sql index 911f8ac..8812090 100644 --- a/netease_music/sql/neteasemusic.sql +++ b/netease_music/sql/neteasemusic.sql @@ -11,12 +11,12 @@ Target Server Version : 80012 File Encoding : 65001 - Date: 10/11/2022 14:27:21 + Date: 24/12/2023 02:53:47 */ /* -CREATE DATABASE `neteaseMusic` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_0900_ai_ci'; -USE `neteaseMusic`; +CREATE DATABASE `neteasemusic` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_0900_ai_ci'; +USE `neteasemusic`; */ SET NAMES utf8mb4; @@ -119,7 +119,8 @@ CREATE TABLE `comment_progress` ( `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '爬取时间', `modify_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', PRIMARY KEY (`song_id`) USING BTREE, - INDEX `current_status`(`current_status`) USING BTREE + INDEX `current_status`(`current_status`) USING BTREE, + INDEX `song_id`(`song_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; -- ---------------------------- @@ -190,6 +191,7 @@ CREATE TABLE `playlist` ( `remix_video` json NULL COMMENT '保留字段(JSON格式数组)', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '爬取时间', `modify_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `related_playlist` json NULL COMMENT '是否获取了相关歌单', PRIMARY KEY (`playlist_id`) USING BTREE, INDEX `playlist_id`(`playlist_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;