MySQL basic operation (+ reference manual)

Source: Internet
Author: User

1. MySQL 5.1 Reference Manual2. Basic Tutorials

3, commonly used examples into the following:

1 Connect to the database:MySQL-H Host Address-u user name-P user password2 Prompt for database:MySQL> 3 Exit Database:Exit(carriage return)4Display database: show databases;5CREATE database: Create library name;6 Select database: Usedatabase name;7Show tables in the database: show tables;8display the structure of the data table: Describe table name;9 Build Table: Create TABLE table name (field set list); Note: auto_increment self-increment primaryKeyPRIMARY Key10 Display records in table: SELECT *from table name;11 Add record: INSERT into name (Uname,gender,birthday) VALUES (' Zhang San ', ' Male ', ' 1971-10-01 '));12 Modify Record: Update name set birthday= ' 1971-01-10 ' where Uname= ' Zhang San ';13 Delete Record: Delete from name where Uname= ' Zhang San ';14Delete tables: drop table name;15Delete Library: drop database name;16 Backup database: Mysqldump-u root-p--opt database name > backup name;//go to library directory17 Recovering the database:MySQL-U root-p database name < backup name;//database must exist at restore time, can be an empty database18 Authorization Database: Format: Grant SELECT on database. * To User name @ login host identified by "password";

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.