cancel
Showing results for 
Search instead for 
Did you mean: 

Site down - SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user

Site down - SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user

Hello guys.

 

I've stumbled across a problem with my site which i need some help with, Let me start from the beginning. A few weeks ago i got a email from my hosting provider saying that my MYSQL database has exceeded the amount given. Im only allowed 1GB but apparently it was on 1.42GB. So after spending a couple hours just to figure out how to log into my hosting, my sql..ect (i forget passwords when i've not logged in for a year!) i can see the contents of mysql is in fact 762mb. Nowhere near 1.42gb that the hosting provider suggests (godaddy).

 

I also noticed, that my site is down. Im guessing godaddy revoked my database due to it being over the threshold. Heres a copy of the email they sent me:

The following schedule will be used to assist you with your efforts:

TUESDAY, FEBRUARY 07, 2017 (MST, GMT -7) - If the database remains above thresholds, your website access to the database content will be revoked. Your website will no longer be able to connect to the database for content.

TUESDAY, FEBRUARY 14, 2017 (MST, GMT -7) - If the database remains above thresholds, the database will be backed up (*if possible) and removed at that time. Your database will no longer exist on your hosting account.

Once you have reduced the database to within the acceptable thresholds, normal functionality will automatically be restored once again. Please allow up to one full hour for such changes to take effect.


Today the 10th i've only just started working on it. So im guessing on the 7th they revoked my database?. Well i can still access it ok. I even deleted it and restored a previous backup of the database.

 

Its been 5 hours since i spoke to them and the site still isn't up and running. Heres a snapshot of the error when trying to access the site:

Does anyone have any ideas what i can do from here on?. 

2 REPLIES

Re: Site down - SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to use

Hi! I also have the exact problem as you, how did you fix that?

Re: Site down - SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to use

It looks like they have revoked your MySQL user's access to the database. IMO this sounds quite ridiculous as it is quite normal for Magento stores to have database that is over 1GB. 

 

If you are using cPanel, try seeing if you can add the database permissions back for the MySQL user. 

 

Alternatively, you may want to try creating a new MySQL user, assign the database to this user and update your app/etc/local.xml file to reflect the new user (don't forget to clear Magento caches for it to take effect). 

 

Once you gain access to your Magento Admin, be sure to setup Log Cleaning (System --> Configuration --> Advanced --> System --> Log Cleaning) if you haven't in order to reduce the size of your database. Make sure that you've setup the Magento Cron Job as it is required to run Log Cleaning.

James Lee | Moderator • Magento Master
See My Recommended Magento Hosting & Security Tips