MySQL is a simple basic operation guide (1)

Source: Internet
Author: User

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.

Related Article

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.