没有合适的资源?快使用搜索试试~ 我知道了~
首页Mysql 5.7最新参考手册
Mysql 5.7最新参考手册

最新版MYSQL 5.7参考手册,内容详细、全面,适用于初学者、学习、程序员开发等等
资源详情
资源评论
资源推荐

MySQL 5.7 Reference Manual

MySQL 5.7 Reference Manual
Abstract
This is the MySQL™ Reference Manual. It documents MySQL 5.7 through 5.7.5.
MySQL Cluster is currently not supported in MySQL 5.7. For information about MySQL Cluster, please see
MySQL Cluster NDB 7.3.
MySQL 5.7 features. This manual describes features that are not included in every edition of MySQL 5.7; such
features may not be included in the edition of MySQL 5.7 licensed to you. If you have any questions about the
features included in your edition of MySQL 5.7, refer to your MySQL 5.7 license agreement or contact your Oracle
sales representative.
For notes detailing the changes in each release, see the MySQL 5.7 Release Notes.
For legal information, see the Legal Notices.
Document generated on: 2014-08-02 (revision: 39500)
General Administrators MySQL
Enterprise
Developers &
Functionality
Connectors &
APIs
HA/Scalability
Tutorial Installation &
Upgrades
MySQL
Enterprise Edition
» MySQL
Workbench
Connectors and
APIs
» HA/Scalability
Guide
Server
Administration
MySQL Yum
Repository
MySQL
Enterprise
Monitor
Globalization Connector/J MySQL and
DRBD
SQL Syntax » MySQL Installer MySQL
Enterprise
Backup
Optimization Connector/ODBC memcached
Storage Engines » Security MySQL
Enterprise
Security
Functions and
Operators
Connector/Net MySQL and
Virtualization
Server Option /
Variable
Reference
» Startup /
Shutdown
MySQL
Enterprise Audit
Views and Stored
Programs
Connector/
Python
MySQL Proxy
» Release Notes » Backup and
Recovery
Overview
MySQL Thread
Pool
Partitioning PHP Replication
» MySQL Version
Reference
» MySQL Utilities Precision Math C API Semisynchronous
Replication
FAQs » Linux/Unix
Platform Guide
Information
Schema
Connector/C
» Windows
Platform Guide
Performance
Schema
Connector/C++
» Mac OS X
Platform Guide
Spatial
Extensions
» MySQL for
Excel
» Solaris Platform
Guide
Restrictions and
Limitations
» Building from
Source

iii
Table of Contents
Preface and Legal Notices ........................................................................................................ xxiii
1 General Information ................................................................................................................... 1
1.1 About This Manual .......................................................................................................... 2
1.2 Typographical and Syntax Conventions ............................................................................ 2
1.3 Overview of the MySQL Database Management System ................................................... 4
1.3.1 What is MySQL? .................................................................................................. 4
1.3.2 The Main Features of MySQL ............................................................................... 5
1.3.3 History of MySQL ................................................................................................. 8
1.4 What Is New in MySQL 5.7 ............................................................................................. 9
1.5 MySQL Development History ......................................................................................... 15
1.6 MySQL Information Sources .......................................................................................... 15
1.6.1 MySQL Mailing Lists ........................................................................................... 15
1.6.2 MySQL Community Support at the MySQL Forums .............................................. 18
1.6.3 MySQL Community Support on Internet Relay Chat (IRC) .................................... 18
1.6.4 MySQL Enterprise .............................................................................................. 18
1.7 How to Report Bugs or Problems .................................................................................. 19
1.8 MySQL Standards Compliance ...................................................................................... 23
1.8.1 MySQL Extensions to Standard SQL ................................................................... 24
1.8.2 MySQL Differences from Standard SQL .............................................................. 27
1.8.3 How MySQL Deals with Constraints .................................................................... 31
1.9 Credits .......................................................................................................................... 35
1.9.1 Contributors to MySQL ....................................................................................... 35
1.9.2 Documenters and translators .............................................................................. 39
1.9.3 Packages that support MySQL ............................................................................ 40
1.9.4 Tools that were used to create MySQL ................................................................ 41
1.9.5 Supporters of MySQL ......................................................................................... 41
2 Installing and Upgrading MySQL .............................................................................................. 43
2.1 General Installation Guidance ........................................................................................ 45
2.1.1 Operating Systems Supported by MySQL Community Server ................................ 45
2.1.2 Choosing Which MySQL Distribution to Install ...................................................... 45
2.1.3 How to Get MySQL ............................................................................................ 48
2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG ............................... 49
2.1.5 Installation Layouts ............................................................................................. 58
2.1.6 Compiler-Specific Build Characteristics ................................................................ 58
2.2 Installing MySQL on Unix/Linux Using Generic Binaries .................................................. 58
2.3 Installing MySQL on Microsoft Windows ......................................................................... 61
2.3.1 MySQL Installation Layout on Microsoft Windows ................................................. 62
2.3.2 Choosing An Installation Package ....................................................................... 63
2.3.3 Installing MySQL on Microsoft Windows Using MySQL Installer ............................ 63
2.3.4 MySQL Notifier for Microsoft Windows ................................................................. 80
2.3.5 Installing MySQL on Microsoft Windows Using a noinstall Zip Archive .............. 91
2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation .......................... 98
2.3.7 Upgrading MySQL on Windows ......................................................................... 100
2.3.8 Windows Postinstallation Procedures ................................................................. 101
2.4 Installing MySQL on Mac OS X ................................................................................... 103
2.4.1 General Notes on Installing MySQL on Mac OS X .............................................. 103
2.4.2 Installing MySQL on Mac OS X Using Native Packages ...................................... 105
2.4.3 Installing the MySQL Startup Item ..................................................................... 107
2.4.4 Installing and Using the MySQL Preference Pane .............................................. 110
2.4.5 Using the Bundled MySQL on Mac OS X Server ................................................ 113
2.5 Installing MySQL on Linux ........................................................................................... 113
2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository ............................. 114
2.5.2 Replacing a Third-Party Distribution of MySQL Using the MySQL Yum
Repository ................................................................................................................. 118
2.5.3 Installing MySQL on Linux Using the MySQL APT Repository ............................. 120

