Basic Operations View Help
(help?) \h \?
Exit (Exit Quit)
\q
If you write the wrong command, you want to clear the statement of the current input command, and then add (clear) after the wrong command.
\c
Clear Screen
Cls
Database operations increase the database
Create DATABASE Db_name
Deleting a database
Drop Database Db_name
Modify Database
Cannot be modified
View Database
Show databases
Working with databases
Use Db_name
To view the SQL statements for the build library
Show CREATE Database db_name;
Data table operations Add data table
CREATE table ' user ' (' id ' int (one) ', ' username ' varchar '), password varchar (32));
Delete a data table
DROP TABLE table_name
modifying data tables
rename new_table_name;
View a list of data tables
Show tables;
To view the SQL statement for the build table
Show CREATE TABLE table_name;
"Operation of table fields" increase or Decrease table field (First,after)
ALTER TABLE table_name ADD Table_field_first varchar (+) first;alter table table_name add table_field_second varchar ( ) after Table_field_first;
Delete a table field
ALTER TABLE table_name DROP Table_field;
Modify table field names to new fields
ALTER TABLE table_name change old_table_name new_table_name varchar (32);
Just modify a table field property
ALTER TABLE table_name MODIFY Table_field varchar (50);
View table Structure
DESC table_name
Basic operation of "MySQL" Under DOS