Home  >  Article  >  Database  >  解析mysql数据库还原错误:(mysql Error Code: 1005 errno 121)_MySQL

解析mysql数据库还原错误:(mysql Error Code: 1005 errno 121)_MySQL

WBOY
WBOYOriginal
2016-06-01 13:25:06889browse

bitsCN.com

原因大致是主键必须是唯一的,也就是数据库里可能存在和现还原数据库有重复的地方,a restriction that Foreign Keys should be uniquely named throughout the database , 一个有效的办法就是将原来的数据库清除后再创建还原。

本人这回的原因是新装的mysql的ibdata1备份文件被我换成之前数据库的ibdata1备份文件了,本来想通过这方法来强制还原的,但是没做到,结果用备份sql文件还原以前数据的数据库时也出错,将被替换的ibdata1文件再还原回去即可解决。

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