1
HopeL
Database Error
  • 2009/12/9 19:45

  • HopeL

  • Just popping in

  • Posts: 29

  • Since: 2009/8/21


Hello,
I use both backpack and backup modules to backup. All seemed to be running well until I tried to backup yesterday. Here is what I get when trying to backup with the backup module:
SHOW FIELDS FROM databasename.tableprefix_avatarTable './databasename/tableprefix_avatar' is marked as crashed and last (automatic?) repair failed

I know very little about databases or how to repair tables. I did go into phpMyAdmin but I don't know how to repair and the message in phpMyAdmin when viewing the avatar table is:
Error
SQL query: Documentation
SELECT *
FROM `tableprefix_avatar`
LIMIT 0 , 30
MySQL said: Documentation
#144 - Table './databasename/tableprefix_avatar' is marked as crashed and last (automatic?) repair failed

I have a recent backup and it shows all the dumping data and table structure for the avatar table. Is there a way for me to fix or restore the avatar table? The backup is not recent enough to use in other areas so I wouldn't want to restore with the entire backup - just the problem table.

The avatar table is the most important issue (I think) at the moment but I have found other issues as well such as a partial registration with no user profile. So the only thing in the database is the user but not their profile info. When I try to pull up the user ID in XOOPS admin, there is no info, as if the user does not exist. The good news is there has been a successful registration since then but I still have that incomplete user in the database and will need to know how to delete without issue.

There are other issues showing when I ran the TableCheck module. I suspect it has to do with either a recent server move and/or deletion of a large amount of users from the database.

I am running a XOOPS 2.2.4 site. Unfortunately, I cannot upgrade at this time but would like to in the future.
PHP version 5.2.10, MySQL version 5.0.67

I hope someone can help me soon as I cannot backup properly and fear the issues will get worse if I put it off much longer.

Thanks,
Hope

2
ghia
Re: Database Error
  • 2009/12/9 21:21

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


In the operations tab, there are some things you could try to repair it.

If that don't work: Open your backup of the database.
If you have saved it as SQL statements, then you find a line with
CREATE TABLE IF NOT EXISTS `xoops_avatar` (
  `
avatar_idmediumint(8unsigned NOT NULL auto_increment,
  `
avatar_filevarchar(30NOT NULL default '',
  `
avatar_namevarchar(100NOT NULL default '',
  `
avatar_mimetypevarchar(30NOT NULL default '',
  `
avatar_createdint(10NOT NULL default '0',
  `
avatar_displaytinyint(1unsigned NOT NULL default '0',
  `
avatar_weightsmallint(5unsigned NOT NULL default '0',
  `
avatar_typechar(1NOT NULL default '',
  
PRIMARY KEY  (`avatar_id`),
  
KEY `avatar_type` (`avatar_type`,`avatar_display`)
ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;
and then several
INSERT INTO `xoops_avatar` (`avatar_id`, `avatar_file`, `avatar_name`, `avatar_mimetype`, `avatar_created`, `avatar_display`, `avatar_weight`, `avatar_type`) VALUES
(1'cavt1234567891abc.jpg''Me''image/jpeg'010'C'),
(
2'cavt1234567890abc.jpg''You''image/jpeg'010'C'),
....;


You can delete the avatar table by the command drop table in phpMyAdmin
Then you can copy above gathered lines into the window of the SQL tab and execute them.
This should restore your table.

Other possibility is to only empty the table and then doing only the inserts. But as the table itself is not recreated, it may have less chance to complete recovery.

3
HopeL
Re: Database Error
  • 2009/12/10 1:07

  • HopeL

  • Just popping in

  • Posts: 29

  • Since: 2009/8/21


Thank you for your help ghia!
================

Edited reply to note - your suggestion worked! The avatar issue is solved.

My other issues are what was found in the table check module: problems with 3 users data and something about group perm id but I'm not sure how to deal with it yet or how to explain it.

Until then, thanks again for your help.

Hope

Login

Who's Online

126 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 126


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits