0
点赞
收藏
分享

微信扫一扫

mysql命令行执行导出导入

洒在心头的阳光 2022-01-13 阅读 139
# 导出db01库的所有表结构和数据
mysqldump -hlocalhost -uroot -p123 db01 >D:/a.sql
# 登录数据库
mysql -uroot -p123456
#切换到db01数据中
use db01
#执行表结构创建和数据插入操作
source d:/a.sql

# 错误:可能文件不存在路径写错了,注意检查
Failed to open file 'd:\a.sql', error: 2

#警告:把密码暴露在命令行中不安全
#错误:访问失败,密码错误
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
举报

相关推荐

0 条评论