Simple MySQL Command

Source: Internet
Author: User

MySQL Command summary:
Open mysql.exe and enter the password
Logon operation
Mysql-u root-P;
Database Operations
Show databases; displays the database
Create Database db_name; Create a database
Use db_name; use the database
Source D:/DB. SQL; import database

Table operations
Show tables; view the tables in the current database
Create Table table_name (name varchar (20), sex char (1 ));
Create a data table
Desc table_name; displays the table structure
Insert into table_name values ("", ""); add a record to the table
Load data local infile "D:/mysql.txt" into Table table_name; load data into database tables in text mode
Drop table table_name; delete a table
Delete from table_name; clear the table
Update table_name set sex = "F" where name = "Lili"; update a data table
Select * From table_name where name = ""; displays table data

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.