我在localhost中设计了我的joomla。但是当我试图检索joomla的备份站点时,我将我之前的数据库插入到joomla中。它给了我以下错误。
sql查询:
转储表格awmbx_assets
INSERT INTO `awmbx_assets` (`id`, `parent_id`, `lft`, `rgt`, `level`, `name`, `title`, `rules`) VALUES
(1, 0, 1, 97, 0, 'root.1', 'Root Asset', '{"core.login.site":{"6":1,"2":1},"core.login.admin":{"6":1},"core.login.offline":{"6":1},"core.admin":{"8":1},"core.manage":{"7":1},"core.create":{"6":1,"3":1},"core.delete":{"6":1},"core.edit":{"6":1,"4":1},"core.edit.state":{"6":1,"5":1},"core.edit.own":{"6":1,"3":1}}'),
(2, 1, 1, 2, 1, 'com_admin', 'com_admin', '{}'),
(3, 1, 3, 6, 1, 'com_banners', 'com_banners', '{"core.admin":{"7":1},"core.manage":{"6":1},"core.create":[],"core.delete":[],"core.edit":[],"core.edit.state":[]}'),
(4, 1, 7, 8, 1, 'com_cache', 'com_cache', '{"core.admin":{"7":1},"core.manage":{"7":1}}'),
(5, 1, 9, 10, 1, 'com_checkin', 'com_checkin', '{"core.admin":{"7":1},"core.manage":{"7":1}}'),
(6, 1, 11, 12, 1, 'com_config', 'com_config', '{}'),
(7, 1, 13, 16, 1, 'com_contact', 'com_contact', '{"core.admin":{"7":1},"core.[...]
SQL错误
#1062 - Duplicata du champ '1' pour la clef 'PRIMARY'
我现在应该做什么?
答案 0 :(得分:0)
此错误表示您的awmbx_assets
表中有另一条记录与您现在要插入的记录的id
具有相同的id
。
首先截断现有表格。然后运行SQL查询以插入备份站点的数据。
作为旁注,我知道你在localhost中运行它,但一般情况下请不要共享joomla表的前缀部分(在这种情况下为awmbx
),因为暴露它可能会产生安全隐患。 / p>