Simple MySQL tutorial

Source: Internet
Author: User
Tags mysql tutorial

DOS command to enter MySQL
C:/> mysql-H 127.0.0.1-u root-P
Enter Password> ***********
Mysql> complete

 

Create Database databasename;

Perform operations using the specified database:

Method 1: Use Database databasename;
Method 2: mysql> databsename;

Query the current database name: select database ();

 

Query all databases: Show databases;

 

Create Table tablename (table description)

View the data table structure describe tablename;

 

Query the current database name: select database ();
Query the names of all data tables in the current database: show tables;

Insert database data:
Method 1: insert tablename (recordname1, recordname2) values (data1, data2 );
Method 2: insert tablename values (data1, data2 );
Insert multiple records: insert tablename (columname1, columname2) Vales (data1, data2), (data3, data4 );

Query data table content: Select * From tablename;

Read data from local files and add it to the database
Load data local infile "pathname" into Table tablename;
Method 1: load data local infile "member.txt" into Table tablename;
MySQL databasename <insert_tablename. SQL

Related Article

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.