没有合适的资源?快使用搜索试试~ 我知道了~
首页MySQL 8.0官方参考手册:新功能与NDB Cluster详解
MySQL 8.0 Reference Manual 是一个权威的文档,涵盖了MySQL 8.0至8.0.18的主要版本,以及基于NDB 8.0.8-ndb-8.0.15的NDB Cluster版本。这份文档不仅详尽地解释了数据库管理系统的核心功能,还可能包含了未公开发布但计划引入的特性。对于用户来说,理解这些未来可能的功能是非常重要的,因为它可以帮助他们规划升级路径并充分利用新技术。
手册特别强调了不同版本之间的差异,指出并非所有功能都会出现在每一个MySQL 8.0发行版中。这意味着用户在选择适合自己环境的版本时,需要仔细阅读许可协议,确保所使用的功能符合授权范围。如果对当前版本的功能有疑问,可以通过查阅官方许可协议或咨询Oracle的销售代表来获取准确信息。
此外,MySQL 8.0的每一份新版本都伴随着详细的发行说明,这些说明会列出在各个版本中所做的主要更改,帮助用户了解新功能、优化以及潜在的影响。法律信息部分,包括许可证信息,可在前言和法律声明中找到,这对于遵循版权法规和理解使用限制至关重要。
手册还推荐用户在遇到问题时寻求帮助,鼓励他们参与MySQL论坛或邮件列表,与其他用户交流,共同解决问题。文档最后更新日期为2019年3月8日,表明它是一个持续更新的资源,反映了最新的MySQL 8.0状态。
MySQL 8.0 Reference Manual是MySQL 8.0版本管理和开发人员不可或缺的工具,它提供了一站式的指南,涵盖了从核心功能、许可、版本差异到社区支持等全方位的信息。无论是初次接触MySQL的新手,还是经验丰富的开发者,都需要利用这份文档来提升技能和优化数据库管理。
MySQL 8.0 Reference Manual
xvi
15.15.1 Monitoring ALTER TABLE Progress for InnoDB Tables Using Performance
Schema .................................................................................................................. 2743
15.15.2 Monitoring InnoDB Mutex Waits Using Performance Schema ........................ 2745
15.16 InnoDB Monitors .................................................................................................... 2749
15.16.1 InnoDB Monitor Types ................................................................................ 2749
15.16.2 Enabling InnoDB Monitors ........................................................................... 2749
15.16.3 InnoDB Standard Monitor and Lock Monitor Output ...................................... 2751
15.17 InnoDB Backup and Recovery ................................................................................ 2755
15.17.1 InnoDB Backup ........................................................................................... 2755
15.17.2 InnoDB Recovery ........................................................................................ 2756
15.18 InnoDB and MySQL Replication ............................................................................. 2759
15.19 InnoDB memcached Plugin .................................................................................... 2761
15.19.1 Benefits of the InnoDB memcached Plugin ................................................... 2762
15.19.2 InnoDB memcached Architecture ................................................................. 2763
15.19.3 Setting Up the InnoDB memcached Plugin ................................................... 2766
15.19.4 InnoDB memcached Multiple get and Range Query Support .......................... 2772
15.19.5 Security Considerations for the InnoDB memcached Plugin ........................... 2774
15.19.6 Writing Applications for the InnoDB memcached Plugin ................................. 2776
15.19.7 The InnoDB memcached Plugin and Replication ........................................... 2788
15.19.8 InnoDB memcached Plugin Internals ............................................................ 2792
15.19.9 Troubleshooting the InnoDB memcached Plugin ........................................... 2796
15.20 InnoDB Troubleshooting ......................................................................................... 2798
15.20.1 Troubleshooting InnoDB I/O Problems ......................................................... 2798
15.20.2 Forcing InnoDB Recovery ........................................................................... 2799
15.20.3 Troubleshooting InnoDB Data Dictionary Operations ..................................... 2800
15.20.4 InnoDB Error Handling ................................................................................ 2802
16 Alternative Storage Engines ................................................................................................ 2803
16.1 Setting the Storage Engine ...................................................................................... 2806
16.2 The MyISAM Storage Engine ................................................................................... 2807
16.2.1 MyISAM Startup Options ............................................................................... 2810
16.2.2 Space Needed for Keys ................................................................................ 2812
16.2.3 MyISAM Table Storage Formats .................................................................... 2812
16.2.4 MyISAM Table Problems ............................................................................... 2815
16.3 The MEMORY Storage Engine ................................................................................ 2816
16.4 The CSV Storage Engine ........................................................................................ 2821
16.4.1 Repairing and Checking CSV Tables ............................................................. 2821
16.4.2 CSV Limitations ............................................................................................ 2822
16.5 The ARCHIVE Storage Engine ................................................................................. 2822
16.6 The BLACKHOLE Storage Engine ........................................................................... 2824
16.7 The MERGE Storage Engine ................................................................................... 2826
16.7.1 MERGE Table Advantages and Disadvantages .............................................. 2829
16.7.2 MERGE Table Problems ............................................................................... 2829
16.8 The FEDERATED Storage Engine ........................................................................... 2831
16.8.1 FEDERATED Storage Engine Overview ......................................................... 2831
16.8.2 How to Create FEDERATED Tables .............................................................. 2832
16.8.3 FEDERATED Storage Engine Notes and Tips ................................................ 2835
16.8.4 FEDERATED Storage Engine Resources ....................................................... 2836
16.9 The EXAMPLE Storage Engine ................................................................................ 2836
16.10 Other Storage Engines .......................................................................................... 2837
16.11 Overview of MySQL Storage Engine Architecture .................................................... 2837
16.11.1 Pluggable Storage Engine Architecture ........................................................ 2838
16.11.2 The Common Database Server Layer .......................................................... 2838
17 Replication ......................................................................................................................... 2841
17.1 Configuring Replication ............................................................................................ 2842
17.1.1 Binary Log File Position Based Replication Configuration Overview ................. 2843
17.1.2 Setting Up Binary Log File Position Based Replication .................................... 2843
17.1.3 Replication with Global Transaction Identifiers ................................................ 2853
17.1.4 MySQL Multi-Source Replication ................................................................... 2872
MySQL 8.0 Reference Manual
xvii
17.1.5 Changing Replication Modes on Online Servers ............................................. 2876
17.1.6 Replication and Binary Logging Options and Variables .................................... 2881
17.1.7 Common Replication Administration Tasks ..................................................... 2975
17.2 Replication Implementation ...................................................................................... 2978
17.2.1 Replication Formats ...................................................................................... 2979
17.2.2 Replication Implementation Details ................................................................ 2986
17.2.3 Replication Channels .................................................................................... 2988
17.2.4 Replication Relay and Status Logs ................................................................ 2991
17.2.5 How Servers Evaluate Replication Filtering Rules ........................................... 2997
17.3 Replication Solutions ............................................................................................... 3004
17.3.1 Using Replication for Backups ....................................................................... 3004
17.3.2 Handling an Unexpected Halt of a Replication Slave ....................................... 3008
17.3.3 Monitoring Row-based Replication ................................................................. 3010
17.3.4 Using Replication with Different Master and Slave Storage Engines ................. 3010
17.3.5 Using Replication for Scale-Out ..................................................................... 3012
17.3.6 Replicating Different Databases to Different Slaves ........................................ 3013
17.3.7 Improving Replication Performance ................................................................ 3014
17.3.8 Switching Masters During Failover ................................................................. 3015
17.3.9 Setting Up Replication to Use Encrypted Connections .................................... 3017
17.3.10 Encrypting Binary Log Files and Relay Log Files .......................................... 3019
17.3.11 Semisynchronous Replication ...................................................................... 3021
17.3.12 Delayed Replication .................................................................................... 3026
17.4 Replication Notes and Tips ...................................................................................... 3029
17.4.1 Replication Features and Issues .................................................................... 3029
17.4.2 Replication Compatibility Between MySQL Versions ....................................... 3054
17.4.3 Upgrading a Replication Setup ...................................................................... 3054
17.4.4 Troubleshooting Replication .......................................................................... 3056
17.4.5 How to Report Replication Bugs or Problems ................................................. 3057
18 Group Replication .............................................................................................................. 3059
18.1 Group Replication Background ................................................................................. 3060
18.1.1 Replication Technologies ............................................................................... 3061
18.1.2 Group Replication Use Cases ....................................................................... 3062
18.1.3 Group Replication Details .............................................................................. 3063
18.2 Getting Started ........................................................................................................ 3064
18.2.1 Deploying Group Replication in Single-Primary Mode ...................................... 3064
18.3 Monitoring Group Replication ................................................................................... 3075
18.3.1 Group Replication Server States .................................................................... 3076
18.3.2 The replication_group_members Table .......................................................... 3076
18.3.3 Replication_group_member_stats .................................................................. 3077
18.4 Group Replication Operations .................................................................................. 3078
18.4.1 Deploying in Multi-Primary or Single-Primary Mode ......................................... 3078
18.4.2 Configuring an Online Group ......................................................................... 3080
18.4.3 Tuning Recovery .......................................................................................... 3083
18.4.4 Network Partitioning ...................................................................................... 3084
18.4.5 Support For IPv6 And For Mixed IPv6 And IPv4 Groups ................................. 3089
18.4.6 Using MySQL Enterprise Backup with Group Replication ................................ 3090
18.5 Group Replication Security ....................................................................................... 3092
18.5.1 IP Address Whitelisting ................................................................................. 3092
18.5.2 Secure Socket Layer Support (SSL) .............................................................. 3094
18.6 Upgrading Group Replication ................................................................................... 3098
18.6.1 Group Replication Offline Upgrade ................................................................ 3098
18.6.2 Group Replication Online Upgrade ................................................................ 3098
18.7 Group Replication System Variables ......................................................................... 3102
18.8 Requirements and Limitations .................................................................................. 3126
18.8.1 Group Replication Requirements ................................................................... 3126
18.8.2 Group Replication Limitations ........................................................................ 3128
18.9 Frequently Asked Questions .................................................................................... 3129
18.10 Group Replication Technical Details ....................................................................... 3132
MySQL 8.0 Reference Manual
xviii
18.10.1 Group Replication Plugin Architecture .......................................................... 3132
18.10.2 The Group .................................................................................................. 3134
18.10.3 Data Manipulation Statements ..................................................................... 3134
18.10.4 Data Definition Statements .......................................................................... 3134
18.10.5 Distributed Recovery ................................................................................... 3135
18.10.6 Observability ............................................................................................... 3141
18.10.7 Group Replication Performance ................................................................... 3142
19 MySQL Shell ...................................................................................................................... 3147
20 Using MySQL as a Document Store ................................................................................... 3149
20.1 Interfaces to a MySQL Document Store .................................................................... 3150
20.2 Document Store Concepts ....................................................................................... 3150
20.3 JavaScript Quick-Start Guide: MySQL Shell for Document Store ................................ 3151
20.3.1 Import Database Sample ............................................................................... 3151
20.3.2 MySQL Shell ................................................................................................ 3152
20.3.3 Documents and Collections ........................................................................... 3154
20.3.4 Relational Tables .......................................................................................... 3164
20.3.5 Documents in Tables .................................................................................... 3170
20.4 Python Quick-Start Guide: MySQL Shell for Document Store ..................................... 3171
20.4.1 Import Database Sample ............................................................................... 3171
20.4.2 MySQL Shell ................................................................................................ 3172
20.4.3 Documents and Collections ........................................................................... 3174
20.4.4 Relational Tables .......................................................................................... 3184
20.4.5 Documents in Tables .................................................................................... 3190
20.5 X Plugin .................................................................................................................. 3191
20.5.1 Checking X Plugin Installation ....................................................................... 3191
20.5.2 Disabling X Plugin ........................................................................................ 3191
20.5.3 Using Secure Connections with X Plugin ....................................................... 3191
20.5.4 Using X Plugin with the Caching SHA-2 Authentication Plugin ......................... 3192
20.5.5 X Plugin Options and Variables ..................................................................... 3192
20.5.6 Monitoring X Plugin ...................................................................................... 3203
21 InnoDB Cluster ................................................................................................................... 3209
21.1 Introducing InnoDB Cluster ...................................................................................... 3209
21.2 Creating an InnoDB Cluster ..................................................................................... 3211
21.2.1 Deployment Scenarios .................................................................................. 3211
21.2.2 InnoDB Cluster Requirements ....................................................................... 3212
21.2.3 Methods of Installing ..................................................................................... 3212
21.2.4 Production Deployment of InnoDB Cluster ..................................................... 3213
21.2.5 Sandbox Deployment of InnoDB Cluster ........................................................ 3222
21.2.6 Adopting a Group Replication Deployment ..................................................... 3225
21.3 Using MySQL Router with InnoDB Cluster ................................................................ 3226
21.4 Working with InnoDB Cluster ................................................................................... 3229
21.5 Known Limitations ................................................................................................... 3249
22 MySQL NDB Cluster 8.0 .................................................................................................... 3251
22.1 NDB Cluster Overview ............................................................................................. 3255
22.1.1 NDB Cluster Core Concepts .......................................................................... 3256
22.1.2 NDB Cluster Nodes, Node Groups, Replicas, and Partitions ............................ 3259
22.1.3 NDB Cluster Hardware, Software, and Networking Requirements .................... 3261
22.1.4 What is New in NDB Cluster ......................................................................... 3263
22.1.5 Options, Variables, and Parameters Added, Deprecated or Removed in NDB
8.0 .......................................................................................................................... 3267
22.1.6 MySQL Server Using InnoDB Compared with NDB Cluster ............................. 3267
22.1.7 Known Limitations of NDB Cluster ................................................................. 3270
22.2 NDB Cluster Installation ........................................................................................... 3280
22.2.1 The NDB Cluster Auto-Installer ...................................................................... 3282
22.2.2 Installation of NDB Cluster on Linux .............................................................. 3303
22.2.3 Installing NDB Cluster on Windows ............................................................... 3311
22.2.4 Initial Configuration of NDB Cluster ............................................................... 3320
22.2.5 Initial Startup of NDB Cluster ........................................................................ 3322
MySQL 8.0 Reference Manual
xix
22.2.6 NDB Cluster Example with Tables and Data .................................................. 3323
22.2.7 Safe Shutdown and Restart of NDB Cluster ................................................... 3326
22.2.8 Upgrading and Downgrading NDB Cluster ..................................................... 3327
22.3 Configuration of NDB Cluster ................................................................................... 3328
22.3.1 Quick Test Setup of NDB Cluster .................................................................. 3328
22.3.2 Overview of NDB Cluster Configuration Parameters, Options, and Variables ..... 3330
22.3.3 NDB Cluster Configuration Files .................................................................... 3347
22.3.4 Using High-Speed Interconnects with NDB Cluster ......................................... 3520
22.4 NDB Cluster Programs ............................................................................................ 3520
22.4.1 ndbd — The NDB Cluster Data Node Daemon .............................................. 3521
22.4.2 ndbinfo_select_all — Select From ndbinfo Tables .................................. 3528
22.4.3 ndbmtd — The NDB Cluster Data Node Daemon (Multi-Threaded) ................. 3530
22.4.4 ndb_mgmd — The NDB Cluster Management Server Daemon ......................... 3531
22.4.5 ndb_mgm — The NDB Cluster Management Client ......................................... 3539
22.4.6 ndb_blob_tool — Check and Repair BLOB and TEXT columns of NDB
Cluster Tables ......................................................................................................... 3541
22.4.7 ndb_config — Extract NDB Cluster Configuration Information ...................... 3543
22.4.8 ndb_delete_all — Delete All Rows from an NDB Table ............................. 3552
22.4.9 ndb_desc — Describe NDB Tables .............................................................. 3553
22.4.10 ndb_drop_index — Drop Index from an NDB Table ................................... 3559
22.4.11 ndb_drop_table — Drop an NDB Table ................................................... 3560
22.4.12 ndb_error_reporter — NDB Error-Reporting Utility ................................. 3560
22.4.13 ndb_import — Import CSV Data Into NDB ................................................ 3562
22.4.14 ndb_index_stat — NDB Index Statistics Utility ......................................... 3575
22.4.15 ndb_move_data — NDB Data Copy Utility ................................................. 3580
22.4.16 ndb_perror — Obtain NDB Error Message Information .............................. 3583
22.4.17 ndb_print_backup_file — Print NDB Backup File Contents ................... 3585
22.4.18 ndb_print_file — Print NDB Disk Data File Contents .............................. 3585
22.4.19 ndb_print_frag_file — Print NDB Fragment List File Contents .............. 3586
22.4.20 ndb_print_schema_file — Print NDB Schema File Contents .................. 3586
22.4.21 ndb_print_sys_file — Print NDB System File Contents ......................... 3587
22.4.22 ndb_redo_log_reader — Check and Print Content of Cluster Redo Log .... 3587
22.4.23 ndb_restore — Restore an NDB Cluster Backup ....................................... 3590
22.4.24 ndb_select_all — Print Rows from an NDB Table ................................... 3610
22.4.25 ndb_select_count — Print Row Counts for NDB Tables ........................... 3614
22.4.26 ndb_setup.py — Start browser-based Auto-Installer for NDB Cluster .......... 3614
22.4.27 ndb_show_tables — Display List of NDB Tables ....................................... 3618
22.4.28 ndb_size.pl — NDBCLUSTER Size Requirement Estimator ...................... 3619
22.4.29 ndb_top — View CPU usage information for NDB threads ........................... 3622
22.4.30 ndb_waiter — Wait for NDB Cluster to Reach a Given Status ..................... 3627
22.4.31 Options Common to NDB Cluster Programs — Options Common to NDB
Cluster Programs .................................................................................................... 3630
22.5 Management of NDB Cluster ................................................................................... 3635
22.5.1 Summary of NDB Cluster Start Phases .......................................................... 3636
22.5.2 Commands in the NDB Cluster Management Client ........................................ 3637
22.5.3 Online Backup of NDB Cluster ...................................................................... 3642
22.5.4 MySQL Server Usage for NDB Cluster .......................................................... 3646
22.5.5 Performing a Rolling Restart of an NDB Cluster ............................................. 3648
22.5.6 Event Reports Generated in NDB Cluster ...................................................... 3649
22.5.7 NDB Cluster Log Messages .......................................................................... 3660
22.5.8 NDB Cluster Single User Mode ..................................................................... 3675
22.5.9 Quick Reference: NDB Cluster SQL Statements ............................................. 3676
22.5.10 ndbinfo: The NDB Cluster Information Database ........................................... 3679
22.5.11 INFORMATION_SCHEMA Tables for NDB Cluster ....................................... 3726
22.5.12 NDB Cluster Security Issues ....................................................................... 3727
22.5.13 NDB Cluster Disk Data Tables .................................................................... 3733
22.5.14 Online Operations with ALTER TABLE in NDB Cluster .................................. 3741
22.5.15 Adding NDB Cluster Data Nodes Online ...................................................... 3744
MySQL 8.0 Reference Manual
xx
22.5.16 Distributed MySQL Privileges for NDB Cluster .............................................. 3755
22.5.17 NDB API Statistics Counters and Variables .................................................. 3758
22.6 NDB Cluster Replication .......................................................................................... 3769
22.6.1 NDB Cluster Replication: Abbreviations and Symbols ..................................... 3770
22.6.2 General Requirements for NDB Cluster Replication ........................................ 3770
22.6.3 Known Issues in NDB Cluster Replication ...................................................... 3771
22.6.4 NDB Cluster Replication Schema and Tables ................................................. 3778
22.6.5 Preparing the NDB Cluster for Replication ..................................................... 3781
22.6.6 Starting NDB Cluster Replication (Single Replication Channel) ........................ 3783
22.6.7 Using Two Replication Channels for NDB Cluster Replication .......................... 3785
22.6.8 Implementing Failover with NDB Cluster Replication ....................................... 3786
22.6.9 NDB Cluster Backups With NDB Cluster Replication ....................................... 3787
22.6.10 NDB Cluster Replication: Multi-Master and Circular Replication ...................... 3793
22.6.11 NDB Cluster Replication Conflict Resolution ................................................. 3797
22.7 NDB Cluster Release Notes ..................................................................................... 3811
23 Partitioning ......................................................................................................................... 3813
23.1 Overview of Partitioning in MySQL ........................................................................... 3814
23.2 Partitioning Types .................................................................................................... 3817
23.2.1 RANGE Partitioning ...................................................................................... 3818
23.2.2 LIST Partitioning ........................................................................................... 3823
23.2.3 COLUMNS Partitioning ................................................................................. 3825
23.2.4 HASH Partitioning ......................................................................................... 3832
23.2.5 KEY Partitioning ........................................................................................... 3835
23.2.6 Subpartitioning .............................................................................................. 3837
23.2.7 How MySQL Partitioning Handles NULL ........................................................ 3839
23.3 Partition Management .............................................................................................. 3843
23.3.1 Management of RANGE and LIST Partitions .................................................. 3844
23.3.2 Management of HASH and KEY Partitions ..................................................... 3850
23.3.3 Exchanging Partitions and Subpartitions with Tables ....................................... 3851
23.3.4 Maintenance of Partitions .............................................................................. 3858
23.3.5 Obtaining Information About Partitions ........................................................... 3860
23.4 Partition Pruning ...................................................................................................... 3862
23.5 Partition Selection .................................................................................................... 3865
23.6 Restrictions and Limitations on Partitioning ............................................................... 3870
23.6.1 Partitioning Keys, Primary Keys, and Unique Keys ......................................... 3875
23.6.2 Partitioning Limitations Relating to Storage Engines ........................................ 3879
23.6.3 Partitioning Limitations Relating to Functions .................................................. 3880
24 Stored Programs and Views ............................................................................................... 3883
24.1 Defining Stored Programs ........................................................................................ 3884
24.2 Using Stored Routines (Procedures and Functions) ................................................... 3885
24.2.1 Stored Routine Syntax .................................................................................. 3885
24.2.2 Stored Routines and MySQL Privileges ......................................................... 3886
24.2.3 Stored Routine Metadata .............................................................................. 3886
24.2.4 Stored Procedures, Functions, Triggers, and LAST_INSERT_ID() .................... 3887
24.3 Using Triggers ......................................................................................................... 3887
24.3.1 Trigger Syntax and Examples ........................................................................ 3888
24.3.2 Trigger Metadata .......................................................................................... 3891
24.4 Using the Event Scheduler ...................................................................................... 3892
24.4.1 Event Scheduler Overview ............................................................................ 3892
24.4.2 Event Scheduler Configuration ...................................................................... 3893
24.4.3 Event Syntax ................................................................................................ 3895
24.4.4 Event Metadata ............................................................................................ 3895
24.4.5 Event Scheduler Status ................................................................................. 3896
24.4.6 The Event Scheduler and MySQL Privileges .................................................. 3897
24.5 Using Views ............................................................................................................ 3899
24.5.1 View Syntax ................................................................................................. 3900
24.5.2 View Processing Algorithms .......................................................................... 3900
24.5.3 Updatable and Insertable Views .................................................................... 3901
剩余6027页未读,继续阅读
2022-12-31 上传
240 浏览量
196 浏览量
130 浏览量
点击了解资源详情
645 浏览量
2025-01-01 上传
2025-01-01 上传
2025-01-01 上传
沧海一笑-dj
- 粉丝: 5w+
- 资源: 359
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功