MySQL Basic operation statement

Source: Internet
Author: User

Database update and Backup is one of the basic functions of operations, and here is the operation of the statement to do a tidy, not regularly updated.


1) Database backup statements

MYSQLDUMP-H Database IP address-u user name-p password ABC XYZ > Jqk.sql

Back up the XYZ table in the ABC library to the current directory in Jqk.sql.


2) database Import Database file

MYSQL-H Database IP address-u user name-p password ABC < jqk.sql

Jqk.sql This database file into the ABC library, pay attention! If there is no special note ABC This library, need in jqk.sql inside the first sentence to explain "use ABC;"


3) database is backed up directly to a compressed file and imported into a database from a compressed file.

#备份到压缩文件mysqldump-H Database IP address-u user name-p password ABC XYZ | gzip > jqk.sql.gz# Import from a compressed file gzip < JQK.sql.gz | MYSQL-H Database IP address-u user name-p password


4) Do not enter MySQL directly display database query results

MYSQL-H Database IP address-u user name-p password-d ABC-E ' specific SQL statement ';

, the effect is to directly query select COUNT (1) from lg_openapi_dtl_20170207 in the corresponding database:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8D/6D/wKioL1icHMGSWttmAABCO7xdM2A314.png "title=" 1.png "alt=" Wkiol1ichmgswttmaabco7xdm2a314.png "/>


5) Query The table statements in the library

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8D/6F/wKiom1icHbGQA6IeAAAwRBsrkr8807.png "title=" 1.png "alt=" Wkiom1ichbgqa6ieaaawrbsrkr8807.png "/>

This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1896403

MySQL Basic operation statement

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.