Abstract
This is the MySQL™ Reference Manual. It documents MySQL
5.5 through 5.5.27, as well as MySQL
Cluster releases based on version 7.2 of
NDBCLUSTER through
5.5.25-ndb-7.2.7.
MySQL 5.5 features. This manual describes features that are not included in every edition of MySQL 5.5; such features may not be included in the edition of MySQL 5.5 licensed to you. If you have any questions about the features included in your edition of MySQL 5.5, refer to your MySQL 5.5 license agreement or contact your Oracle sales representative.
Document generated on: 2012-06-23 (revision: 30913)
For legal information, see the Legal Notice.
Table of Contents
noinstall Zip ArchiveAUTO_INCREMENTInnoDB TablesInnoDB TablesInnoDB Transaction ManagementInnoDB LoggingInnoDB TablesInnoDB QueriesInnoDB DDL OperationsInnoDB Disk I/OInnoDB Configuration VariablesInnoDB for Systems with Many TablesMyISAM TablesMEMORY TablesIS NULL OptimizationLEFT JOIN and RIGHT JOIN
OptimizationORDER BY OptimizationGROUP BY OptimizationDISTINCT OptimizationEXISTS StrategyINTEGER,
INT, SMALLINT,
TINYINT, MEDIUMINT,
BIGINTDECIMAL,
NUMERICFLOAT,
DOUBLEBITGROUP BY ClausesALTER DATABASE SyntaxALTER EVENT SyntaxALTER LOGFILE GROUP SyntaxALTER FUNCTION SyntaxALTER PROCEDURE SyntaxALTER SERVER SyntaxALTER TABLE SyntaxALTER TABLESPACE SyntaxALTER VIEW SyntaxCREATE DATABASE SyntaxCREATE EVENT SyntaxCREATE FUNCTION SyntaxCREATE INDEX SyntaxCREATE LOGFILE GROUP SyntaxCREATE PROCEDURE and
CREATE FUNCTION SyntaxCREATE SERVER SyntaxCREATE TABLE SyntaxCREATE TABLESPACE SyntaxCREATE TRIGGER SyntaxCREATE VIEW SyntaxDROP DATABASE SyntaxDROP EVENT SyntaxDROP FUNCTION SyntaxDROP INDEX SyntaxDROP LOGFILE GROUP SyntaxDROP PROCEDURE and
DROP FUNCTION SyntaxDROP SERVER SyntaxDROP TABLE SyntaxDROP TABLESPACE SyntaxDROP TRIGGER SyntaxDROP VIEW SyntaxRENAME TABLE SyntaxTRUNCATE TABLE SyntaxInnoDB Storage EngineInnoDBInnoDB Startup Options and System VariablesInnoDB TablesInnoDB Data and Log
FilesInnoDB DatabaseInnoDB Database to Another MachineInnoDB Transaction Model and LockingInnoDB Multi-VersioningInnoDB Table and Index StructuresInnoDB Disk I/O and File Space ManagementInnoDB Error HandlingInnoDB Performance Tuning and TroubleshootingInnoDB TablesINFORMATION_SCHEMA tablesMyISAM Storage EngineMEMORY Storage EngineCSV Storage EngineARCHIVE Storage EngineBLACKHOLE Storage EngineMERGE Storage EngineFEDERATED Storage EngineEXAMPLE Storage EngineInnoDB Compared with MySQL Clusterndbinfo MySQL Cluster Information DatabaseINFORMATION_SCHEMA TablesINFORMATION_SCHEMA CHARACTER_SETS TableINFORMATION_SCHEMA COLLATIONS TableINFORMATION_SCHEMA
COLLATION_CHARACTER_SET_APPLICABILITY TableINFORMATION_SCHEMA COLUMNS TableINFORMATION_SCHEMA COLUMN_PRIVILEGES TableINFORMATION_SCHEMA ENGINES TableINFORMATION_SCHEMA EVENTS TableINFORMATION_SCHEMA FILES TableINFORMATION_SCHEMA GLOBAL_STATUS and
SESSION_STATUS
TablesINFORMATION_SCHEMA GLOBAL_VARIABLES and
SESSION_VARIABLES
TablesINFORMATION_SCHEMA KEY_COLUMN_USAGE TableINFORMATION_SCHEMA PARAMETERS TableINFORMATION_SCHEMA PARTITIONS TableINFORMATION_SCHEMA PLUGINS TableINFORMATION_SCHEMA PROCESSLIST TableINFORMATION_SCHEMA PROFILING TableINFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS TableINFORMATION_SCHEMA ROUTINES TableINFORMATION_SCHEMA SCHEMATA TableINFORMATION_SCHEMA SCHEMA_PRIVILEGES TableINFORMATION_SCHEMA STATISTICS TableINFORMATION_SCHEMA TABLES TableINFORMATION_SCHEMA TABLESPACES TableINFORMATION_SCHEMA TABLE_CONSTRAINTS TableINFORMATION_SCHEMA TABLE_PRIVILEGES TableINFORMATION_SCHEMA TRIGGERS TableINFORMATION_SCHEMA USER_PRIVILEGES TableINFORMATION_SCHEMA VIEWS TableINFORMATION_SCHEMA Tables for
InnoDBINFORMATION_SCHEMA TablesSHOW StatementsCALL
StatementsMysql)Mysqli)MySQL (PDO))Mysqlnd)mysqlnd_ms)mysqlnd_qc)mysqlnd_uh)mysql and mysqli in
PHPdtoa.c Licenselibedit) LicenseFindGTest.cmake Licensegetarg Licenselib_sql.cc Licenselibevent Licenselibintl LicenseLPeg Library LicenseLuaFileSystem Library Licensezlib LicenseINFORMATION_SCHEMAINFORMATION_SCHEMA IndexList of Figures
FEDERATED Table StructureList of Tables
mysqld_safe Optionsmysql Optionsmysqladmin Optionsmysqlcheck Optionsmysqldump Optionsmysqlimport Optionsmysqlshow Optionsmysqlslap Optionsmyisamchk Optionsmysqlaccess Optionsmysqlbinlog Optionsmysqldumpslow Optionsmysqlhotcopy OptionsGRANT and
REVOKEuser and db Table Columnstables_priv and columns_priv Table
Columnsprocs_priv Table ColumnsEXPLAIN Output ColumnsGROUP BY)
FunctionsGRANT and
REVOKEInnoDB Storage Engine
FeaturesInnoDB Option/Variable
ReferenceCREATE TABLE and
ALTER TABLE optionsCREATE/ALTER TABLE Warnings and Errors when InnoDB
Strict Mode is OFFinnodb_thread_concurrencyMyISAM Storage Engine
FeaturesMyISAM Option/Variable
ReferenceMEMORY Storage Engine
FeaturesARCHIVE Storage Engine
FeaturesINNODB_CMP and
INNODB_CMP_RESETINNODB_TRX ColumnsINNODB_LOCKS ColumnsINNODB_LOCK_WAITS ColumnsWAIT_TYPE ValuesList of Examples
DriverManagerSELECT queryConnection.prepareCall()CallableStatement input
parametersAUTO_INCREMENT column values
using Statement.getGeneratedKeys()AUTO_INCREMENT column values
using SELECT LAST_INSERT_ID()AUTO_INCREMENT column values
in Updatable ResultSetsmysql_affected_rows
examplemysql_affected_rows
example using transactionsmysql_client_encoding
examplemysql_close
examplemysql_connect
examplemysql_connect
example using hostname:port syntaxmysql_connect
example using ":/path/to/socket" syntaxmysql_create_db
alternative examplemysql_data_seek
examplemysql_db_name
examplemysql_db_query
alternative examplemysql_drop_db
alternative examplemysql_errno
examplemysql_error
examplemysql_escape_string
examplemysql_fetch_array
with
MYSQL_NUMmysql_fetch_array
with
MYSQL_ASSOCmysql_fetch_array
with
MYSQL_BOTHmysql_fetch_assoc
examplemysql_fetch_field
examplemysql_fetch_lengths
examplemysql_fetch_object
examplemysql_fetch_object
examplemysql_fetch_rowmysql_field_flags
examplemysql_field_len
examplemysql_field_name
examplemysql_field_table
examplemysql_field_type
examplemysql_free_result
examplemysql_get_client_info
examplemysql_get_host_info
examplemysql_get_proto_info
examplemysql_get_server_info
examplemysql_insert_id
examplemysql_list_dbs
examplemysql_list_fieldsmysql_list_processes
examplemysql_list_tables
alternative examplemysql_num_fields
examplemysql_num_rows
examplemysql_ping
examplemysql_real_escape_string
examplemysql_result
examplemysql_select_db
examplemysql_stat
examplemysql_stat
examplemysql_tablename
examplemysql_thread_id
example$mysqli->affected_rows examplemysqli::autocommit
examplemysqli::change_user
examplemysqli::character_set_name
examplemysqli::commit
example$mysqli->connect_errno example$mysqli->connect_error examplemysqli::__construct
example$mysqli->errno example$mysqli->error_list example$mysqli->error example$mysqli->field_count examplemysqli::get_charset
examplemysqli_get_client_stats
examplemysqli_get_connection_stats
example$mysqli->host_info example$mysqli->protocol_version example$mysqli->server_info example$mysqli->server_version example$mysqli->info example$mysqli->insert_id examplemysqli::kill
examplemysqli::multi_query
examplemysqli::ping
examplemysqli_poll
examplemysqli::prepare
examplemysqli::query
examplemysqli::real_connect
examplemysqli::real_escape_string
examplemysqli::rollback
examplemysqli::select_db
examplemysqli::set_charset
examplemysqli::set_local_infile_handler
example$mysqli->sqlstate examplemysqli::stat
example$mysqli->thread_id examplemysqli::use_result
example$mysqli->warning_count examplemysqli_result example comparing
iterator usagemysqli_get_cache_stats
exampleroundrobin filter, old functionalityuser filter replaces
mysqlnd_ms_set_user_pick_serverrandom filterrandom filterroundrobin filtermysqlnd_ms_get_last_gtid
examplemysqlnd_ms_get_last_used_connection
examplemysqlnd_ms_get_stats
examplemysqlnd_ms_match_wild
examplemysqlnd_ms_query_is_select
examplemysqlnd_ms_set_qos
examplemysqlnd_ms_set_user_pick_server
exampleMYSQLND_QC_ENABLE_SWITCH SQL hintMYSQLND_QC_DISABLE_SWITCH SQL hintmysqlnd_qc.cache_no_table ini settingmysqlnd_qc.ttl ini settingmysqlnd_qc_set_is_selectmysqlnd_qc.query_trace_bt_depth ini
settingmysqlnd_qc.time_statistics ini settingmysqlnd_qc_get_cache_info
usagemysqlnd_qc_get_normalized_query_trace_log
usagemysqlnd_qc_set_cache_condition
usagemysqlnd_qc_get_available_handlers
examplemysqlnd_qc_get_cache_info
examplemysqlnd_qc_get_core_stats
examplemysqlnd_qc_get_normalized_query_trace_log
examplemysqlnd_qc_get_query_trace_log
examplemysqlnd_qc_set_cache_condition
examplemysqlnd_qc_set_is_select
examplemysqlnd_qc_set_storage_handler
exampleMysqlndUhConnection::changeUser
exampleMysqlndUhConnection::charsetName
exampleMysqlndUhConnection::close
exampleMysqlndUhConnection::connect
exampleMysqlndUhConnection::endPSession
exampleMysqlndUhConnection::escapeString
exampleMysqlndUhConnection::getAffectedRows
exampleMysqlndUhConnection::getErrorNumber
exampleMysqlndUhConnection::getErrorString
exampleMysqlndUhConnection::getFieldCount
exampleMysqlndUhConnection::getHostInformation
exampleMysqlndUhConnection::getLastInsertId
exampleMysqlndUhConnection::getLastMessage
exampleMysqlndUhConnection::getProtocolInformation
exampleMysqlndUhConnection::getServerInformation
exampleMysqlndUhConnection::getServerStatistics
exampleMysqlndUhConnection::getServerVersion
exampleMysqlndUhConnection::getSqlstate
exampleMysqlndUhConnection::getStatistics
exampleMysqlndUhConnection::getThreadId
exampleMysqlndUhConnection::getWarningCount
exampleMysqlndUhConnection::init
exampleMysqlndUhConnection::kill
exampleMysqlndUhConnection::listFields
exampleMysqlndUhConnection::listMethod
exampleMysqlndUhConnection::moreResults
exampleMysqlndUhConnection::nextResult
exampleMysqlndUhConnection::ping
exampleMysqlndUhConnection::query
exampleMysqlndUhConnection::queryReadResultsetHeader
exampleMysqlndUhConnection::reapQuery
exampleMysqlndUhConnection::refreshServer
exampleMysqlndUhConnection::restartPSession
exampleMysqlndUhConnection::selectDb
exampleMysqlndUhConnection::sendClose
exampleMysqlndUhConnection::sendQuery
exampleMysqlndUhConnection::serverDumpDebugInformation
exampleMysqlndUhConnection::setAutocommit
exampleMysqlndUhConnection::setCharset
exampleMysqlndUhConnection::setClientOption
exampleMysqlndUhConnection::setServerOption
exampleMysqlndUhConnection::simpleCommand
exampleMysqlndUhConnection::simpleCommandHandleResponse
exampleMysqlndUhConnection::sslSet
exampleMysqlndUhConnection::stmtInit
exampleMysqlndUhConnection::storeResult
exampleMysqlndUhConnection::txCommit
exampleMysqlndUhConnection::txRollback
exampleMysqlndUhConnection::useResult
exampleMysqlndUhPreparedStatement::execute
exampleMysqlndUhPreparedStatement::prepare
examplemysqlnd_uh_convert_to_mysqlnd
examplemysqlnd_uh_set_connection_proxy
example