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