Getting started with MySQL

Source: Internet
Author: User

Installation: Phillips to MySQL root root

Windows +r:cmd Carriage return

CD \

Msql-uroot-proot Http://study.163.com/course/co urselearn.htm?courseid=706085#/learn/video?lessonid=867411&courseid=706085 Video Web page

Http://study.163.com/course/courseLearn.htm?courseId=1004120022#/learn/video?lessonId=1048044170&courseId= 1004120022 this one's good. To install Navicat for MySQL

Save the MySQL statement.

Basic command: \s//View database basic information

1:net stop MySQL//turn off MySQL

2:net start MySQL//turn on MySQL

3:mysql-uroot-proot//Login MySQL

4:show databases; View Database

5:use test//Switch to test database

6:show tables; View all tables If you switch to a database before you can see the table

7:select *from T1; View data in T1

8:desc T1; View T1 table column structure

9:exit//Exit MySQL

MySQL Basic article

One. Database operations

1 show databases; View all databases

2 Create Y1; Create a database that does not exist

3 Use Y1; Switch database to Y1

4 show tables; View the table inside the Y1

5 drop databases Y1; Delete Database y1

6 show databases;

Two-table operation

1 show databases; View Database

2 Create Y1;

3 Use Y1;

4 show tables;

5 CREATE TABLE User (

ID int,

Name varchar (30),

Pass varchar (30)

);

6 desc User; View table fields

7 Select *from User; View values for all table fields

8 select ID from user; Look up all the IDs in the table user

9 Rename table user to User1; Modify the table named User1

Ten show tables; User becomes User1.

drop table User1; Delete Table User1

The design of the second course database

Field Properties

1 values

int type

Float type

2 string

Name: char or varchar

Title: varchar (100)

Content: Text

char (30) 255 bytes

varchar (30) 255 bytes

Text 65535 bytes

Longtext 4.2 billion bytes

CHAR (250) Fast no matter how big it takes 250 bytes

varchar (250) Save space such as a is one byte

From 3rd and Time

Build a Table statement

Data table Index Settings

Getting started with MySQL

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.