MySQL 5.7 Reference Manual
iv
2.5.4 Installing MySQL on Linux Using RPM Packages ............................................... 120
2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle .......................... 125
2.5.6 Installing MySQL on Linux from the Native Software Repositories ........................ 126
2.6 Installing MySQL on Solaris and OpenSolaris ............................................................... 130
2.6.1 Installing MySQL on Solaris Using a Solaris PKG ............................................... 131
2.6.2 Installing MySQL on OpenSolaris Using IPS ...................................................... 132
2.7 Installing MySQL on FreeBSD ..................................................................................... 133
2.8 Installing MySQL from Source ...................................................................................... 134
2.8.1 MySQL Layout for Source Installation ................................................................ 136
2.8.2 Installing MySQL Using a Standard Source Distribution ...................................... 136
2.8.3 Installing MySQL Using a Development Source Tree .......................................... 140
2.8.4 MySQL Source-Configuration Options ................................................................ 141
2.8.5 Dealing with Problems Compiling MySQL .......................................................... 155
2.8.6 MySQL Configuration and Third-Party Tools ...................................................... 157
2.9 Postinstallation Setup and Testing ............................................................................... 157
2.9.1 Postinstallation Procedures for Unix-like Systems ............................................... 157
2.9.2 Securing the Initial MySQL Accounts ................................................................. 168
2.10 Upgrading or Downgrading MySQL ............................................................................ 172
2.10.1 Upgrading MySQL .......................................................................................... 172
2.10.2 Downgrading MySQL ...................................................................................... 179
2.10.3 Checking Whether Tables or Indexes Must Be Rebuilt ...................................... 181
2.10.4 Rebuilding or Repairing Tables or Indexes ....................................................... 183
2.10.5 Copying MySQL Databases to Another Machine .............................................. 185
2.11 Environment Variables ............................................................................................... 186
2.12 Perl Installation Notes ................................................................................................ 187
2.12.1 Installing Perl on Unix ..................................................................................... 187
2.12.2 Installing ActiveState Perl on Windows ............................................................ 188
2.12.3 Problems Using the Perl DBI/DBD Interface ...................................................... 189
3 Tutorial .................................................................................................................................. 191
3.1 Connecting to and Disconnecting from the Server ......................................................... 191
3.2 Entering Queries ......................................................................................................... 192
3.3 Creating and Using a Database ................................................................................... 195
3.3.1 Creating and Selecting a Database ................................................................... 196
3.3.2 Creating a Table ............................................................................................... 197
3.3.3 Loading Data into a Table ................................................................................. 198
3.3.4 Retrieving Information from a Table ................................................................... 199
3.4 Getting Information About Databases and Tables .......................................................... 212
3.5 Using mysql in Batch Mode ........................................................................................ 213
3.6 Examples of Common Queries .................................................................................... 215
3.6.1 The Maximum Value for a Column .................................................................... 215
3.6.2 The Row Holding the Maximum of a Certain Column .......................................... 215
3.6.3 Maximum of Column per Group ........................................................................ 216
3.6.4 The Rows Holding the Group-wise Maximum of a Certain Column ....................... 216
3.6.5 Using User-Defined Variables ........................................................................... 217
3.6.6 Using Foreign Keys .......................................................................................... 217
3.6.7 Searching on Two Keys .................................................................................... 219
3.6.8 Calculating Visits Per Day ................................................................................. 219
3.6.9 Using AUTO_INCREMENT .................................................................................. 220
3.7 Using MySQL with Apache .......................................................................................... 222
4 MySQL Programs ................................................................................................................... 223
4.1 Overview of MySQL Programs ..................................................................................... 224
4.2 Using MySQL Programs .............................................................................................. 227
4.2.1 Invoking MySQL Programs ............................................................................... 227
4.2.2 Connecting to the MySQL Server ...................................................................... 228
4.2.3 Specifying Program Options .............................................................................. 231
4.2.4 Using Options on the Command Line ................................................................ 232
4.2.5 Program Option Modifiers ................................................................................. 234
4.2.6 Using Option Files ............................................................................................ 234

