Cmd commands for creating databases and tables. cmd commands for creating databases
Open mysql 5.7 Command Line Client in cmd.
1. Press Enter password to Enter the password you used to log on to the database. The following are some important commands for creating databases and tables.
(1). Create a database: The Database Name of the creat table;
(2). display the database you created (you have selected the database you want to use): show databases;
(3). Delete the database (Use this command with caution): drop the database name;
(4). create an empty table: create table Name (
-> Id int (3 ),
-> Name varchar (8 ),
-> Pasword varchar (20); (no output content and save content as long as it does not end with a semicolon)
(5). display table content: show tables;
(6). Retry table name: alter table original table name rename to new table name;
(8). add field: alter table name add email varchar (255) not null;
(9) modify the field name: alter table field name change new field name;
(10). Delete field: alter table Name drop field name;
(11). Delete table name: drop table name;