有这么个数据库blog 我想要导入到c盘根目录下的 test.sql下(或者当前目录)
语句该怎么写?mysql> mysqldump -u root -p blog >test.sql;
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 'mysql
dump -u root -p blog >test.sql' at line 1
mysql> mysqldump -u root -p blog > test.sql;
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 'mysql
dump -u root -p blog > test.sql' at line 1
mysql> mysqldump -uroot -pblog > test.sql;
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 'mysql
dump -uroot -pblog > test.sql' at line 1
mysql>
为什么老是不对?
语句该怎么写?mysql> mysqldump -u root -p blog >test.sql;
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 'mysql
dump -u root -p blog >test.sql' at line 1
mysql> mysqldump -u root -p blog > test.sql;
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 'mysql
dump -u root -p blog > test.sql' at line 1
mysql> mysqldump -uroot -pblog > test.sql;
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 'mysql
dump -uroot -pblog > test.sql' at line 1
mysql>
为什么老是不对?
就对
不过,要在命令行下,而不是进入mysql后
原来的path是这样的 要怎么写才对?
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
另外你cd进入到bin目录下执行就行了,如果不是经常用的话,不用添加到系统变量的。
mysqldump -h 127.0.0.1 -u root -proot test > d:\\testbackupfile.sql
就是把数据库test导出到D盘testbackupfile. sql文件中。