Data Definition Statements
1012
13.6.4. Variables in Stored Programs ............................................................................... 1138
13.6.5. Flow Control Statements ...................................................................................... 1140
13.6.6. Cursors ............................................................................................................... 1144
13.6.7. Condition Handling ............................................................................................... 1145
13.7. Database Administration Statements ............................................................................... 1149
13.7.1. Account Management Statements ......................................................................... 1149
13.7.2. Table Maintenance Statements ............................................................................. 1162
13.7.3. User-Defined Function Statements ........................................................................ 1169
13.7.4.
SET
Syntax .......................................................................................................... 1170
13.7.5.
SHOW
Syntax ........................................................................................................ 1173
13.7.6. Other Administrative Statements ........................................................................... 1205
13.8. MySQL Utility Statements ............................................................................................... 1210
13.8.1.
DESCRIBE
Syntax ................................................................................................ 1210
13.8.2.
EXPLAIN
Syntax .................................................................................................. 1210
13.8.3.
HELP
Syntax ........................................................................................................ 1211
13.8.4.
USE
Syntax .......................................................................................................... 1213
This chapter describes the syntax for the SQL statements supported by MySQL.
13.1. Data Definition Statements
13.1.1.
ALTER DATABASE
Syntax
ALTER {DATABASE | SCHEMA} [
db_name
]
alter_specification
...
alter_specification
:
[DEFAULT] CHARACTER SET [=]
charset_name
| [DEFAULT] COLLATE [=]
collation_name
ALTER DATABASE
enables you to change the overall characteristics of a database. These
characteristics are stored in the
db.opt
file in the database directory. To use
ALTER DATABASE
, you
need the
ALTER
[576]
privilege on the database.
ALTER SCHEMA
is a synonym for
ALTER DATABASE
as of MySQL 5.0.2.
The
CHARACTER SET
clause changes the default database character set. The
COLLATE
clause
changes the default database collation.
Section 10.1, “Character Set Support”
, discusses character set
and collation names.
You can see what character sets and collations are available using, respectively, the
SHOW
CHARACTER SET
and
SHOW COLLATION
statements. See
Section 13.7.5.3, “
SHOW CHARACTER SET
Syntax”
, and
Section 13.7.5.4, “
SHOW COLLATION
Syntax”
, for more information.
If you change the default character set or collation for a database, stored routines that use the
database defaults must be dropped and recreated so that they use the new defaults. (In a stored
routine, variables with character data types use the database defaults if the character set or collation
are not specified explicitly. See
Section 13.1.9, “
CREATE PROCEDURE
and
CREATE FUNCTION
Syntax”
.)
The database name can be omitted, in which case the statement applies to the default database.
13.1.2.
ALTER FUNCTION
Syntax
ALTER FUNCTION
func_name
[
characteristic
...]
characteristic
:
COMMENT '
string
'
| LANGUAGE SQL
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...