You are here

Quick links to the MySQL documentation

MySQL Statement Syntax

Data Definition Language (DDL) Statements

ALTER DATABASE ALTER EVENT ALTER LOGFILE GROUP ALTER FUNCTION
ALTER PROCEDURE ALTER SERVER ALTER TABLE ALTER TABLESPACE
ALTER VIEW CREATE DATABASE CREATE EVENT CREATE FUNCTION
CREATE INDEX CREATE LOGFILE GROUP CREATE PROCEDURE CREATE FUNCTION
CREATE SERVER CREATE TABLE CREATE TABLESPACE CREATE TRIGGER
CREATE VIEW DROP DATABASE DROP EVENT DROP FUNCTION
DROP INDEX DROP LOGFILE GROUP DROP PROCEDURE DROP FUNCTION
DROP SERVER DROP TABLE DROP TABLESPACE DROP TRIGGER
DROP VIEW RENAME DATABASE RENAME TABLE

Data Manipulation Language (DML) Statements

CALL DELETE DO HANDLER
INSERT LOAD DATA INFILE REPLACE SELECT
TRUNCATE TABLE UPDATE

MySQL Utility Statements

DESCRIBE EXPLAIN HELP USE

MySQL Transactional and Locking Statements

START TRANSACTION COMMIT ROLLBACK SAVEPOINT
ROLLBACK TO SAVEPOINT LOCK TABLES UNLOCK TABLES SET TRANSACTION
XA Transactions

Account Management Statements

CREATE USER DROP USER GRANT RENAME USER
REVOKE SET PASSWORD

Table Maintenance Statements

ANALYZE TABLE BACKUP TABLE CHECK TABLE CHECKSUM TABLE
OPTIMIZE TABLE REPAIR TABLE RESTORE TABLE

Plugin and User-Defined Function Statements

CREATE FUNCTION DROP FUNCTION INSTALL PLUGIN UNINSTALL PLUGIN

SHOW Statements

SHOW AUTHORS SHOW BINARY LOGS SHOW BINLOG EVENTS SHOW CHARACTER SET
SHOW COLLATION SHOW COLUMNS SHOW CONTRIBUTORS SHOW CREATE DATABASE
SHOW CREATE EVENT SHOW CREATE FUNCTION SHOW CREATE PROCEDURE SHOW CREATE TABLE
SHOW CREATE TRIGGER SHOW CREATE VIEW SHOW DATABASES SHOW ENGINE
SHOW ENGINES SHOW ERRORS SHOW EVENTS SHOW FUNCTION CODE
SHOW FUNCTION STATUS SHOW GRANTS SHOW INDEX SHOW INNODB STATUS
SHOW MASTER STATUS SHOW OPEN TABLES SHOW PLUGINS SHOW PRIVILEGES
SHOW PROCEDURE CODE SHOW PROCEDURE STATUS SHOW PROCESSLIST SHOW PROFILE
SHOW PROFILES SHOW SCHEDULER STATUS SHOW SLAVE HOSTS SHOW SLAVE STATUS
SHOW STATUS SHOW TABLE STATUS SHOW TABLES SHOW TRIGGERS
SHOW VARIABLES SHOW WARNINGS

Other Administrative Statements

BINLOG CACHE INDEX FLUSH KILL
LOAD INDEX INTO CACHE RESET SET

Replication Statements

CHANGE MASTER TO LOAD DATA FROM MASTER LOAD TABLE tbl_name FROM MASTER MASTER_POS_WAIT
RESET SLAVE SET GLOBAL sql_slave_skip_counter START SLAVE STOP SLAVE
SHOW SLAVE STATUS PURGE BINARY LOGS RESET MASTER SET sql_log_bin
SHOW BINARY LOGS SHOW BINLOG EVENTS SHOW MASTER STATUS SHOW SLAVE HOSTS

SQL Syntax for Prepared Statements

PREPARE EXECUTE DEALLOCATE PREPARE

MySQL Compound-Statement

MySQL Data Types

MySQL Numeric Data Types

MySQL Date and Time Data Types

DATETIME DATE TIMESTAMP TIME
YEAR

MySQL String Data Types

MySQL functions

MySQL date and time functions

ADDDATE (inverse DATESUB) ADDTIME CONVERT_TZ CURDATE
CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURTIME
DATE_ADD DATE_FORMAT (inverse STR_TO_DATE) DATE_SUB DATE
DATEDIFF DAY DAYNAME DAYOFMONTH
DAYOFWEEK DAYOFYEAR EXTRACT FROM_DAYS
FROM_UNIXTIME GET_FORMAT HOUR LAST_DAY
LOCALTIME LOCALTIMESTAMP MAKEDATE MAKETIME
MICROSECOND MINUTE MONTH MONTHNAME
NOW PERIOD_ADD PERIOD_DIFF QUARTER
SEC_TO_TIME SECOND STR_TO_DATE SUBDATE
SUBTIME SYSDATE TIME_FORMAT TIME_TO_SEC
TIME TIMEDIFF TIMESTAMP TIMESTAMPADD
TIMESTAMPDIFF TO_DAYS UNIX_TIMESTAMP UTC_DATE
UTC_TIME UTC_TIMESTAMP WEEK WEEKDAY
WEEKOFYEAR YEAR YEARWEEK

MySQL system variables

general_log

MySQL status variables

MySQL Thread States

Sending data

MySQL features

Query Cache General Query Log