MySQL Foundation one

Source: Internet
Author: User

One

    1. 1. configuration file

    2. 2. Data Storage location

    3. 3. Log Location

Two-SQL

    1. 1. Login mysql-h IP Build list, delete the list.

    2. 2. Check version, simple operation

1 Increase

1.1"Insert a single line"
Insert [into] <Table name> (Column Name) VALUES (column Values)
Example:Insertinto strdents (name,Sex,Date of birth) VALUES ('Happy Friends', 'male' , ' 1980/6/15 ')

1.2"Add existing table data to a table that already exists"
INSERT INTO <Existing new tables> (Column Name) Select <original table column name>from <Original table name>
Example:insertinto Tongxunlu ('name', 'Address', 'Email')
Select Name,address,emailfrom strdents

1.3 "Create a new table directly with the existing table data and populate"
Select < >into < new table name >from < source table name >
selectname,address,email to Tongxunlu from strdents

1.4the UseUnionkeyword merge data to insert multiple lines "
Insert <Table name><Column Name>select <column Values>tnion Select <column Values>
Example:insertstudents (name,Sex,Date of birth)
Select 'Happy Friends', 'male' , ' 1980/6/15 ' union(Unionrepresents the next line)
Select 'Blue Xiaoming', 'male' , ' 19**/**/** '

2 Delete

2.1the Delete<meet the conditions of>Line "
Delete from <Table name>[where <Delete Condition;]
Example:Deletefrom A where name= 'Happy Friends'(Delete tableaThe values in the column are the rows of happy Friends)

2.2 "Delete entire table"
TRUNCATE TABLE < name >
TRUNCATE TABLE Tongxunlu
Note: Delete all rows of the table, but the structure, columns, constraints, indexes, etc. of the table are not deleted;

3 Change

Update <Table name>set <Column Name=Update Values>[where <Update Condition;]
Example:Updatetongxunlu SetAge=18wherename= 'Blue Nickname'

Rename the table, delete a column, modify the column data type, and rename a column.


MySQL Foundation one

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.