MySQL 5.7 Reference Manual
v
4.2.7 Command-Line Options that Affect Option-File Handling ..................................... 239
4.2.8 Using Options to Set Program Variables ............................................................ 240
4.2.9 Option Defaults, Options Expecting Values, and the = Sign ................................. 241
4.2.10 Setting Environment Variables ......................................................................... 244
4.3 MySQL Server and Server-Startup Programs ................................................................ 245
4.3.1 mysqld — The MySQL Server ......................................................................... 245
4.3.2 mysqld_safe — MySQL Server Startup Script ................................................. 245
4.3.3 mysql.server — MySQL Server Startup Script ............................................... 250
4.3.4 mysqld_multi — Manage Multiple MySQL Servers ......................................... 251
4.4 MySQL Installation-Related Programs .......................................................................... 255
4.4.1 comp_err — Compile MySQL Error Message File ............................................. 255
4.4.2 mysql_install_db — Initialize MySQL Data Directory .................................... 256
4.4.3 mysql_plugin — Configure MySQL Server Plugins ......................................... 261
4.4.4 mysql_secure_installation — Improve MySQL Installation Security ........... 263
4.4.5 mysql_tzinfo_to_sql — Load the Time Zone Tables ................................... 266
4.4.6 mysql_upgrade — Check and Upgrade MySQL Tables .................................... 266
4.5 MySQL Client Programs .............................................................................................. 271
4.5.1 mysql — The MySQL Command-Line Tool ....................................................... 271
4.5.2 mysqladmin — Client for Administering a MySQL Server .................................. 296
4.5.3 mysqlcheck — A Table Maintenance Program ................................................. 304
4.5.4 mysqldump — A Database Backup Program ..................................................... 311
4.5.5 mysqlimport — A Data Import Program .......................................................... 330
4.5.6 mysqlshow — Display Database, Table, and Column Information ....................... 336
4.5.7 mysqlslap — Load Emulation Client ............................................................... 341
4.6 MySQL Administrative and Utility Programs .................................................................. 349
4.6.1 innochecksum — Offline InnoDB File Checksum Utility .................................... 349
4.6.2 myisam_ftdump — Display Full-Text Index information ..................................... 354
4.6.3 myisamchk — MyISAM Table-Maintenance Utility ............................................. 355
4.6.4 myisamlog — Display MyISAM Log File Contents ............................................ 372
4.6.5 myisampack — Generate Compressed, Read-Only MyISAM Tables ................... 373
4.6.6 mysql_config_editor — MySQL Configuration Utility ................................... 378
4.6.7 mysqlbinlog — Utility for Processing Binary Log Files ..................................... 384
4.6.8 mysqldumpslow — Summarize Slow Query Log Files ....................................... 405
4.7 MySQL Program Development Utilities ......................................................................... 406
4.7.1 mysql_config — Display Options for Compiling Clients ................................... 407
4.7.2 my_print_defaults — Display Options from Option Files ............................... 408
4.7.3 resolve_stack_dump — Resolve Numeric Stack Trace Dump to Symbols ........ 409
4.8 Miscellaneous Programs .............................................................................................. 410
4.8.1 perror — Explain Error Codes ........................................................................ 410
4.8.2 replace — A String-Replacement Utility .......................................................... 411
4.8.3 resolveip — Resolve Host name to IP Address or Vice Versa ......................... 411
5 MySQL Server Administration ................................................................................................. 413
5.1 The MySQL Server ..................................................................................................... 413
5.1.1 Server Option and Variable Reference ............................................................... 414
5.1.2 Server Configuration Defaults ............................................................................ 447
5.1.3 Server Command Options ................................................................................. 447
5.1.4 Server System Variables ................................................................................... 480
5.1.5 Using System Variables .................................................................................... 592
5.1.6 Server Status Variables .................................................................................... 605
5.1.7 Server SQL Modes ........................................................................................... 632
5.1.8 Server Plugins .................................................................................................. 644
5.1.9 IPv6 Support .................................................................................................... 648
5.1.10 Server-Side Help ............................................................................................ 653
5.1.11 Server Response to Signals ............................................................................ 653
5.1.12 The Shutdown Process ................................................................................... 654
5.2 MySQL Server Logs .................................................................................................... 655
5.2.1 Selecting General Query and Slow Query Log Output Destinations ...................... 656
5.2.2 The Error Log ................................................................................................... 658
剩余3299页未读,继续阅读









安全验证
文档复制为VIP权益,开通VIP直接复制

评论17