Forums / General Questions / Corrupt database, how can I replace it?

Corrupt database, how can I replace it?

Locked

Started by samesegfaultdifferentday on 21 Oct 2006, 12:02 PM · Views: 1,193

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
21 Oct 2006, 12:02 PM
#1
Join Date:
Mar 2006
Posts:
16
Plugin Contributions:
0

Corrupt database, how can I replace it?

Think I had a bad sector on my drive:

looks like the MYI for hydro_whos_online is corrupt?

any clues how I can replace it?

Many thanks.

1016 Can't open file: 'hydro_whos_online.MYI' (errno: 145)
in:
[delete from hydro_whos_online where time_last_click < '1161431208']

Seggie

~?>#segFault...

</div><table border=\'0\' align=\'center\' width=\'95%\' cellpadding=\'3\' cellspacing=\'1\'><tr><td>**QUOTE** </td></tr><tr><td id=\'QUOTE\'>**segmentation fault** - An error in which a running Unix program attempts to access memory not allocated to it and terminates with a segmentation violation error and usually a core dump.</td></tr></table><div class=\'signature\'>
21 Oct 2006, 1:31 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Corrupt database, how can I replace it?

Try doing a repair on the database via phpMyAdmin ...

If that does not work the table can be rebuilt with:

DROP TABLE IF EXISTS whos_online;
CREATE TABLE whos_online (
  customer_id int(11) default NULL,
  full_name varchar(64) NOT NULL default '',
  session_id varchar(128) NOT NULL default '',
  ip_address varchar(15) NOT NULL default '',
  time_entry varchar(14) NOT NULL default '',
  time_last_click varchar(14) NOT NULL default '',
  last_page_url varchar(255) NOT NULL default '',
  host_address text NOT NULL,
  user_agent varchar(255) NOT NULL default '',
  KEY idx_ip_address_zen (ip_address),
  KEY idx_session_id_zen (session_id),
  KEY idx_customer_id_zen (customer_id),
  KEY idx_time_entry_zen (time_entry),
  KEY idx_time_last_click_zen (time_last_click),
  KEY idx_last_page_url_zen (last_page_url)
) TYPE=MyISAM;

NOTE: if using database prefixes you would need to alter the table name from:
whos_online

to be:
yourprefix_whos_online

in two places before running that in the SQL box ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Nov 2006, 1:54 PM
#3
Join Date:
Mar 2006
Posts:
16
Plugin Contributions:
0

Re: Corrupt database, how can I replace it?

Thanks Ajeh, that worked great.

Really appreciate your help sir,

now I just need figure out how to upgrade to latest version ;)

peace and thanks.

Seggie

~?>#segFault...

</div><table border=\'0\' align=\'center\' width=\'95%\' cellpadding=\'3\' cellspacing=\'1\'><tr><td>**QUOTE** </td></tr><tr><td id=\'QUOTE\'>**segmentation fault** - An error in which a running Unix program attempts to access memory not allocated to it and terminates with a segmentation violation error and usually a core dump.</td></tr></table><div class=\'signature\'>
15 Nov 2006, 10:19 PM
#4
confusediam avatar

confusediam

New Zenner

Join Date:
Nov 2005
Posts:
27
Plugin Contributions:
0

Re: Corrupt database, how can I replace it?

Hi,
I am posting here as maybe I have a like database problem. When going to the store front (it isn't live, though) I get the following: (also the admin areas seem to be working except the catalog section which throws a lot of info at me but I am weak on Greek :-) )


1016 Can't open file: 'products.MYI'. (errno: 145)
in:
[select distinct m.manufacturers_id as id, m.manufacturers_name as name from products p, products_to_categories p2c, manufacturers m where p.products_status = 1 and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '0' order by m.manufacturers_name]

I have no knowledge of doing stuff in tables in mySql but if I know that this is most likely a database crash I can inquire of my server to take a look at that.

Also, anyone recommend any book on learning how to do things to the database as suggested above in a step-by-step fashion from where you do this and how not to screw it up? :-)

Thanks,
Rand

15 Nov 2006, 10:42 PM
#5
confusediam avatar

confusediam

New Zenner

Join Date:
Nov 2005
Posts:
27
Plugin Contributions:
0

Re: Corrupt database, how can I replace it?

Hello, again.
Just wanted to say it must have been a database crash, the server people 'rebuilt' or 'repaired' it and all seems okay now. I also inquired of them of any book about mySql and/or phpMyadmin panel that might help me do this stuff myself.
Thanks,
Rand