MySQL introduction and common DOS commands

Source: Internet
Author: User

MySQL: relational database management system (RDBMS -relational database management system)

What is a database : A database is a warehouse in which data is organized, stored, and managed according to its structure. It is a collection of some associated tables.

    • data table: a table is a matrix of data. Tables in a database look like a simple spreadsheet.
    • columns: a column (the data element) contains the same data, such as the postal code.
    • row: a row (= tuple, or record) is a set of related data, such as a user's subscribed data.
    • Redundancy : stores twice times the data, redundancy reduces performance, but improves the security of the data.
    • PRIMARY KEY : The primary key is unique. Only one primary key can be included in a data table. You can use the primary key to query the data.
    • foreign Key: A foreign key is used to correlate two tables.
    • Composite key : Composite key (key combination) Multiple columns are used as an index key, and are typically applied to composite indexes.
    • index: use an index to quickly access specific information in a database table. An index is a structure that sorts the values of one or more columns in a database table. A directory similar to a book.

Doc command to add a MySQL user instance

Use mysql;insert into user (Hos,user,password,select_priv,insert_priv,update_priv) VALUES ('localhost','Demo', PASSWORD ('123'),'Y','Y','Y');//authorized users can perform SELECT, INSERT, and update operation permissionsFLUSH privileges;//This command will reload the authorization form when it is executed .SelectHost,user,password fromUserwhereUser='Demo';

Delete MySQL User

 from where ' Demo ';

Managing database Common Commands

show databases;//Show Database listUse demo;//Select a databaseShow tables;//displays all data tables for the specified databaseShow Index fromTable_demo;//Display index information for a data tableShow Table Statiu fromTable_demo; Displays information about all tables in the Database Table_demo Show Table Statiu fromTable_demo like'table_demo%'; Table name begins with Table_demo information for tables show Table Statiu fromTable_demo like'table_demo%'\g; Plus \g, query results by column print net start MySQL//start MySQL service net stop mysql//shutdown MySQL service

Introduction to MySQL and common DOS commands

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.