Database Error

Doe anyone know how to fix this?



Database error: 145 : Table ‘./thewebsi_KatCart/cscart_sessions’ is marked as crashed and should be repaired

Invalid query: SELECT session_id FROM cscart_sessions WHERE session_id=‘b8a159839407e30e0fbc131164c6e29f’ AND expiry>‘1229124991’



Thanks in advance,



Kris

Yes, this has been discussed recently. With the few people that posted it seems to be a problem on the server side. Repair/optimize the database and contact your host to make sure there are no problems.

Well, I’m working on a local box and accidentally pulled the plug…“crash”…



Now, when I try to access my store I get this:

[quote]

Database error: 145 : Table ‘.\ncstore\cscart_sessions’ is marked as crashed and should be repaired

Invalid query: SELECT session_id FROM cscart_sessions WHERE session_id=‘491eb04948945a40ec64f077eed08eed’ AND expiry>‘1231881419’



Backtrace:

File: D:\Websites\NCStore\index.php

Line: 41

Function: require

File: D:\Websites\NCStore\init.php

Line: 121

Function: require

File: D:\Websites\NCStore\core\sessions.php

Line: 70

Function: sess_start

File: D:\Websites\NCStore\core\sessions.php

Line: 229

Function: _exists

File: D:\Websites\NCStore\core\sessions.php

Line: 132

Function: db_get_field

File: D:\Websites\NCStore\core\fn_database.php

Line: 92

Function: db_query

File: D:\Websites\NCStore\core\db_mysql41.php

Line: 72

Function: db_debug_error

[/quote]



As such I no longer have access to the front-end OR Admin…

Please help!



What/How do I do what I need to do to restore?

Is it possible? Please say YES :confused:



I’m a bit familiar with phpmyadmin but have no clue how to “Repair/optimize the database”



Thanks,

WebGuy

Hopefully your host will have backed up for you. You’ll have to access your server frpm the host side (cpanel or whatever) and look for back ups. If you find a recent database backup you can go into PHPAdmin and empty your database and import the back up.



As for the sessions problem, this table can be dozens of pages long. I usually truncate this table monthly or my host can get rather upset because it uses too much bandwidth when it gets too full.

[QUOTE]Hopefully your host will have backed up for you.[/QUOTE]



I was afraid you were going to say that…:cry:



It’s my local box so I am my own host and I did a backup last week :stuck_out_tongue:

So I’m outa luck…well I do have the “live” site so I can pull the database from that.

Which is not “perfect” but close enough…



Concerning:

[QUOTE]As for the sessions problem, this table can be dozens of pages long. I usually truncate this table monthly or my host can get rather upset because it uses too much bandwidth when it gets too full.[/QUOTE]



Can you explain this with a little more detail? I don’t want to run into a “sessions” issue, especially with the live site (and bandwidth)…what do I need to do to “truncate” the table?



Thanks for the help!

WebGuy

Ok nevermind I looked it up in google.

google “hint” use “define: truncate” (without the quotes) for definitions of words.


[QUOTE]In SQL, the TRUNCATE statement removes all the data from a table. The TRUNCATE statement is not actually a part of the SQL standard, but many relational database management systems implement it. A TRUNCATE my_table; it is equivalent in function to a DELETE FROM my_table; statement.[/QUOTE]



I don’t suppose there is an “automated process” for this?



Thanks,

WebGuy