First, the cmd common MySQL related commands
mysql-d,--database=name//Open Database
--delimiter=name//Specify delimiter
-H,--host=name//server name
-P,--password[=name]//password
-P,--Port[=name]//Port number
--prompt==name//Setup prompt
-U,--user=name//user name
-V,--version//output version number
Can be used in combination, such as input-uusernam-ppassword login user name usrname password for password account
II. Basic data types
Integral type:
1) TINYINT 2) SMALLINT 3) Mediumint 4) INT 5) BIGINT
The main difference is the size
Floating point type:
1) FLOAT [(M,d)] 2) double[(M,D)]
Date:
Character type:
The above types, according to the needs of small can be selected. Personal feeling date type will be very fee, character type Plus; it is easy to represent the date, and it is easy to read and write.
Iii. MySQL basic commands
MySQL Statement specification:
1) keyword and function name all uppercase
2) data null name, table name, field name all lowercase
3) The SQL statement must have a good ending
Basic Information command:
SELECT VERSION (); Displays the current server version. Attention! The semicolon must be, it means the command is over, or it will always wait for you to finish the order.
SELECT now (); Show current date
SELECT USER (); Show Current User
Core command:
{} is a required option, selecting one from multiple items [] is optional, dispensable
To create a database command:
Creatte {DATABASE | SCHEMA} [IF not EXISTS] db_name [DEFAULT] CHARACTER SET [=] charset_name;
Show Database command:
show{databases| SCHEMAS} [like ' Pattern ' | WHERE expr];
To view the database that you have created:
SHOW CREATE DATABASE database_name;
To modify the database encoding method:
ALTER {database| SCHEMA} [DEFAULT] CHARACTER SET [=] charset_name;
To delete a database:
DROP {DATABASE | SCHEMA} [IF EXISTS] Db_name
MYSQL Basic Learning Note Overview with basic data type: integer: 1) TINYINT 2) SMALLINT 3) Mediumint 4) INT 5) BIGINT is mainly the size of the difference chart floating point: command