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