Mysql database basic notes. For more information, see
Mysql database basic notes. For more information, see
Go to the installation directory.../bin/mysql.exe
Cd change Directory dir list all files in the current directory
C: \ vesa \... \ a> Angle brackets indicate that they are in the folder of disk c/vasa /.../.
Cd space... indicates the directory to the upper level
Cd Space directory name indicates entering the specified directory
Cd space ted key indicates viewing directory names in sequence
> Mysql space-u user name-p password (that is, connect to the database through the user name and password)
Show databases; show all databases
Use Database Name; indicates entering the database
Show tables; show all data tables
Select * from data table name; view data in the data table
Insert: insert into field name (This field is omitted and not written) values value; (field name 1-> value 1 field name 2-> value 2... the same number of orders)
Update: update table name: set field name = value; (where field name = value and field name = value)
Query: select field list from table name; (where field name = value and field name = value)
Delete: delete from table name; (where field name = value and field name = value)
Create database: database Name;
Delete list: drop table name ...;
Delete database: drop database name;
View table attributes: describe table name;
Modify table attributes: alter table name modify column field name type;
Modify table Name: name of the table after the original table name to rename table;
Create a data table: create table data table name (item name type..., item name type ..,......);