PDA

View Full Version : Database Import


DemOnstar
01-16-2016, 11:35 AM
Anybody understand DB imports?
I have tried numerous times but always get the same response. .

SQL query:



--
-- Dumping data for table `adminhelp`
--

INSERT INTO `adminhelp` (`adminhelpid`, `script`, `action`, `optionname`, `displayorder`, `volatile`, `product`) VALUES
(1530, 'accessmask', '', '', 1, 1, 'vbulletin'),
(1531, 'accessmask', 'edit', '', 1, 1, 'vbulletin'),
(1532, 'accessmask', 'modify', '', 1, 1, 'vbulletin'),
(1533, 'accessmask', 'resetall', '', 1, 1, 'vbulletin'),
(1534, 'admininfraction', '', '', 1, 1, 'vbulletin'),
(1535, 'admininfraction', 'editbangroup', 'amount', 10, 1, 'vbulletin'),
(1536, 'admininfraction', 'editbangroup', 'method', 20, 1, 'vbulletin'),
(1537, 'admininfraction', 'editbangroup', 'usergroupid', 30, 1, 'vbulletin'),
(1538, 'admininfraction', 'editbangroup', 'banusergroupid', 50, 1, 'vbulletin'),
(1539, 'admininfraction', 'editbangroup', 'period', 60, 1, 'vbulletin'),
(1540, 'admininfraction', 'editgroup', '', 1, 1, 'vbulletin'),
(1541, 'admininfraction', 'editgroup', 'override', 1, 1, 'vbulletin'),
(1542, 'admininfraction', 'editgroup', 'pointlevel', [...]

MySQL said: Documentation
#1062 - Duplicate entry 'accessmask--' for key 'phraseunique'

Any clues to what might be the issue? . .
I have no idea what to do about this. . .

Thanks. .

Replicant
01-17-2016, 02:07 AM
Anybody understand DB imports?

MySQL said: Documentation
#1062 - Duplicate entry 'accessmask--' for key 'phraseunique'

Any clues to what might be the issue? . .
I have no idea what to do about this. . .

Thanks. .

The answer is right in front of you. You have a duplicate entry.

Try select * from adminhelp where script like 'accessmask'

If there are two rows that are identical, delete one of the rows.

delete from adminhelp where adminhelpid=foo

where foo= one of the duplicate entries. It's always safest to do a comple mysqldump of the database before doing any manual queries. One type and you're screwed. :erm:

EDIT: I missed the part in the title where you said "database import", you will need to check your SQL soure for that table to find the duplicate entry and delete it.

DemOnstar
01-17-2016, 03:26 PM
Cheers Mr Replicant.

I will do as you suggest as soon as I get my PC back form the repair chap. It died yesterday.
If I can't figure out the DB issue, is there anyway to extract only the additional.css information from a table in the DB? And possibly thread information?

Thanks. . .I wouldn't know which table they are in. . .

Replicant
01-17-2016, 05:34 PM
Ya, that stuff is accessible. The additional.css is easy, the other stuff, not so much. If the database isn't very big, I'd be willing to load it up on my test site and see if I can correct the error, time permitting of course. :)

DemOnstar
01-19-2016, 01:26 PM
Cheers again Mr Replicant. I managed to do it using a variation of your first suggestion.
I created an empty DB with no tables in it then imported into that and all works well. . .

Thanks for your time and know how. . .