Author Topic: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler  (Read 22985 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Hi, from some day to the next with out modifging anything i got this error, what i should do to fix it
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name FROM myspace_images i, myspace_categories c LEFT JOIN myspace_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (0) AND i.image_date >= 1134061441 ORDER BY RAND() LIMIT 3
Got error 122 from table handler

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #1 on: December 11, 2005, 06:45:23 PM »
Quote
#perror 122
OS error code 122:  Disk quota exceeded
contact your hoster
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #2 on: December 11, 2005, 06:49:24 PM »
i have virtual dedicated server and i can manage the server from the control panel like restart the server ans see the processes and things like that
is there any thing that i can do from my control panel?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #3 on: December 11, 2005, 07:09:35 PM »
The disk space is full, you'll have to delete someting to free up some.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #4 on: December 11, 2005, 08:15:07 PM »
hi i just called my hosting and they told me that my server logs are to big but i don't know where thos logs are
    Filename     Size     Last modified
   surfourspace.net_access_log    63 MB    12:03 PM
   surfourspace.net_access_log.1    4 GB    4:20 AM
   surfourspace.net_access_log.2    3 GB    Dec 4
   surfourspace.net_access_log.3    198 MB    Nov 27
   surfourspace.net_error_log    30 MB    12:03 PM
   surfourspace.net_error_log.1    2 GB    4:19 AM
   surfourspace.net_error_log.2    1 GB    Dec 4
   surfourspace.net_error_log.3    195 MB    Nov 27
im using winscp to try to find them
does anybody has a clue where to find those files?

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #5 on: December 11, 2005, 08:26:12 PM »
ok i found them thanks!
im relax now

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #6 on: December 11, 2005, 09:18:22 PM »
4gb log files? wow!
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re:
« Reply #7 on: December 11, 2005, 09:54:26 PM »
4gb log files? wow!

I see over 10 GB log files... *gggg*

@ascanio
Try a Log Rotaion Script which will zip your Log Files every Day...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #8 on: December 12, 2005, 03:33:15 AM »
Try a Log Rotaion Script which will zip your Log Files every Day...
rotatelogs ? the executible in apache/bin/ ?
I didnt know it can zip logs too :?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re:
« Reply #9 on: December 12, 2005, 07:51:58 PM »
it is the first time that im runing my own server so i don't know to much about this stuff ... next year im gonna take a course about server management hope it help
do u know any good webpage with tutorials or manuals about this stuff?

btw i got another error after i restart my server

Quote
DB Error: Bad SQL Query: SELECT u.*, l.* FROM myspace_users u, myspace_lightboxes l WHERE u.user_id = 1 AND l.user_id = u.user_id
Can't open file: 'myspace_lightboxes.MYD'. (errno: 145)

DB Error: Bad SQL Query: SELECT lightbox_id FROM myspace_lightboxes WHERE lightbox_id = 'f2a846e70f7e158e302d05022f9fdf1e'
Can't open file: 'myspace_lightboxes.MYD'. (errno: 145)

DB Error: Bad SQL Query: INSERT INTO myspace_lightboxes (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids) VALUES ('f2a846e70f7e158e302d05022f9fdf1e', 1, 1134413324, '')
Can't open file: 'myspace_lightboxes.MYD'. (errno: 145)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #10 on: December 12, 2005, 07:56:37 PM »
i guess i should drop myspace_lightboxes and create the table again?

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #11 on: December 12, 2005, 08:49:48 PM »
i try to login in the phpmyAdmin and i get this error:
Error

SQL query: DocumentationEdit

SELECT COUNT( * ) AS num
FROM `myspace`.`myspacetable`

MySQL said: Documentation
#1016 - Can't open file: 'myspacetable.MYD'. (errno: 145)

i can't even see my tables now :(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #12 on: December 13, 2005, 12:39:33 AM »
Ok, I asume you have SSH access.
Login as to your account through SSH, and type:
mysql -u username -p

(replace username with your database username
When prompted type your database password.

if login was successfull, you should see something like:
Quote
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13650 to server version: 4.1.15-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
You are now can manage your database there.

Next type:
connect databasename
(replace databasename with the name of database used by phpmyadmin)

Then, if no errors, type:
repair table myspacetable \g

If you see no error message, try login into your phpmyadmin, if it shows you simular error message but for another table, repeat the repair procedure for that table.

Same thing you can try to do to myspace_lightboxes table, only if the mysql can not repair it, then you'll need to delete it and create new one.

Good luck.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re:
« Reply #13 on: December 13, 2005, 04:41:20 PM »
Try a Log Rotaion Script which will zip your Log Files every Day...
rotatelogs ? the executible in apache/bin/ ?
I didnt know it can zip logs too :?

You can make a Cronjob for that and with a Shell Script it works fine with zip... (o:

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: DB Error: Bad SQL Query: SELECT ... Got error 122 from table handler
« Reply #14 on: December 13, 2005, 11:05:46 PM »
wowowowowowowowoowowowowowow
V@no ur the man!!!!!!!!!
it work!!!
omg u save me a lot of work!
this is what my host told me to and i almost did it ...
> After researching the issue(s) at hand, we have determined the following:
> Upon inspection of your database it appears to be corrupted. We recommend
> removing and recreating the database then importing the data to resolve this
> issue.

thank you so much V@no!! merry xmas to u