Home >Database >Mysql Tutorial >mysql数据库备份和还原_MySQL

mysql数据库备份和还原_MySQL

WBOY
WBOYOriginal
2016-06-01 13:36:59809browse

bitsCN.com

数据库备份:

打开cmd 执行以下语句:

mysqldump -h localhost -u root -proot databasename >d:/databasename.sql

 

数据库还原:

打开cmd执行以下语句

mysql  -uroot -proot databasename

当数据库备份和还原操作并不是在同一台数据库服务器上,可能会出现两台服务器的mysql软件安装的编码问题

比如在还原数据库时会遇到“Unknown command '/''.” 这种错误提示

则可以使用

mysql  -uroot -proot  --default-character-set=gb2312 databasename bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn