数据库的备份和导入
备份数据库:
mysqldump -u -p -h 数据库名称 >E:/db.sql(存储位置及名称)
导入数据库:
进入数据库后,source E:/db.sql
load data 也可以使用,只有服务器和客户端都允许时,LOCAL 才可以工作。
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY 'string']
[[OPTIONALLY] ENCLOSED BY 'char']
[ESCAPED BY 'char' ]
]
[LINES
[STARTING BY 'string']
[TERMINATED BY 'string']
]
[IGNORE number LINES]
[(col_name_or_user_var,...)]
[SET col_name = expr,...]]