Cmd commands for creating databases and tables. cmd commands for creating databases

Source: Internet
Author: User

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.