MySQL Database basic commands

Source: Internet
Author: User

mysql-uroot-p Password//Login

creat database people; Create
DROP database name//delete
Show databases//view all databases
use database name//using a database   Show tables//Show all tables under the current database
desc Table name//View the properties of the current table

CREATE TABLE Table name (//Creates a new table Attribute Property data type remarks,      ... );





insert into table name (field 1, field ...).   VALUES (field 1 values, ...) Insert
Select from * user; Querying all data stored in a table
Delete from table name where id=2 (delete condition)//delete record in table by condition
Delete from table name//Remove whole sheet
Update table name set element = ....                   where id=. Modify the record, without the where the entire table will change
Select Variable .....  from table name; Simple Query
select * FROM table name//Flexible query
SELECT * from user where name like '% King ' or password like '%123% '//query name with a king or password with 123
SELECT * from user limit 0,5; Fetch five records from the beginning

MySQL Database basic commands

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.