MySQL statement syntax
I. Database definition statements (DDL)
1. ALTER DATABASE syntax
Alter database is used to change the global nature of the databases, which are stored in the db.opt file in the database directory. To use ALTER DATABASE, you need to have the ALTER permission
Character Set clause to change the default data character set .
Collate clause to change the default database collation
The database name can be ignored, at which point the statement corresponds to the default database, or you can use the alter schema
Database operations:
1. Display data
2. Select Database
3. Create the database and set the encoding to UTF-8
4. Modify the database character set to UTF8
5\, deleting a database
6. View database Status
2. ALTER TABLE syntax
Syntax users change the structure of an existing table, for example, you can add or subtract columns, create or cancel an index, change the type of an existing column, or rename a column or table. You can also change the table's commentary and table type
Among the allowed changes, the syntax of many clauses is similar to that of the clauses in CREATE TABLE, including table_options modifications, Options Engien, Auto_increment, Avg_row_length, and so on.
Some operations are not supported by the storage engine and a warning occurs if these operations are performed. These warnings can be displayed using show warnings.
1. Displaying database tables
MySQL Study first day