怎么导出mysql表
mysql> mysqldump -uroot -p123123 --database openmeetings --tables RoomClient>e:/
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 -p123123 --database openmeetings --tables RoomClient>e:/test.sq' at
line 1
追问:还是不行
mysql> mysqldump -h localhost -uroot -p123123 openmeetings RoomClient > e:/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 -h localhost -uroot -p123123 openmeetings RoomClient > e:/test.sql' at line
1
mysql>数据库和表都有的,难道我还要退出mysql才能使用mysqldump ?有没有不退出就可以使用的命令?
答案:mysqldump -uroot -p123456 test > /home/my.sql
说下 上面参数
数据库用户名:root
密码 :123456
数据库名:test
/home/my.sql 为导出文件地址,这里 是linux系统 所以为/home/my.sql
如果是windows替换 它为:e:/my.sql
注意空格奥。。
---------------------------------------上面看懂了就看下面这些-------------------------------------------
导出单个数据表结构和数据
mysqldump -h localhost -uroot -p123456 database table > dump.sql
导出整个数据库结构(不包含数据)
mysqldump -h localhost -uroot -p123456 -d database > dump.sql
导出单个数据表结构(不包含数据)
mysqldump -h localhost -uroot -p123456 -d database table > dump.sql
其他:用navcat 管理工具,轻松搞定
上一个:请教下,我有个2.8G左右的 .sql结尾的文件怎么能把里面的内容导入进我本地的mysql 中
下一个:mysql char 与varchar的区别