Back up the MySQL command line of the database

Source: Internet
Author: User
Tags mysql command line

The MySQL command line is very powerful and can even be used to back up the database. The MySQL command line described below is used to back up the database. I hope it will help you.

Note: The mysqldump command is executed in the DOS mysql \ bin directory and cannot be executed in the mysql environment. Therefore, it cannot end with a semicolon. If you have logged on to mysql, run the exit command mysql> exit

1. MySQL command line to export the entire database
The exported files are stored in the mysql \ bin directory by default.
Mysqldump-u username-p Database Name> exported file name
Mysqldump-uroot-p123456 database_name> outfile_name. SQL

2. Export a table through the MySQL Command Line
Mysqldump-u user name-p database name Table Name> exported file name
Mysqldump-u user_name-p database_name table_name> outfile_name. SQL

3. Export a database structure from the MySQL Command Line
Mysqldump-u user_name-p-d-add-drop-table database_name> outfile_name. SQL
-D no data-add-drop-table add a drop table before each create statement

4. Export with language Parameters
Mysqldump-uroot-p-default-character-set = latin1-set-charset = gbk-skip-opt database_name> outfile_name. SQL

MySQL permission table Introduction

Instances that grant MySQL user permissions

How to optimize mysql Indexes

How to view MySQL Indexes

Use of MySQL EXPLAIN statements

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.