1.mysqldump $ mysqldump -u root -p RUNOOB runoob_tbl > dump.txt password ******
导出的数据中包含表结构和表数据
2. select * from platform_user into outfile '/tmp/mysql/user/201810.csv'
fields terminated by ','
enclosed by '"'
lines starting by '\r'
terminated by '\n';
这种方法你可能会遇到这样的报错信息:The MySQL server is running with the --secure-file-priv option
是mysql设置的权限,可以使用
show variables like '%secure%';查看 secure-file-priv 当前的值是什么
导出的数据必须是这个值的指定路径才可以导出,默认有可能是NULL就代表禁止导出,所以需要设置一下
知道mysql安装路径下的my.ini文件,设置一下路径:
然后重启数据库即可;
这种只是导出表数据