MySQL Database backup mysqldump

Source: Internet
Author: User
Tags mysql command line

MySQL database server recently needed backup, encountered the following problems, was resolved in turn

1.

[Sql]mysqldump-uroot-proot TMS > Tms_20150520.sql

[ERR] 1064-you has an error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near ' mysqldump-uroot-proot t Ms > Tms_20150520.sql ' at line 1

The mysqldump command must not be executed under NAVICAT, nor can it be executed under the MySQL command line, but only in the Mysql/bin directory:

F:\mysql-5.6.14-winx64\bin>mysqldump-uroot-p Test >test_20150521.sql
Enter Password:

Ok

2.

F:\mysql-5.6.14-winx64\bin>mysqldump-uroot-p test>test_20150521.sql;
Enter Password:
Mysqldump:got error:1049:unknown database ' test; ' When selecting the database

The reason for the error is that the ">" symbol is not preceded by a space, remove

3. Common Backup Import commands

导出: (整个数据库) mysqldump -u root -p database > data.sql (单个表) mysqldump -u root -p database tablename > data.sql 导入: mysql -u root -p database < data.sql


MySQL Database backup mysqldump

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.