没有合适的资源?快使用搜索试试~ 我知道了~
首页MySQL 5.7官方参考手册:5.7至5.7.11特性概述
MySQL 5.7官方参考手册:5.7至5.7.11特性概述
需积分: 10 2 下载量 180 浏览量
更新于2024-07-19
收藏 36.78MB PDF 举报
MySQL 5.7 Reference Manual 是一个全面的文档,详细介绍了 MySQL 5.7 版本的各个方面,从版本 5.7 到 5.7.11。这个手册主要关注 MySQL 的核心功能,它旨在帮助用户理解并操作 MySQL 数据库管理系统,包括但不限于数据存储、查询处理、性能优化和安全性设置。
该手册特别强调,MySQL Cluster 在 MySQL 5.7 版本中并未得到支持。对于那些希望了解 MySQL Cluster 功能的用户,手册推荐查阅 MySQL Cluster NDB 7.3 和 MySQL Cluster NDB 7.4 的相关信息,这意味着这些高级集群技术在 MySQL 5.7 的官方文档中暂不包含,可能需要单独研究或考虑升级到支持的版本。
MySQL 5.7 提供了多种新特性和改进,但值得注意的是,手册中的内容可能并不覆盖所有发行版中实际可用的功能。因此,如果你的 MySQL 5.7 版本存在特定功能疑问,建议参考你的许可协议或联系 Oracle 销售代表获取详细信息。
为了跟踪每个版本的具体变化,手册引用了 MySQL 5.7 Release Notes,其中包含了对新功能、修复和增强的详细介绍。此外,对于法律条款和使用许可,请参阅 Legal Notices 部分,确保遵循所有适用的法规。
手册还鼓励用户在遇到问题时利用 MySQL 论坛和邮件列表进行交流,与其他 MySQL 用户一起解决问题。对于更广泛的 MySQL 产品文档,包括不同语言的翻译版本和可下载的 HTML 和 PDF 格式,可以访问 MySQL Documentation Library,那里提供了丰富的资源和支持。
最后,本手册的最新更新日期为 2015 年 11 月 26 日,这意味着后续的 MySQL 5.7 发布可能会有新的内容和更新,建议定期检查官方文档以获取最新的支持和最佳实践。
![](https://csdnimg.cn/release/download_crawler_static/9995315/bg10.jpg)
MySQL 5.7 Reference Manual
xvi
15.8.3 FEDERATED Storage Engine Notes and Tips ..................................................... 2457
15.8.4 FEDERATED Storage Engine Resources ............................................................ 2458
15.9 The EXAMPLE Storage Engine ..................................................................................... 2458
15.10 Other Storage Engines ................................................................................................ 2459
15.11 Overview of MySQL Storage Engine Architecture ......................................................... 2459
15.11.1 Pluggable Storage Engine Architecture .............................................................. 2459
15.11.2 The Common Database Server Layer ............................................................... 2460
16 High Availability and Scalability ................................................................................................ 2463
16.1 Oracle VM Template for MySQL Enterprise Edition ......................................................... 2466
16.2 Overview of MySQL with DRBD/Pacemaker/Corosync/Oracle Linux ................................. 2466
16.3 Overview of MySQL with Windows Failover Clustering .................................................... 2469
16.4 Using MySQL within an Amazon EC2 Instance .............................................................. 2471
16.4.1 Setting Up MySQL on an EC2 AMI ..................................................................... 2472
16.4.2 EC2 Instance Limitations .................................................................................... 2473
16.4.3 Deploying a MySQL Database Using EC2 ........................................................... 2473
16.5 Using ZFS Replication .................................................................................................. 2476
16.5.1 Using ZFS for File System Replication ................................................................ 2478
16.5.2 Configuring MySQL for ZFS Replication .............................................................. 2479
16.5.3 Handling MySQL Recovery with ZFS .................................................................. 2479
16.6 Using MySQL with memcached ..................................................................................... 2480
16.6.1 Installing memcached ......................................................................................... 2481
16.6.2 Using memcached ............................................................................................. 2482
16.6.3 Developing a memcached Application ................................................................. 2502
16.6.4 Getting memcached Statistics ............................................................................. 2528
16.6.5 memcached FAQ ............................................................................................... 2537
17 Replication .............................................................................................................................. 2541
17.1 Configuring Replication ................................................................................................. 2543
17.1.1 Binary Log Replication Configuration Overview .................................................... 2543
17.1.2 Setting Up Binary Log Based Replication ............................................................ 2544
17.1.3 Replication with Global Transaction Identifiers ..................................................... 2553
17.1.4 MySQL Multi-Source Replication ......................................................................... 2563
17.1.5 Changing Replication Modes on Online Servers .................................................. 2567
17.1.6 Replication and Binary Logging Options and Variables ......................................... 2573
17.1.7 Common Replication Administration Tasks .......................................................... 2664
17.2 Replication Implementation ........................................................................................... 2667
17.2.1 Replication Formats ........................................................................................... 2668
17.2.2 Replication Implementation Details ...................................................................... 2675
17.2.3 Replication Channels ......................................................................................... 2677
17.2.4 Replication Relay and Status Logs ..................................................................... 2680
17.2.5 How Servers Evaluate Replication Filtering Rules ................................................ 2686
17.3 Replication Solutions .................................................................................................... 2692
17.3.1 Using Replication for Backups ............................................................................ 2693
17.3.2 Using Replication with Different Master and Slave Storage Engines ....................... 2696
17.3.3 Using Replication for Scale-Out .......................................................................... 2698
17.3.4 Replicating Different Databases to Different Slaves .............................................. 2699
17.3.5 Improving Replication Performance ..................................................................... 2700
17.3.6 Switching Masters During Failover ...................................................................... 2701
17.3.7 Setting Up Replication Using SSL ....................................................................... 2703
17.3.8 Semisynchronous Replication ............................................................................. 2705
17.3.9 Delayed Replication ........................................................................................... 2710
17.4 Replication Notes and Tips ........................................................................................... 2711
17.4.1 Replication Features and Issues ......................................................................... 2711
17.4.2 Replication Compatibility Between MySQL Versions ............................................. 2738
17.4.3 Upgrading a Replication Setup ........................................................................... 2739
![](https://csdnimg.cn/release/download_crawler_static/9995315/bg11.jpg)
MySQL 5.7 Reference Manual
xvii
17.4.4 Troubleshooting Replication ................................................................................ 2740
17.4.5 How to Report Replication Bugs or Problems ...................................................... 2742
18 Partitioning .............................................................................................................................. 2745
18.1 Overview of Partitioning in MySQL ................................................................................ 2747
18.2 Partitioning Types ......................................................................................................... 2750
18.2.1 RANGE Partitioning ........................................................................................... 2751
18.2.2 LIST Partitioning ................................................................................................ 2756
18.2.3 COLUMNS Partitioning ....................................................................................... 2758
18.2.4 HASH Partitioning .............................................................................................. 2766
18.2.5 KEY Partitioning ................................................................................................ 2769
18.2.6 Subpartitioning ................................................................................................... 2771
18.2.7 How MySQL Partitioning Handles NULL .............................................................. 2774
18.3 Partition Management ................................................................................................... 2779
18.3.1 Management of RANGE and LIST Partitions ....................................................... 2780
18.3.2 Management of HASH and KEY Partitions .......................................................... 2786
18.3.3 Exchanging Partitions and Subpartitions with Tables ............................................ 2787
18.3.4 Maintenance of Partitions ................................................................................... 2795
18.3.5 Obtaining Information About Partitions ................................................................ 2796
18.4 Partition Pruning ........................................................................................................... 2798
18.5 Partition Selection ......................................................................................................... 2802
18.6 Restrictions and Limitations on Partitioning .................................................................... 2808
18.6.1 Partitioning Keys, Primary Keys, and Unique Keys ............................................... 2814
18.6.2 Partitioning Limitations Relating to Storage Engines ............................................. 2818
18.6.3 Partitioning Limitations Relating to Functions ....................................................... 2819
18.6.4 Partitioning and Locking ..................................................................................... 2819
19 Stored Programs and Views .................................................................................................... 2821
19.1 Defining Stored Programs ............................................................................................. 2822
19.2 Using Stored Routines (Procedures and Functions) ........................................................ 2823
19.2.1 Stored Routine Syntax ....................................................................................... 2824
19.2.2 Stored Routines and MySQL Privileges ............................................................... 2824
19.2.3 Stored Routine Metadata .................................................................................... 2825
19.2.4 Stored Procedures, Functions, Triggers, and LAST_INSERT_ID() ......................... 2825
19.3 Using Triggers .............................................................................................................. 2825
19.3.1 Trigger Syntax and Examples ............................................................................. 2826
19.3.2 Trigger Metadata ............................................................................................... 2830
19.4 Using the Event Scheduler ............................................................................................ 2830
19.4.1 Event Scheduler Overview ................................................................................. 2831
19.4.2 Event Scheduler Configuration ............................................................................ 2832
19.4.3 Event Syntax ..................................................................................................... 2834
19.4.4 Event Metadata ................................................................................................. 2834
19.4.5 Event Scheduler Status ...................................................................................... 2835
19.4.6 The Event Scheduler and MySQL Privileges ........................................................ 2836
19.5 Using Views ................................................................................................................. 2838
19.5.1 View Syntax ...................................................................................................... 2839
19.5.2 View Processing Algorithms ............................................................................... 2839
19.5.3 Updatable and Insertable Views ......................................................................... 2841
19.5.4 The View WITH CHECK OPTION Clause ............................................................ 2843
19.5.5 View Metadata ................................................................................................... 2845
19.6 Access Control for Stored Programs and Views ............................................................. 2845
19.7 Binary Logging of Stored Programs ............................................................................... 2846
20 INFORMATION_SCHEMA Tables ............................................................................................ 2853
20.1 The INFORMATION_SCHEMA CHARACTER_SETS Table ............................................ 2856
20.2 The INFORMATION_SCHEMA COLLATIONS Table ...................................................... 2857
20.3 The INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY Table . 2857
![](https://csdnimg.cn/release/download_crawler_static/9995315/bg12.jpg)
MySQL 5.7 Reference Manual
xviii
20.4 The INFORMATION_SCHEMA COLUMNS Table ........................................................... 2857
20.5 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table ........................................ 2859
20.6 The INFORMATION_SCHEMA ENGINES Table ............................................................ 2859
20.7 The INFORMATION_SCHEMA EVENTS Table .............................................................. 2860
20.8 The INFORMATION_SCHEMA FILES Table .................................................................. 2863
20.9 The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables ......... 2866
20.10 The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES
Tables ................................................................................................................................. 2866
20.11 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table ..................................... 2867
20.12 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table ........................................... 2868
20.13 The INFORMATION_SCHEMA PARAMETERS Table ................................................... 2868
20.14 The INFORMATION_SCHEMA PARTITIONS Table ...................................................... 2869
20.15 The INFORMATION_SCHEMA PLUGINS Table ........................................................... 2872
20.16 The INFORMATION_SCHEMA PROCESSLIST Table .................................................. 2873
20.17 The INFORMATION_SCHEMA PROFILING Table ........................................................ 2874
20.18 The INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS Table .......................... 2875
20.19 The INFORMATION_SCHEMA ROUTINES Table ........................................................ 2876
20.20 The INFORMATION_SCHEMA SCHEMATA Table ....................................................... 2877
20.21 The INFORMATION_SCHEMA SCHEMA_PRIVILEGES Table ...................................... 2877
20.22 The INFORMATION_SCHEMA STATISTICS Table ...................................................... 2878
20.23 The INFORMATION_SCHEMA TABLES Table ............................................................. 2879
20.24 The INFORMATION_SCHEMA TABLESPACES Table .................................................. 2880
20.25 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table ...................................... 2881
20.26 The INFORMATION_SCHEMA TABLE_PRIVILEGES Table .......................................... 2881
20.27 The INFORMATION_SCHEMA TRIGGERS Table ........................................................ 2882
20.28 The INFORMATION_SCHEMA USER_PRIVILEGES Table ........................................... 2884
20.29 The INFORMATION_SCHEMA VIEWS Table ............................................................... 2884
20.30 INFORMATION_SCHEMA Tables for InnoDB ............................................................... 2885
20.30.1 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET
Tables ......................................................................................................................... 2886
20.30.2 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET Tables ................................................................. 2887
20.30.3 The INFORMATION_SCHEMA INNODB_CMPMEM and
INNODB_CMPMEM_RESET Tables .............................................................................. 2888
20.30.4 The INFORMATION_SCHEMA INNODB_TRX Table .......................................... 2889
20.30.5 The INFORMATION_SCHEMA INNODB_LOCKS Table ..................................... 2892
20.30.6 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table ........................... 2893
20.30.7 The INFORMATION_SCHEMA INNODB_SYS_TABLES Table ........................... 2894
20.30.8 The INFORMATION_SCHEMA INNODB_SYS_INDEXES Table ......................... 2896
20.30.9 The INFORMATION_SCHEMA INNODB_SYS_COLUMNS Table ....................... 2898
20.30.10 The INFORMATION_SCHEMA INNODB_SYS_FIELDS Table ........................... 2899
20.30.11 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN Table ....................... 2899
20.30.12 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN_COLS Table ............ 2900
20.30.13 The INFORMATION_SCHEMA INNODB_SYS_TABLESTATS View .................. 2901
20.30.14 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table .................... 2902
20.30.15 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table .............. 2903
20.30.16 The INFORMATION_SCHEMA INNODB_SYS_VIRTUAL Table ........................ 2907
20.30.17 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table ...................... 2908
20.30.18 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table .............. 2910
20.30.19 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table .......... 2912
20.30.20 The INFORMATION_SCHEMA INNODB_METRICS Table ................................ 2914
20.30.21 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table ............................ 2916
20.30.22 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table ..... 2917
20.30.23 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table .................. 2918
![](https://csdnimg.cn/release/download_crawler_static/9995315/bg13.jpg)
MySQL 5.7 Reference Manual
xix
20.30.24 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table ................. 2919
20.30.25 The INFORMATION_SCHEMA INNODB_FT_DELETED Table ......................... 2921
20.30.26 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table ............. 2921
20.30.27 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table ............... 2922
20.31 Extensions to SHOW Statements ................................................................................ 2923
21 MySQL Performance Schema .................................................................................................. 2927
21.1 Performance Schema Quick Start .................................................................................. 2929
21.2 Performance Schema Configuration ............................................................................... 2935
21.2.1 Performance Schema Build Configuration ............................................................ 2935
21.2.2 Performance Schema Startup Configuration ........................................................ 2937
21.2.3 Performance Schema Runtime Configuration ....................................................... 2939
21.3 Performance Schema Queries ....................................................................................... 2960
21.4 Performance Schema Instrument Naming Conventions ................................................... 2960
21.5 Performance Schema Status Monitoring ........................................................................ 2963
21.6 Performance Schema Atom and Molecule Events ........................................................... 2966
21.7 Performance Schema Statement Digests ....................................................................... 2967
21.8 Performance Schema General Table Characteristics ...................................................... 2970
21.9 Performance Schema Table Descriptions ....................................................................... 2970
21.9.1 Performance Schema Table Index ...................................................................... 2970
21.9.2 Performance Schema Setup Tables .................................................................... 2973
21.9.3 Performance Schema Instance Tables ................................................................ 2978
21.9.4 Performance Schema Wait Event Tables ............................................................ 2983
21.9.5 Performance Schema Stage Event Tables .......................................................... 2988
21.9.6 Performance Schema Statement Event Tables .................................................... 2993
21.9.7 Performance Schema Transaction Tables ........................................................... 3003
21.9.8 Performance Schema Connection Tables ............................................................ 3010
21.9.9 Performance Schema Connection Attribute Tables ............................................... 3012
21.9.10 Performance Schema Replication Tables .......................................................... 3014
21.9.11 Performance Schema Lock Tables .................................................................... 3026
21.9.12 Performance Schema System Variable Tables ................................................... 3028
21.9.13 Performance Schema Status Variable Tables .................................................... 3029
21.9.14 Performance Schema Summary Tables ............................................................. 3031
21.9.15 Performance Schema Miscellaneous Tables ...................................................... 3051
21.10 Performance Schema Option and Variable Reference ................................................... 3059
21.11 Performance Schema Command Options ..................................................................... 3063
21.12 Performance Schema System Variables ....................................................................... 3064
21.13 Performance Schema Status Variables ........................................................................ 3081
21.14 The Performance Schema Memory-Allocation Model .................................................... 3084
21.15 Performance Schema and Plugins ............................................................................... 3085
21.16 Using the Performance Schema to Diagnose Problems ................................................. 3085
21.16.1 Query Profiling Using Performance Schema ...................................................... 3087
21.17 Migrating to Performance Schema System and Status Variable Tables ........................... 3088
22 MySQL sys Schema ................................................................................................................ 3091
22.1 Prerequisites for Using the sys Schema ......................................................................... 3091
22.2 Using the sys Schema .................................................................................................. 3092
22.3 sys Schema Progress Reporting ................................................................................... 3094
22.4 sys Schema Object Reference ...................................................................................... 3094
22.4.1 sys Schema Object Index ................................................................................... 3094
22.4.2 sys Schema Tables and Triggers ........................................................................ 3099
22.4.3 sys Schema Views ............................................................................................ 3101
22.4.4 sys Schema Stored Procedures .......................................................................... 3143
22.4.5 sys Schema Stored Functions ............................................................................ 3163
23 Connectors and APIs .............................................................................................................. 3177
23.1 MySQL Connector/ODBC .............................................................................................. 3181
![](https://csdnimg.cn/release/download_crawler_static/9995315/bg14.jpg)
MySQL 5.7 Reference Manual
xx
23.2 MySQL Connector/Net .................................................................................................. 3181
23.3 MySQL Connector/J ..................................................................................................... 3181
23.4 MySQL Connector/C++ ................................................................................................. 3181
23.5 MySQL Connector/C ..................................................................................................... 3181
23.6 MySQL Connector/Python ............................................................................................. 3181
23.7 libmysqld, the Embedded MySQL Server Library ............................................................ 3182
23.7.1 Compiling Programs with libmysqld ..................................................................... 3182
23.7.2 Restrictions When Using the Embedded MySQL Server ....................................... 3183
23.7.3 Options with the Embedded Server ..................................................................... 3183
23.7.4 Embedded Server Examples .............................................................................. 3184
23.8 MySQL C API .............................................................................................................. 3187
23.8.1 MySQL C API Implementations .......................................................................... 3188
23.8.2 Simultaneous MySQL Server and Connector/C Installations .................................. 3189
23.8.3 Example C API Client Programs ......................................................................... 3190
23.8.4 Building and Running C API Client Programs ...................................................... 3190
23.8.5 C API Data Structures ....................................................................................... 3196
23.8.6 C API Function Overview ................................................................................... 3201
23.8.7 C API Function Descriptions ............................................................................... 3206
23.8.8 C API Prepared Statements ............................................................................... 3267
23.8.9 C API Prepared Statement Data Structures ......................................................... 3267
23.8.10 C API Prepared Statement Function Overview ................................................... 3274
23.8.11 C API Prepared Statement Function Descriptions ............................................... 3276
23.8.12 C API Threaded Function Descriptions .............................................................. 3300
23.8.13 C API Embedded Server Function Descriptions ................................................. 3302
23.8.14 C API Client Plugin Functions ........................................................................... 3302
23.8.15 Common Questions and Problems When Using the C API .................................. 3306
23.8.16 Controlling Automatic Reconnection Behavior .................................................... 3307
23.8.17 C API Support for Multiple Statement Execution ................................................. 3309
23.8.18 C API Prepared Statement Problems ................................................................ 3311
23.8.19 C API Prepared Statement Handling of Date and Time Values ............................ 3311
23.8.20 C API Support for Prepared CALL Statements ................................................... 3312
23.9 MySQL PHP API .......................................................................................................... 3317
23.10 MySQL Perl API ......................................................................................................... 3317
23.11 MySQL Python API ..................................................................................................... 3318
23.12 MySQL Ruby APIs ...................................................................................................... 3318
23.12.1 The MySQL/Ruby API ...................................................................................... 3318
23.12.2 The Ruby/MySQL API ...................................................................................... 3318
23.13 MySQL Tcl API .......................................................................................................... 3318
23.14 MySQL Eiffel Wrapper ................................................................................................ 3318
24 Extending MySQL ................................................................................................................... 3319
24.1 MySQL Internals ........................................................................................................... 3319
24.1.1 MySQL Threads ................................................................................................ 3319
24.1.2 The MySQL Test Suite ....................................................................................... 3320
24.2 The MySQL Plugin API ................................................................................................. 3321
24.2.1 Plugin API Characteristics .................................................................................. 3321
24.2.2 Plugin API Components ..................................................................................... 3322
24.2.3 Types of Plugins ................................................................................................ 3323
24.2.4 Writing Plugins .................................................................................................. 3328
24.3 MySQL Services for Plugins .......................................................................................... 3383
24.3.1 The Locking Service .......................................................................................... 3385
24.4 Adding New Functions to MySQL .................................................................................. 3390
24.4.1 Features of the User-Defined Function Interface .................................................. 3391
24.4.2 Adding a New User-Defined Function ................................................................. 3391
24.4.3 Adding a New Native Function ........................................................................... 3401
剩余4087页未读,继续阅读
2020-04-24 上传
2018-04-28 上传
2023-04-15 上传
2023-06-06 上传
2023-07-28 上传
2023-04-29 上传
2023-06-28 上传
2023-03-16 上传
![](https://profile-avatar.csdnimg.cn/e713fc80ff684275b323141a6e1ee8d2_lb065x.jpg!1)
LB065X
- 粉丝: 10
- 资源: 3
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 解决本地连接丢失无法上网的问题
- BIOS报警声音解析:故障原因与解决方法
- 广义均值移动跟踪算法在视频目标跟踪中的应用研究
- C++Builder快捷键大全:高效编程的秘密武器
- 网页制作入门:常用代码详解
- TX2440A开发板网络远程监控系统移植教程:易搭建与通用解决方案
- WebLogic10虚拟内存配置详解与优化技巧
- C#网络编程深度解析:Socket基础与应用
- 掌握Struts1:Java MVC轻量级框架详解
- 20个必备CSS代码段提升Web开发效率
- CSS样式大全:字体、文本、列表样式详解
- Proteus元件库大全:从基础到高级组件
- 74HC08芯片:高速CMOS四输入与门详细资料
- C#获取当前路径的多种方法详解
- 修复MySQL乱码问题:设置字符集为GB2312
- C语言的诞生与演进:从汇编到系统编程的革命
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)