没有合适的资源?快使用搜索试试~ 我知道了~
首页MySQL5.7参考手册:Oracle官方文档
"MySQL5.7版本的API参考手册,涵盖了如何连接、操作数据库以及详尽的API使用说明,由Oracle官方提供。适用于C/C++编程语言,与SQL语句配合使用,包括NDB Cluster 7.5和7.6的相关内容。"
MySQL5.7参考手册是针对该版本数据库系统的全面指南,它不仅覆盖了5.7.24之前的各项功能,还可能包含了未正式发布的特性。手册中详细解释了如何连接到MySQL服务器,如何执行数据库操作,以及各种API(应用程序接口)的具体用法,对于开发者来说是极其宝贵的资源。
手册涵盖了MySQL5.7的一些特色功能,但需要注意的是,并非所有这些特性在每个发行版中都可用。某些特性可能仅存在于特定版本或特定授权的MySQL5.7中。如果你对你的许可证包含哪些功能有疑问,应查阅MySQL5.7的许可协议或咨询Oracle的销售代表。
手册中的变化记录可以在MySQL5.7的发布说明中找到,这些说明详细列出了每个版本的更新和改进。对于法律信息,包括许可信息,读者应在前言和法律通知部分查阅。
在遇到使用MySQL的问题时,用户可以访问MySQL论坛或MySQL邮件列表寻求帮助,在那里可以与其他MySQL用户交流讨论问题。
该文档的最后修订日期为2018年6月11日,修订号为57637,确保了内容的时效性。
在API部分,手册会详细介绍如何使用C/C++编程语言来操作MySQL数据库,包括建立连接、执行SQL查询、处理结果集等基本操作,同时也会涉及到更高级的主题,如事务处理、并发控制、存储过程和触发器等。对于C/C++开发者来说,这将帮助他们更好地集成MySQL数据库到他们的应用程序中。
在NDB Cluster部分,手册会涉及高可用性和分布式数据库管理,包括数据节点的设置、集群配置、故障恢复策略以及性能优化。NDB Cluster 7.5和7.6的特性也会被详细讨论,这对于需要构建高可靠性和可扩展性的数据库解决方案的开发者尤其重要。
这份MySQL5.7参考手册是开发者、数据库管理员和技术人员不可或缺的工具,提供了丰富的信息和指导,帮助他们在实际工作中有效地利用MySQL5.7及其相关的NDB Cluster功能。
MySQL 5.7 Reference Manual
xvi
14.21.2 Forcing InnoDB Recovery ........................................................................... 2540
14.21.3 Troubleshooting InnoDB Data Dictionary Operations ..................................... 2542
14.21.4 InnoDB Error Handling ................................................................................ 2545
15 Alternative Storage Engines ................................................................................................ 2547
15.1 Setting the Storage Engine ...................................................................................... 2550
15.2 The MyISAM Storage Engine ................................................................................... 2551
15.2.1 MyISAM Startup Options ............................................................................... 2554
15.2.2 Space Needed for Keys ................................................................................ 2556
15.2.3 MyISAM Table Storage Formats .................................................................... 2556
15.2.4 MyISAM Table Problems ............................................................................... 2558
15.3 The MEMORY Storage Engine ................................................................................ 2560
15.4 The CSV Storage Engine ........................................................................................ 2564
15.4.1 Repairing and Checking CSV Tables ............................................................. 2565
15.4.2 CSV Limitations ............................................................................................ 2566
15.5 The ARCHIVE Storage Engine ................................................................................. 2566
15.6 The BLACKHOLE Storage Engine ........................................................................... 2567
15.7 The MERGE Storage Engine ................................................................................... 2570
15.7.1 MERGE Table Advantages and Disadvantages .............................................. 2572
15.7.2 MERGE Table Problems ............................................................................... 2573
15.8 The FEDERATED Storage Engine ........................................................................... 2574
15.8.1 FEDERATED Storage Engine Overview ......................................................... 2575
15.8.2 How to Create FEDERATED Tables .............................................................. 2576
15.8.3 FEDERATED Storage Engine Notes and Tips ................................................ 2578
15.8.4 FEDERATED Storage Engine Resources ....................................................... 2580
15.9 The EXAMPLE Storage Engine ................................................................................ 2580
15.10 Other Storage Engines .......................................................................................... 2580
15.11 Overview of MySQL Storage Engine Architecture .................................................... 2580
15.11.1 Pluggable Storage Engine Architecture ........................................................ 2581
15.11.2 The Common Database Server Layer .......................................................... 2581
16 Replication ......................................................................................................................... 2583
16.1 Configuring Replication ............................................................................................ 2584
16.1.1 Binary Log File Position Based Replication Configuration Overview ................. 2585
16.1.2 Setting Up Binary Log File Position Based Replication .................................... 2585
16.1.3 Replication with Global Transaction Identifiers ................................................ 2594
16.1.4 MySQL Multi-Source Replication ................................................................... 2604
16.1.5 Changing Replication Modes on Online Servers ............................................. 2608
16.1.6 Replication and Binary Logging Options and Variables .................................... 2614
16.1.7 Common Replication Administration Tasks ..................................................... 2697
16.2 Replication Implementation ...................................................................................... 2700
16.2.1 Replication Formats ...................................................................................... 2701
16.2.2 Replication Implementation Details ................................................................ 2708
16.2.3 Replication Channels .................................................................................... 2710
16.2.4 Replication Relay and Status Logs ................................................................ 2713
16.2.5 How Servers Evaluate Replication Filtering Rules ........................................... 2718
16.3 Replication Solutions ............................................................................................... 2723
16.3.1 Using Replication for Backups ....................................................................... 2724
16.3.2 Handling an Unexpected Halt of a Replication Slave ....................................... 2727
16.3.3 Using Replication with Different Master and Slave Storage Engines ................. 2729
16.3.4 Using Replication for Scale-Out ..................................................................... 2731
16.3.5 Replicating Different Databases to Different Slaves ........................................ 2732
16.3.6 Improving Replication Performance ................................................................ 2733
16.3.7 Switching Masters During Failover ................................................................. 2734
16.3.8 Setting Up Replication to Use Encrypted Connections .................................... 2736
16.3.9 Semisynchronous Replication ........................................................................ 2738
16.3.10 Delayed Replication .................................................................................... 2743
16.4 Replication Notes and Tips ...................................................................................... 2744
16.4.1 Replication Features and Issues .................................................................... 2744
16.4.2 Replication Compatibility Between MySQL Versions ....................................... 2770
MySQL 5.7 Reference Manual
xvii
16.4.3 Upgrading a Replication Setup ...................................................................... 2771
16.4.4 Troubleshooting Replication .......................................................................... 2773
16.4.5 How to Report Replication Bugs or Problems ................................................. 2774
17 Group Replication .............................................................................................................. 2775
17.1 Group Replication Background ................................................................................. 2776
17.1.1 Replication Technologies ............................................................................... 2776
17.1.2 Group Replication Use Cases ....................................................................... 2778
17.1.3 Group Replication Details .............................................................................. 2779
17.2 Getting Started ........................................................................................................ 2780
17.2.1 Deploying Group Replication in Single-Primary Mode ...................................... 2780
17.3 Monitoring Group Replication ................................................................................... 2791
17.3.1 Replication_group_member_stats .................................................................. 2791
17.3.2 Replication_group_members ......................................................................... 2792
17.3.3 Replication_connection_status ....................................................................... 2792
17.3.4 Replication_applier_status ............................................................................. 2793
17.3.5 Group Replication Server States .................................................................... 2793
17.4 Group Replication Operations .................................................................................. 2794
17.4.1 Deploying in Multi-Primary or Single-Primary Mode ......................................... 2794
17.4.2 Tuning Recovery .......................................................................................... 2796
17.4.3 Network Partitioning ...................................................................................... 2797
17.4.4 Using MySQL Enterprise Backup with Group Replication ................................ 2801
17.5 Group Replication Security ....................................................................................... 2803
17.5.1 IP Address Whitelisting ................................................................................. 2803
17.5.2 Secure Socket Layer Support (SSL) .............................................................. 2804
17.5.3 Virtual Private Networks (VPN) ...................................................................... 2808
17.6 Group Replication System Variables ......................................................................... 2808
17.7 Requirements and Limitations .................................................................................. 2821
17.7.1 Group Replication Requirements ................................................................... 2822
17.7.2 Group Replication Limitations ........................................................................ 2823
17.8 Frequently Asked Questions .................................................................................... 2824
17.9 Group Replication Technical Details ......................................................................... 2827
17.9.1 Group Replication Plugin Architecture ............................................................ 2827
17.9.2 The Group .................................................................................................... 2829
17.9.3 Data Manipulation Statements ....................................................................... 2829
17.9.4 Data Definition Statements ............................................................................ 2829
17.9.5 Distributed Recovery ..................................................................................... 2830
17.9.6 Observability ................................................................................................. 2836
17.9.7 Group Replication Performance ..................................................................... 2837
18 MySQL Shell User Guide ................................................................................................... 2841
18.1 MySQL Shell Features ............................................................................................. 2841
18.2 Getting Started with MySQL Shell ............................................................................ 2843
18.2.1 MySQL Shell Connections ............................................................................. 2843
18.2.2 MySQL Shell Sessions .................................................................................. 2848
18.2.3 MySQL Shell Global Variables ...................................................................... 2849
18.3 MySQL Shell Code Execution .................................................................................. 2851
18.3.1 Interactive Code Execution ............................................................................ 2851
18.3.2 Batch Code Execution .................................................................................. 2853
18.3.3 Output Formats ............................................................................................ 2853
18.3.4 Active Language ........................................................................................... 2856
18.3.5 Batch Mode Made Interactive ........................................................................ 2856
18.4 Configuring MySQL Shell ......................................................................................... 2857
18.4.1 MySQL Shell Commands .............................................................................. 2857
18.5 MySQL Shell Application Log ................................................................................... 2859
18.6 Customizing MySQL Shell ....................................................................................... 2860
18.6.1 Working With Start-Up Scripts ....................................................................... 2861
18.6.2 Adding Module Search Paths ........................................................................ 2861
18.6.3 Overriding the Default Prompt ....................................................................... 2862
19 Using MySQL as a Document Store ................................................................................... 2865
MySQL 5.7 Reference Manual
xviii
19.1 Preproduction Status — Legal Notice ....................................................................... 2866
19.2 Key Concepts .......................................................................................................... 2866
19.3 Setting Up MySQL as a Document Store .................................................................. 2867
19.3.1 Installing MySQL Shell .................................................................................. 2869
19.3.2 Starting MySQL Shell .................................................................................... 2873
19.4 Quick-Start Guide: MySQL Shell for JavaScript ......................................................... 2873
19.4.1 Introduction ................................................................................................... 2874
19.4.2 Import Database Sample ............................................................................... 2875
19.4.3 MySQL Shell ................................................................................................ 2875
19.4.4 Documents and Collections ........................................................................... 2877
19.4.5 Relational Tables .......................................................................................... 2887
19.4.6 Documents in Tables .................................................................................... 2892
19.5 Quick-Start Guide: MySQL Shell for Python .............................................................. 2893
19.5.1 Introduction ................................................................................................... 2894
19.5.2 Import Database Sample ............................................................................... 2895
19.5.3 MySQL Shell ................................................................................................ 2895
19.5.4 Documents and Collections ........................................................................... 2897
19.5.5 Relational Tables .......................................................................................... 2907
19.5.6 Documents in Tables .................................................................................... 2912
19.6 Quick-Start Guide: MySQL for Visual Studio ............................................................. 2913
19.7 X Plugin .................................................................................................................. 2915
19.7.1 Using Secure Connections with X Plugin ....................................................... 2915
19.7.2 X Plugin Options and Variables ..................................................................... 2915
19.7.3 Monitoring X Plugin ...................................................................................... 2926
20 InnoDB Cluster ................................................................................................................... 2931
20.1 Introducing InnoDB Cluster ...................................................................................... 2931
20.2 Creating an InnoDB Cluster ..................................................................................... 2933
20.2.1 Deployment Scenarios .................................................................................. 2933
20.2.2 InnoDB Cluster Requirements ....................................................................... 2933
20.2.3 Methods of Installing ..................................................................................... 2934
20.2.4 Sandbox Deployment of InnoDB Cluster ........................................................ 2934
20.2.5 Production Deployment of InnoDB Cluster ..................................................... 2937
20.2.6 Adopting a Group Replication Deployment ..................................................... 2945
20.3 Using MySQL Router with InnoDB Cluster ................................................................ 2946
20.4 Working with InnoDB Cluster ................................................................................... 2949
20.5 Known Limitations ................................................................................................... 2958
21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6 .................................................................... 2961
21.1 NDB Cluster Overview ............................................................................................. 2965
21.1.1 NDB Cluster Core Concepts .......................................................................... 2966
21.1.2 NDB Cluster Nodes, Node Groups, Replicas, and Partitions ............................ 2969
21.1.3 NDB Cluster Hardware, Software, and Networking Requirements .................... 2971
21.1.4 What is New in NDB Cluster ......................................................................... 2973
21.1.5 MySQL Server Using InnoDB Compared with NDB Cluster ............................. 2985
21.1.6 Known Limitations of NDB Cluster ................................................................. 2988
21.2 NDB Cluster Installation ........................................................................................... 2998
21.2.1 The NDB Cluster Auto-Installer ...................................................................... 3001
21.2.2 Installation of NDB Cluster on Linux .............................................................. 3012
21.2.3 Installing NDB Cluster on Windows ............................................................... 3021
21.2.4 Initial Configuration of NDB Cluster ............................................................... 3030
21.2.5 Initial Startup of NDB Cluster ........................................................................ 3032
21.2.6 NDB Cluster Example with Tables and Data .................................................. 3033
21.2.7 Safe Shutdown and Restart of NDB Cluster ................................................... 3036
21.2.8 Upgrading and Downgrading NDB Cluster ..................................................... 3037
21.3 Configuration of NDB Cluster ................................................................................... 3039
21.3.1 Quick Test Setup of NDB Cluster .................................................................. 3040
21.3.2 Overview of NDB Cluster Configuration Parameters, Options, and Variables ..... 3042
21.3.3 NDB Cluster Configuration Files .................................................................... 3058
21.3.4 Using High-Speed Interconnects with NDB Cluster ......................................... 3230
MySQL 5.7 Reference Manual
xix
21.4 NDB Cluster Programs ............................................................................................ 3230
21.4.1 ndbd — The NDB Cluster Data Node Daemon .............................................. 3231
21.4.2 ndbinfo_select_all — Select From ndbinfo Tables .................................. 3238
21.4.3 ndbmtd — The NDB Cluster Data Node Daemon (Multi-Threaded) ................. 3240
21.4.4 ndb_mgmd — The NDB Cluster Management Server Daemon ......................... 3241
21.4.5 ndb_mgm — The NDB Cluster Management Client ......................................... 3249
21.4.6 ndb_blob_tool — Check and Repair BLOB and TEXT columns of NDB
Cluster Tables ......................................................................................................... 3251
21.4.7 ndb_config — Extract NDB Cluster Configuration Information ...................... 3253
21.4.8 ndb_cpcd — Automate Testing for NDB Development ................................... 3262
21.4.9 ndb_delete_all — Delete All Rows from an NDB Table ............................. 3263
21.4.10 ndb_desc — Describe NDB Tables ............................................................ 3263
21.4.11 ndb_drop_index — Drop Index from an NDB Table ................................... 3269
21.4.12 ndb_drop_table — Drop an NDB Table ................................................... 3270
21.4.13 ndb_error_reporter — NDB Error-Reporting Utility ................................. 3270
21.4.14 ndb_import — Import CSV Data Into NDB ................................................ 3272
21.4.15 ndb_index_stat — NDB Index Statistics Utility ......................................... 3285
21.4.16 ndb_move_data — NDB Data Copy Utility ................................................. 3290
21.4.17 ndb_perror — Obtain NDB error message information ............................... 3293
21.4.18 ndb_print_backup_file — Print NDB Backup File Contents ................... 3295
21.4.19 ndb_print_file — Print NDB Disk Data File Contents .............................. 3295
21.4.20 ndb_print_frag_file — Print NDB Fragment List File Contents .............. 3296
21.4.21 ndb_print_schema_file — Print NDB Schema File Contents .................. 3297
21.4.22 ndb_print_sys_file — Print NDB System File Contents ......................... 3297
21.4.23 ndb_redo_log_reader — Check and Print Content of Cluster Redo Log .... 3297
21.4.24 ndb_restore — Restore an NDB Cluster Backup ....................................... 3300
21.4.25 ndb_select_all — Print Rows from an NDB Table ................................... 3321
21.4.26 ndb_select_count — Print Row Counts for NDB Tables ........................... 3324
21.4.27 ndb_setup.py — Start browser-based Auto-Installer for NDB Cluster .......... 3325
21.4.28 ndb_show_tables — Display List of NDB Tables ....................................... 3328
21.4.29 ndb_size.pl — NDBCLUSTER Size Requirement Estimator ...................... 3329
21.4.30 ndb_top — View CPU usage information for NDB threads ........................... 3332
21.4.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status ..................... 3338
21.4.32 Options Common to NDB Cluster Programs — Options Common to NDB
Cluster Programs .................................................................................................... 3341
21.5 Management of NDB Cluster ................................................................................... 3346
21.5.1 Summary of NDB Cluster Start Phases .......................................................... 3346
21.5.2 Commands in the NDB Cluster Management Client ........................................ 3348
21.5.3 Online Backup of NDB Cluster ...................................................................... 3353
21.5.4 MySQL Server Usage for NDB Cluster .......................................................... 3357
21.5.5 Performing a Rolling Restart of an NDB Cluster ............................................. 3358
21.5.6 Event Reports Generated in NDB Cluster ...................................................... 3360
21.5.7 NDB Cluster Log Messages .......................................................................... 3370
21.5.8 NDB Cluster Single User Mode ..................................................................... 3387
21.5.9 Quick Reference: NDB Cluster SQL Statements ............................................. 3387
21.5.10 ndbinfo: The NDB Cluster Information Database ........................................... 3390
21.5.11 INFORMATION_SCHEMA Tables for NDB Cluster ....................................... 3438
21.5.12 NDB Cluster Security Issues ....................................................................... 3439
21.5.13 NDB Cluster Disk Data Tables .................................................................... 3445
21.5.14 Adding NDB Cluster Data Nodes Online ...................................................... 3453
21.5.15 Distributed MySQL Privileges for NDB Cluster .............................................. 3464
21.5.16 NDB API Statistics Counters and Variables .................................................. 3467
21.6 NDB Cluster Replication .......................................................................................... 3477
21.6.1 NDB Cluster Replication: Abbreviations and Symbols ..................................... 3479
21.6.2 General Requirements for NDB Cluster Replication ........................................ 3479
21.6.3 Known Issues in NDB Cluster Replication ...................................................... 3480
21.6.4 NDB Cluster Replication Schema and Tables ................................................. 3487
21.6.5 Preparing the NDB Cluster for Replication ..................................................... 3490
MySQL 5.7 Reference Manual
xx
21.6.6 Starting NDB Cluster Replication (Single Replication Channel) ........................ 3492
21.6.7 Using Two Replication Channels for NDB Cluster Replication .......................... 3494
21.6.8 Implementing Failover with NDB Cluster Replication ....................................... 3495
21.6.9 NDB Cluster Backups With NDB Cluster Replication ....................................... 3496
21.6.10 NDB Cluster Replication: Multi-Master and Circular Replication ...................... 3502
21.6.11 NDB Cluster Replication Conflict Resolution ................................................. 3506
21.7 NDB Cluster Release Notes ..................................................................................... 3520
22 Partitioning ......................................................................................................................... 3521
22.1 Overview of Partitioning in MySQL ........................................................................... 3523
22.2 Partitioning Types .................................................................................................... 3526
22.2.1 RANGE Partitioning ...................................................................................... 3528
22.2.2 LIST Partitioning ........................................................................................... 3532
22.2.3 COLUMNS Partitioning ................................................................................. 3534
22.2.4 HASH Partitioning ......................................................................................... 3542
22.2.5 KEY Partitioning ........................................................................................... 3545
22.2.6 Subpartitioning .............................................................................................. 3547
22.2.7 How MySQL Partitioning Handles NULL ........................................................ 3550
22.3 Partition Management .............................................................................................. 3554
22.3.1 Management of RANGE and LIST Partitions .................................................. 3555
22.3.2 Management of HASH and KEY Partitions ..................................................... 3561
22.3.3 Exchanging Partitions and Subpartitions with Tables ....................................... 3562
22.3.4 Maintenance of Partitions .............................................................................. 3569
22.3.5 Obtaining Information About Partitions ........................................................... 3571
22.4 Partition Pruning ...................................................................................................... 3573
22.5 Partition Selection .................................................................................................... 3576
22.6 Restrictions and Limitations on Partitioning ............................................................... 3582
22.6.1 Partitioning Keys, Primary Keys, and Unique Keys ......................................... 3588
22.6.2 Partitioning Limitations Relating to Storage Engines ........................................ 3591
22.6.3 Partitioning Limitations Relating to Functions .................................................. 3592
22.6.4 Partitioning and Locking ................................................................................ 3594
23 Stored Programs and Views ............................................................................................... 3597
23.1 Defining Stored Programs ........................................................................................ 3598
23.2 Using Stored Routines (Procedures and Functions) ................................................... 3599
23.2.1 Stored Routine Syntax .................................................................................. 3599
23.2.2 Stored Routines and MySQL Privileges ......................................................... 3600
23.2.3 Stored Routine Metadata .............................................................................. 3600
23.2.4 Stored Procedures, Functions, Triggers, and LAST_INSERT_ID() .................... 3601
23.3 Using Triggers ......................................................................................................... 3601
23.3.1 Trigger Syntax and Examples ........................................................................ 3602
23.3.2 Trigger Metadata .......................................................................................... 3605
23.4 Using the Event Scheduler ...................................................................................... 3606
23.4.1 Event Scheduler Overview ............................................................................ 3606
23.4.2 Event Scheduler Configuration ...................................................................... 3607
23.4.3 Event Syntax ................................................................................................ 3609
23.4.4 Event Metadata ............................................................................................ 3609
23.4.5 Event Scheduler Status ................................................................................. 3610
23.4.6 The Event Scheduler and MySQL Privileges .................................................. 3611
23.5 Using Views ............................................................................................................ 3613
23.5.1 View Syntax ................................................................................................. 3614
23.5.2 View Processing Algorithms .......................................................................... 3614
23.5.3 Updatable and Insertable Views .................................................................... 3615
23.5.4 The View WITH CHECK OPTION Clause ...................................................... 3618
23.5.5 View Metadata .............................................................................................. 3619
23.6 Access Control for Stored Programs and Views ........................................................ 3619
23.7 Binary Logging of Stored Programs .......................................................................... 3621
24 INFORMATION_SCHEMA Tables ....................................................................................... 3629
24.1 The INFORMATION_SCHEMA CHARACTER_SETS Table ....................................... 3632
24.2 The INFORMATION_SCHEMA COLLATIONS Table ................................................. 3633
剩余5227页未读,继续阅读
2020-02-21 上传
2016-04-26 上传
2018-12-21 上传
2015-04-17 上传
2015-12-25 上传
2016-07-14 上传
2024-11-23 上传
2024-11-23 上传
huangqilong119
- 粉丝: 1
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 火炬连体网络在MNIST的2D嵌入实现示例
- Angular插件增强Application Insights JavaScript SDK功能
- 实时三维重建:InfiniTAM的ros驱动应用
- Spring与Mybatis整合的配置与实践
- Vozy前端技术测试深入体验与模板参考
- React应用实现语音转文字功能介绍
- PHPMailer-6.6.4: PHP邮件收发类库的详细介绍
- Felineboard:为猫主人设计的交互式仪表板
- PGRFileManager:功能强大的开源Ajax文件管理器
- Pytest-Html定制测试报告与源代码封装教程
- Angular开发与部署指南:从创建到测试
- BASIC-BINARY-IPC系统:进程间通信的非阻塞接口
- LTK3D: Common Lisp中的基础3D图形实现
- Timer-Counter-Lister:官方源代码及更新发布
- Galaxia REST API:面向地球问题的解决方案
- Node.js模块:随机动物实例教程与源码解析
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功