Mysql database basic notes

Source: Internet
Author: User
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 ..,......);

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.