One, the CMD frequently uses the MySQL related command
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//username
-V,--version//output version
Able to use combination, such as input-uusernam-ppassword login username for usrname password for password account
II. Basic data types
Integral type:
1) TINYINT 2) SMALLINT 3) Mediumint 4) INT 5) BIGINT
is mainly the difference in size
Floating point type:
1) FLOAT [(M,d)] 2) double[(M,D)]
Date:
Character type:
The above types. Select small as needed to be able. Personal feeling date type will be very fee, character type Plus, very easy to be able to express the date, and read and write is also convenient.
Iii. MySQL basic commands
MySQL Statement specification:
1) keyword with 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 number.
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;
Change 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 Main is the size of the difference chart floating point: command