查看“Mysqldump”的源代码
←
Mysqldump
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看和复制此页面的源代码。
mysqldump 命令可以备份数据库中的数据。 备份时是在备份文件中保存了 create 语句和 insert 语句。<syntaxhighlight lang="shell"> mysqldump -u root -pPassword -T 目标目录 dbname table [option]; </syntaxhighlight>Password 参数表示 root 用户的密码,密码紧挨着 -p 选项; 目标目录 参数是指导出的文本文件的路径; dbname 参数表示数据库的名称; table 参数表示表的名称; option 表示附件选项。 '''示例'''<syntaxhighlight lang="batch"> C:\Users\Administrator>mysqldump -u root -p123456 -T E:\record\2024\7\10\ testdb student "--fields-terminated-by=," "--fields-optionally-enclosed-by="" mysqldump: [Warning] Using a password on the command line interface can be insecure. mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement when executing 'SELECT INTO OUTFILE' </syntaxhighlight>"--fields-terminated-by=," 设置 , 为字段的分隔符,默认值是"\t"; "--fields-optionally-enclosed-by=""设置字符括上 char、varchar 和 text 等字符型字段 出现<syntaxhighlight lang="text"> mysqldump: [Warning] Using a password on the command line interface can be insecure. mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement when executing 'SELECT INTO OUTFILE' </syntaxhighlight>的原因是安装MySQL的时候限制了导入与导出的目录权限,只允许在规定的目录下才能导出、导入。 可以通过<syntaxhighlight lang="sql"> show variables like "secure_file_priv"; </syntaxhighlight>查看允许导出、导入的目录位置 {| class="wikitable" !Variable_name !Value |- |secure_file_priv |C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ |}
返回至
Mysqldump
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
Spring Boot 2 零基础入门
Spring Cloud
Spring Boot
设计模式之禅
VUE
Vuex
Maven
算法
技能树
Wireshark
IntelliJ IDEA
ElasticSearch
VirtualBox
软考
正则表达式
程序员精讲
软件设计师精讲
初级程序员 历年真题
C
SQL
Java
FFmpeg
Redis
Kafka
MySQL
Spring
Docker
JMeter
Apache
Linux
Windows
Git
ZooKeeper
设计模式
Python
MyBatis
软件
数学
PHP
IntelliJ IDEA
CS基础知识
网络
项目
未分类
MediaWiki
镜像
问题
健身
国债
英语
烹饪
常见术语
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息