使用mysqldump备份数据库
一定要注意mysqldump不是mysql内部操作数据的命令,而是控制mysql的命令。如果进入了mysql数据库执行该命令会一直报如下错误:
ERROR 1064 (42000): You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near
'mysqldump mysql -uroot -p >test.sql' at line 1
一定要在mysql外面执行该命令。