MySQL First Knowledge 01

Source: Internet
Author: User

Recently began to learn MySQL so the two days to learn a brief summary of the knowledge

1.status displaying database information

2. Data type:

A. String:

CHAR (m): fixed-length character with a maximum of 255 characters;

varchar (m): variable-length string, up to 255 characters

B. Integral type: int

C. Floating point: float[(m,d)] m, Width indicator, representing the sum of data lengths around the decimal point; D, precision indicator, indicating the number of digits to the right of the decimal point

D.set: Represents a combination of multiple values

E.enum: Similar to set, representing multiple values, but only one can be selected

F.text/blob: Used to save 255 to 65,535 characters, text is case-insensitive, blobs are case-sensitive

3. Common permissions:

Global Administrative permissions:

File: Read and write files on the MySQL server;

Process: Displays or kills other users ' service processes

RELOAD: Overload access Control table, refresh log, etc.

SHUTDOWN: Turn off MySQL service

Database/database table/Data column permissions:

Alter: Modify an existing data table (Add/Delete column) and index

Create: Create a new database or data table

Delete: Deleting records from a table

Drop: Delete a data table or database

Index: Create or delete indexes

INSERT: Add a table record

Selete: Display/Search Table records

UPDATE: Modify a record that already exists in the table

(Permissions this paragraph from a blog, the specific is not clear, then feel very helpful to understand, so recorded)

4.mysql Common Operations (commands):

A. Login:

Mysql-uroot-p (when password is available)

Mysql-u root (login without password)

B. Operation:

MySQL >create database; (creating databases)

> show databases; (View all current databases)

> Use Dataname; (acting on a specific database)

> Show tables; (View the tables in the database)

> CREATE table User (name char (m), passwd char (m));(Creating tables user, and two of these fields name,passwd)

> describe user; (view field of table user)

> INSERT into user values ();(inserts several records into the table)

> select * from User; (View all data in table user)

> Delete from user where name = "";(remove data from table)

> Update user set name = "WHERE name =" ";(modify data in the table)

>exit (Exit Database)

Note: ";" as Oh command Terminator, essential

These are some of today's summary, follow-up will continue to update

   

MySQL First Knowledge 01

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.