Forum

Thread tagged as: Question, Problem, Error

SQL error on some but not all websites on server

I have just upgraded my server from mysql 5.4 to 5.7. 5 out of my 7 websites running the same version of perch are fine. The websites for the other two are working fine, but I cant log into perch on them. The error message tells me to contact you.

The first site gives me : The following error occurred: ALTER IGNORE TABLE perch2_resource_log ADD UNIQUE INDEX idx_uni (appID, itemFK, itemRowID, resourceID) SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE perch2_resource_log ADD UNIQUE INDEX idx_uni (appID, itemFK' at line 1

The second site gives me : The following error occurred: DROP INDEX idx_uni ON perch2_resource_log SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'idx_uni'; check that column/key exists The following error occurred: ALTER IGNORE TABLE perch2_resource_log ADD UNIQUE INDEX idx_uni (appID, itemFK, itemRowID, resourceID) SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE perch2_resource_log ADD UNIQUE INDEX idx_uni (appID, itemFK' at line 1

cow shed

cow shed 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of Perch are you running?

2.8.17 on the sites which are working and on the sites which arent. So I dont think its a perch version problem?

Drew McLellan

Drew McLellan 2638 points
Perch Support

ALTER IGNORE TABLE was removed in MySQL 5.7, but I can't see that in the current codebase anyway, so I'm not sure where it's coming from.

I have upgraded these two sites to version 3 (the others still work as version 2) and the problem has gone.

Now I have a problem that my very old version of shop doesnt have any settings to point the paypal account at. All good apart from that!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. Will you post seperately about that?

Yes. BTW the Perch 3 upgrade itself worked v smoothly!