没有合适的资源?快使用搜索试试~ 我知道了~
首页MySQL 5.7 参考手册:功能、安装、管理和开发指南
MySQL 5.7 参考手册
MySQL 5.7 参考手册是 MySQL 5.7 数据库管理系统的官方文档,旨在为用户提供详细的使用指南和参考信息。本手册涵盖了 MySQL 5.7 的所有方面,包括安装、配置、管理、开发、性能优化等。
MySQL 5.7 的主要特性包括:
1. 高性能:MySQL 5.7 采用了多种技术来提高数据库的性能,例如多线程、缓存、索引等。
2. 安全性:MySQL 5.7 提供了多种安全机制,例如身份验证、访问控制、加密等,来保护数据库的安全。
3. 可扩展性:MySQL 5.7 支持多种存储引擎,例如 InnoDB、MyISAM 等,可以根据不同的应用场景选择合适的存储引擎。
MySQL 5.7 的主要组件包括:
1. 服务器(Server):负责处理数据库操作的核心组件。
2. 客户端(Client):提供了多种编程语言的 API,例如 Java、Python、C++ 等,用于与服务器交互。
3. 工具(Tools):提供了多种工具,例如 MySQL Workbench、MySQL Administrator 等,用于管理和维护数据库。
MySQL 5.7 的应用场景包括:
1. Web 应用程序:MySQL 5.7 可以作为 Web 应用程序的后端数据库,提供高性能和高可用性的数据存储服务。
2. 企业应用程序:MySQL 5.7 可以作为企业应用程序的后端数据库,提供高性能和高可用性的数据存储服务。
3. 数据仓库:MySQL 5.7 可以作为数据仓库的存储引擎,提供高性能和高可用性的数据存储服务。
MySQL 5.7 的优势包括:
1. 高性能:MySQL 5.7 采用了多种技术来提高数据库的性能,例如多线程、缓存、索引等。
2. 高可用性:MySQL 5.7 提供了多种高可用性机制,例如主从复制、负载均衡等,来确保数据库的可用性。
3. 灵活性:MySQL 5.7 支持多种存储引擎和多种编程语言的 API,提供了灵活的开发和部署选项。
MySQL 5.7 的限制包括:
1. licence 限制:MySQL 5.7 的使用需要遵守 Oracle 的授权协议,需要购买相应的 licence。
2. 版本限制:MySQL 5.7 的某些功能可能不适用于所有版本,需要查看相应的文档和 license 协议。
3.兼容性限制:MySQL 5.7 的某些功能可能不兼容某些操作系统或硬件平台,需要查看相应的文档和 license 协议。
MySQL 5.7 是一个功能强大、灵活性高的数据库管理系统,适用于各种应用场景,包括 Web 应用程序、企业应用程序和数据仓库等。但是,需要注意 MySQL 5.7 的限制和 Licence 协议,确保合法合规地使用 MySQL 5.7。
MySQL 5.7 Reference Manual
xvi
16.6.2 Using memcached ............................................................................................. 2182
16.6.3 Developing a memcached Application ................................................................. 2202
16.6.4 Getting memcached Statistics ............................................................................. 2228
16.6.5 memcached FAQ ............................................................................................... 2237
17 Replication .............................................................................................................................. 2241
17.1 Replication Using the Binary Log ................................................................................... 2242
17.1.1 Setting Up Binary Log Based Replication ............................................................ 2243
17.1.2 Replication Formats ........................................................................................... 2253
17.1.3 Replication with Global Transaction Identifiers ..................................................... 2260
17.1.4 Replication and Binary Logging Options and Variables ......................................... 2270
17.1.5 Common Replication Administration Tasks .......................................................... 2359
17.2 Replication Implementation ........................................................................................... 2362
17.2.1 Replication Implementation Details ...................................................................... 2362
17.2.2 Replication Relay and Status Logs ..................................................................... 2364
17.2.3 How Servers Evaluate Replication Filtering Rules ................................................ 2370
17.3 Replication Solutions .................................................................................................... 2376
17.3.1 Using Replication for Backups ............................................................................ 2377
17.3.2 Using Replication with Different Master and Slave Storage Engines ....................... 2380
17.3.3 Using Replication for Scale-Out .......................................................................... 2382
17.3.4 Replicating Different Databases to Different Slaves .............................................. 2383
17.3.5 Improving Replication Performance ..................................................................... 2384
17.3.6 Switching Masters During Failover ...................................................................... 2385
17.3.7 Setting Up Replication Using SSL ....................................................................... 2387
17.3.8 Semisynchronous Replication ............................................................................. 2389
17.3.9 Delayed Replication ........................................................................................... 2394
17.4 Replication Notes and Tips ........................................................................................... 2395
17.4.1 Replication Features and Issues ......................................................................... 2395
17.4.2 Replication Compatibility Between MySQL Versions ............................................. 2422
17.4.3 Upgrading a Replication Setup ........................................................................... 2423
17.4.4 Troubleshooting Replication ................................................................................ 2425
17.4.5 How to Report Replication Bugs or Problems ...................................................... 2426
18 Partitioning .............................................................................................................................. 2429
18.1 Overview of Partitioning in MySQL ................................................................................ 2431
18.2 Partitioning Types ......................................................................................................... 2433
18.2.1 RANGE Partitioning ........................................................................................... 2435
18.2.2 LIST Partitioning ................................................................................................ 2440
18.2.3 COLUMNS Partitioning ....................................................................................... 2442
18.2.4 HASH Partitioning .............................................................................................. 2450
18.2.5 KEY Partitioning ................................................................................................ 2453
18.2.6 Subpartitioning ................................................................................................... 2455
18.2.7 How MySQL Partitioning Handles NULL .............................................................. 2458
18.3 Partition Management ................................................................................................... 2462
18.3.1 Management of RANGE and LIST Partitions ....................................................... 2464
18.3.2 Management of HASH and KEY Partitions .......................................................... 2470
18.3.3 Exchanging Partitions and Subpartitions with Tables ............................................ 2471
18.3.4 Maintenance of Partitions ................................................................................... 2479
18.3.5 Obtaining Information About Partitions ................................................................ 2480
18.4 Partition Pruning ........................................................................................................... 2482
18.5 Partition Selection ......................................................................................................... 2486
18.6 Restrictions and Limitations on Partitioning .................................................................... 2492
18.6.1 Partitioning Keys, Primary Keys, and Unique Keys ............................................... 2499
18.6.2 Partitioning Limitations Relating to Storage Engines ............................................. 2502
18.6.3 Partitioning Limitations Relating to Functions ....................................................... 2503
18.6.4 Partitioning and Locking ..................................................................................... 2504
MySQL 5.7 Reference Manual
xvii
19 Stored Programs and Views .................................................................................................... 2507
19.1 Defining Stored Programs ............................................................................................. 2508
19.2 Using Stored Routines (Procedures and Functions) ........................................................ 2509
19.2.1 Stored Routine Syntax ....................................................................................... 2510
19.2.2 Stored Routines and MySQL Privileges ............................................................... 2510
19.2.3 Stored Routine Metadata .................................................................................... 2511
19.2.4 Stored Procedures, Functions, Triggers, and LAST_INSERT_ID() ......................... 2511
19.3 Using Triggers .............................................................................................................. 2511
19.3.1 Trigger Syntax and Examples ............................................................................. 2512
19.3.2 Trigger Metadata ............................................................................................... 2516
19.4 Using the Event Scheduler ............................................................................................ 2516
19.4.1 Event Scheduler Overview ................................................................................. 2517
19.4.2 Event Scheduler Configuration ............................................................................ 2518
19.4.3 Event Syntax ..................................................................................................... 2520
19.4.4 Event Metadata ................................................................................................. 2520
19.4.5 Event Scheduler Status ...................................................................................... 2521
19.4.6 The Event Scheduler and MySQL Privileges ........................................................ 2521
19.5 Using Views ................................................................................................................. 2524
19.5.1 View Syntax ...................................................................................................... 2525
19.5.2 View Processing Algorithms ............................................................................... 2525
19.5.3 Updatable and Insertable Views ......................................................................... 2527
19.5.4 View Metadata ................................................................................................... 2529
19.6 Access Control for Stored Programs and Views ............................................................. 2529
19.7 Binary Logging of Stored Programs ............................................................................... 2530
20 INFORMATION_SCHEMA Tables ............................................................................................ 2537
20.1 The INFORMATION_SCHEMA CHARACTER_SETS Table ............................................ 2540
20.2 The INFORMATION_SCHEMA COLLATIONS Table ...................................................... 2541
20.3 The INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY Table . 2541
20.4 The INFORMATION_SCHEMA COLUMNS Table ........................................................... 2541
20.5 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table ........................................ 2542
20.6 The INFORMATION_SCHEMA ENGINES Table ............................................................ 2543
20.7 The INFORMATION_SCHEMA EVENTS Table .............................................................. 2544
20.8 The INFORMATION_SCHEMA FILES Table .................................................................. 2547
20.9 The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables ......... 2548
20.10 The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES
Tables ................................................................................................................................. 2549
20.11 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table ..................................... 2549
20.12 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table ........................................... 2550
20.13 The INFORMATION_SCHEMA PARAMETERS Table ................................................... 2550
20.14 The INFORMATION_SCHEMA PARTITIONS Table ...................................................... 2551
20.15 The INFORMATION_SCHEMA PLUGINS Table ........................................................... 2554
20.16 The INFORMATION_SCHEMA PROCESSLIST Table .................................................. 2555
20.17 The INFORMATION_SCHEMA PROFILING Table ........................................................ 2556
20.18 The INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS Table .......................... 2557
20.19 The INFORMATION_SCHEMA ROUTINES Table ........................................................ 2558
20.20 The INFORMATION_SCHEMA SCHEMATA Table ....................................................... 2559
20.21 The INFORMATION_SCHEMA SCHEMA_PRIVILEGES Table ...................................... 2560
20.22 The INFORMATION_SCHEMA STATISTICS Table ...................................................... 2560
20.23 The INFORMATION_SCHEMA TABLES Table ............................................................. 2561
20.24 The INFORMATION_SCHEMA TABLESPACES Table .................................................. 2562
20.25 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table ...................................... 2563
20.26 The INFORMATION_SCHEMA TABLE_PRIVILEGES Table .......................................... 2563
20.27 The INFORMATION_SCHEMA TRIGGERS Table ........................................................ 2564
20.28 The INFORMATION_SCHEMA USER_PRIVILEGES Table ........................................... 2566
MySQL 5.7 Reference Manual
xviii
20.29 The INFORMATION_SCHEMA VIEWS Table ............................................................... 2566
20.30 INFORMATION_SCHEMA Tables for InnoDB ............................................................... 2568
20.30.1 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET
Tables ......................................................................................................................... 2568
20.30.2 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET Tables ................................................................. 2569
20.30.3 The INFORMATION_SCHEMA INNODB_CMPMEM and
INNODB_CMPMEM_RESET Tables .............................................................................. 2571
20.30.4 The INFORMATION_SCHEMA INNODB_TRX Table .......................................... 2572
20.30.5 The INFORMATION_SCHEMA INNODB_LOCKS Table ..................................... 2574
20.30.6 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table ........................... 2575
20.30.7 The INFORMATION_SCHEMA INNODB_SYS_TABLES Table ........................... 2576
20.30.8 The INFORMATION_SCHEMA INNODB_SYS_INDEXES Table ......................... 2578
20.30.9 The INFORMATION_SCHEMA INNODB_SYS_COLUMNS Table ....................... 2580
20.30.10 The INFORMATION_SCHEMA INNODB_SYS_FIELDS Table ........................... 2581
20.30.11 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN Table ....................... 2581
20.30.12 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN_COLS Table ............ 2582
20.30.13 The INFORMATION_SCHEMA INNODB_SYS_TABLESTATS View .................. 2583
20.30.14 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table .................... 2584
20.30.15 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table .............. 2585
20.30.16 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table ...................... 2588
20.30.17 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table .............. 2590
20.30.18 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table .......... 2592
20.30.19 The INFORMATION_SCHEMA INNODB_METRICS Table ................................ 2594
20.30.20 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table ............................ 2595
20.30.21 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table ..... 2596
20.30.22 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table .................. 2597
20.30.23 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table ................. 2599
20.30.24 The INFORMATION_SCHEMA INNODB_FT_DELETED Table ......................... 2600
20.30.25 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table ............. 2601
20.30.26 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table ............... 2602
20.31 Extensions to SHOW Statements ................................................................................ 2603
21 MySQL Performance Schema .................................................................................................. 2607
21.1 Performance Schema Quick Start .................................................................................. 2609
21.2 Performance Schema Configuration ............................................................................... 2615
21.2.1 Performance Schema Build Configuration ............................................................ 2615
21.2.2 Performance Schema Startup Configuration ........................................................ 2617
21.2.3 Performance Schema Runtime Configuration ....................................................... 2619
21.3 Performance Schema Queries ....................................................................................... 2638
21.4 Performance Schema Instrument Naming Conventions ................................................... 2638
21.5 Performance Schema Status Monitoring ........................................................................ 2641
21.6 Performance Schema Atom and Molecule Events ........................................................... 2645
21.7 Performance Schema Statement Digests ....................................................................... 2645
21.8 Performance Schema General Table Characteristics ...................................................... 2648
21.9 Performance Schema Table Descriptions ....................................................................... 2648
21.9.1 Performance Schema Table Index ...................................................................... 2648
21.9.2 Performance Schema Setup Tables .................................................................... 2651
21.9.3 Performance Schema Instance Tables ................................................................ 2656
21.9.4 Performance Schema Wait Event Tables ............................................................ 2661
21.9.5 Performance Schema Stage Event Tables .......................................................... 2665
21.9.6 Performance Schema Statement Event Tables .................................................... 2670
21.9.7 Performance Schema Transaction Tables ........................................................... 2680
21.9.8 Performance Schema Connection Tables ............................................................ 2687
21.9.9 Performance Schema Connection Attribute Tables ............................................... 2689
MySQL 5.7 Reference Manual
xix
21.9.10 Performance Schema Replication Tables .......................................................... 2690
21.9.11 Performance Schema Lock Tables .................................................................... 2700
21.9.12 Performance Schema Summary Tables ............................................................. 2702
21.9.13 Performance Schema Miscellaneous Tables ...................................................... 2721
21.10 Performance Schema Option and Variable Reference ................................................... 2728
21.11 Performance Schema Command Options ..................................................................... 2731
21.12 Performance Schema System Variables ....................................................................... 2733
21.13 Performance Schema Status Variables ........................................................................ 2747
21.14 Performance Schema and Plugins ............................................................................... 2750
21.15 Using the Performance Schema to Diagnose Problems ................................................. 2750
22 Connectors and APIs .............................................................................................................. 2753
22.1 MySQL Connector/ODBC .............................................................................................. 2757
22.2 MySQL Connector/Net .................................................................................................. 2757
22.3 MySQL Connector/J ..................................................................................................... 2757
22.4 MySQL Connector/C++ ................................................................................................. 2757
22.5 MySQL Connector/C ..................................................................................................... 2757
22.6 MySQL Connector/Python ............................................................................................. 2757
22.7 libmysqld, the Embedded MySQL Server Library ............................................................ 2758
22.7.1 Compiling Programs with libmysqld ..................................................................... 2758
22.7.2 Restrictions When Using the Embedded MySQL Server ....................................... 2759
22.7.3 Options with the Embedded Server ..................................................................... 2759
22.7.4 Embedded Server Examples .............................................................................. 2760
22.8 MySQL C API .............................................................................................................. 2763
22.8.1 MySQL C API Implementations .......................................................................... 2764
22.8.2 Simultaneous MySQL Server and Connector/C Installations .................................. 2765
22.8.3 Example C API Client Programs ......................................................................... 2766
22.8.4 Building and Running C API Client Programs ...................................................... 2766
22.8.5 C API Data Structures ....................................................................................... 2770
22.8.6 C API Function Overview ................................................................................... 2775
22.8.7 C API Function Descriptions ............................................................................... 2780
22.8.8 C API Prepared Statements ............................................................................... 2839
22.8.9 C API Prepared Statement Data Structures ......................................................... 2839
22.8.10 C API Prepared Statement Function Overview ................................................... 2846
22.8.11 C API Prepared Statement Function Descriptions ............................................... 2848
22.8.12 C API Threaded Function Descriptions .............................................................. 2872
22.8.13 C API Embedded Server Function Descriptions ................................................. 2874
22.8.14 C API Client Plugin Functions ........................................................................... 2874
22.8.15 Common Questions and Problems When Using the C API .................................. 2878
22.8.16 Controlling Automatic Reconnection Behavior .................................................... 2879
22.8.17 C API Support for Multiple Statement Execution ................................................. 2881
22.8.18 C API Prepared Statement Problems ................................................................ 2883
22.8.19 C API Prepared Statement Handling of Date and Time Values ............................ 2883
22.8.20 C API Support for Prepared CALL Statements ................................................... 2884
22.9 MySQL PHP API .......................................................................................................... 2889
22.10 MySQL Perl API ......................................................................................................... 2889
22.11 MySQL Python API ..................................................................................................... 2890
22.12 MySQL Ruby APIs ...................................................................................................... 2890
22.12.1 The MySQL/Ruby API ...................................................................................... 2890
22.12.2 The Ruby/MySQL API ...................................................................................... 2890
22.13 MySQL Tcl API .......................................................................................................... 2890
22.14 MySQL Eiffel Wrapper ................................................................................................ 2890
23 Extending MySQL ................................................................................................................... 2891
23.1 MySQL Internals ........................................................................................................... 2891
23.1.1 MySQL Threads ................................................................................................ 2891
MySQL 5.7 Reference Manual
xx
23.1.2 The MySQL Test Suite ....................................................................................... 2892
23.2 The MySQL Plugin API ................................................................................................. 2893
23.2.1 Plugin API Characteristics .................................................................................. 2893
23.2.2 Plugin API Components ..................................................................................... 2894
23.2.3 Types of Plugins ................................................................................................ 2895
23.2.4 Writing Plugins .................................................................................................. 2899
23.2.5 MySQL Services for Plugins ............................................................................... 2949
23.3 Adding New Functions to MySQL .................................................................................. 2951
23.3.1 Features of the User-Defined Function Interface .................................................. 2952
23.3.2 Adding a New User-Defined Function ................................................................. 2952
23.3.3 Adding a New Native Function ........................................................................... 2962
23.4 Debugging and Porting MySQL ..................................................................................... 2964
23.4.1 Debugging a MySQL Server ............................................................................... 2964
23.4.2 Debugging a MySQL Client ................................................................................ 2971
23.4.3 The DBUG Package .......................................................................................... 2971
24 MySQL Enterprise Edition ........................................................................................................ 2975
24.1 MySQL Enterprise Monitor ............................................................................................ 2975
24.2 MySQL Enterprise Backup ............................................................................................ 2976
24.3 MySQL Enterprise Security ........................................................................................... 2977
24.4 MySQL Enterprise Encryption ........................................................................................ 2977
24.5 MySQL Enterprise Audit ................................................................................................ 2977
24.6 MySQL Enterprise Thread Pool ..................................................................................... 2977
25 MySQL Workbench ................................................................................................................. 2979
A MySQL 5.7 Frequently Asked Questions .................................................................................... 2981
A.1 MySQL 5.7 FAQ: General .............................................................................................. 2981
A.2 MySQL 5.7 FAQ: Storage Engines .................................................................................. 2983
A.3 MySQL 5.7 FAQ: Server SQL Mode ............................................................................... 2984
A.4 MySQL 5.7 FAQ: Stored Procedures and Functions ......................................................... 2985
A.5 MySQL 5.7 FAQ: Triggers .............................................................................................. 2989
A.6 MySQL 5.7 FAQ: Views ................................................................................................. 2992
A.7 MySQL 5.7 FAQ: INFORMATION_SCHEMA ................................................................... 2993
A.8 MySQL 5.7 FAQ: Migration ............................................................................................ 2993
A.9 MySQL 5.7 FAQ: Security .............................................................................................. 2994
A.10 MySQL 5.7 FAQ: MySQL Cluster .................................................................................. 2995
A.11 MySQL 5.7 FAQ: MySQL Chinese, Japanese, and Korean Character Sets ....................... 2996
A.12 MySQL 5.7 FAQ: Connectors & APIs ............................................................................ 3009
A.13 MySQL 5.7 FAQ: Replication ........................................................................................ 3009
B Errors, Error Codes, and Common Problems ............................................................................. 3015
B.1 Sources of Error Information ........................................................................................... 3015
B.2 Types of Error Values .................................................................................................... 3016
B.3 Server Error Codes and Messages ................................................................................. 3016
B.4 Client Error Codes and Messages .................................................................................. 3095
B.5 Problems and Common Errors ........................................................................................ 3100
B.5.1 How to Determine What Is Causing a Problem ...................................................... 3100
B.5.2 Common Errors When Using MySQL Programs .................................................... 3101
B.5.3 Installation-Related Issues ................................................................................... 3115
B.5.4 Administration-Related Issues .............................................................................. 3115
B.5.5 Query-Related Issues .......................................................................................... 3123
B.5.6 Optimizer-Related Issues ..................................................................................... 3130
B.5.7 Table Definition-Related Issues ............................................................................ 3131
B.5.8 Known Issues in MySQL ..................................................................................... 3132
C MySQL Release Notes ............................................................................................................. 3137
D Restrictions and Limits .............................................................................................................. 3139
D.1 Restrictions on Stored Programs .................................................................................... 3139
剩余3611页未读,继续阅读
2023-01-28 上传
2022-04-09 上传
148 浏览量
135 浏览量
113 浏览量
2019-01-05 上传
2019-09-08 上传
135 浏览量
507 浏览量
sunofrise
- 粉丝: 0
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 高志东
- MP4 Player3.10.2.zip
- STM32F4系列标准库 V1.9版(最新版)
- BrownG_HodgesK_RokuClient
- AndroidKiller.zip已调试好编译模块
- leetcode耗时-codeReview:使用帕森问题练习代码的地方
- 课程设计 新生报到查询系统
- 大专自我鉴定总结
- Data-karyawan
- s-ance:C#POO
- BinaryCalculator:一个对二进制字符串进行运算的简单计算器 - MEN WMI @ AMU 项目
- 学士学位DIM-Symfony-And-PHP
- 可重复使用的计算机视觉工具:supervision
- PHPStripper-开源
- Hazinash
- 大数据应用领域盘点共3页.pdf.zip
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功