MySQL is a simple basic operation guide (1)
System: Ubuntu 14.04 LTS
Installation:
Apt-get install mysql // install the database apt-get install mysql-workbench // install the graphical interface
Usage:
At startup: mysql-h [address]-p [port]-u [user name]-p [Password]
It will be like this:
Mysql> is the place where the command is input. to exit, use exit.
In mysql, commands generally require extra points.
Database Operations:
Create database name; create show databases; view drop databases; Delete use database Name; use the current database
Table operations:
Show tables; view table create table (extra parameter for column name data type,...); create table
Common additional parameters:
NULL/NOT NULL
DEFAULT
AUTO_INCREMENT auto-Increment
UNIQUE
Parmiry key primary KEY
Foreign key (this is different from SQL Server)
Constraint foreign key (KEY name) REFERENCES (KEY name)
Character set (garbled characters may occur if not set)
CHARSET = UTF-8 /.....
The operation on the table itself is the same as that on the standard SQL language.