Page 1 of 1

Mysql Database table problem

Posted: Fri Sep 05, 2008 3:53 am
by arunkar
Hi,

Im getting this error: "Got error 127 from storage engine"

then when we clicked on "Check table" on PhpMyAdmin, then we got new error:

"Error
SQL query:
SELECT COUNT( * ) AS num
FROM `buy1give1free`.`tbl_Reminders`
MySQL said:
#1016 - Can't open file: 'tbl_Reminders.MYI' (errno: 145)
"

Could you help us with a solution to overcome this please?

Thanks

Re: Mysql Database table problem

Posted: Fri Sep 05, 2008 4:13 am
by arunkar
Thanks Guys I got it resolved by running a repair on the table using PhpMyAdmin.

Re: Mysql Database table problem

Posted: Fri Sep 05, 2008 5:20 am
by onion2k
It might be worthwhile having a look at the query log (if you're using it) to see if there was a query that corrupted the table.

Re: Mysql Database table problem

Posted: Fri Sep 05, 2008 7:25 am
by arunkar
Ya I think this query has currupted the table, but Im nost sure how to rectify the code to make it fine. Every time this code is executed, I get "Got error 127 from storage engine" error

This is the query where I update and Insert the record into table tbl_Reminders

Code: Select all

 
    $queryUpdateRem ="UPDATE tbl_Reminders set ReminderStatus='1', DateModified='$today4' WHERE ReminderID='$ReminderID' ";
    mysql_query($queryUpdateRem) or die('<br>Oops Database Error, Please contact your hosting company '. mysql_error());
    echo "queryUpdateRem ".$queryUpdateRem."<br /><br />";
 
    $queryInsertRem ="INSERT INTO tbl_Reminders (ProjectID, JosUserID, ReminderDate, DateCreated, EmailID) VALUES ('$ProjectID', '$JosUserID', '$nextReminderDate', '$today4', '$EmailID') ");
    mysql_query($queryInsertRem) or die('<br>Oops Database Error, Please contact your hosting company '. mysql_error());
    echo "queryInsertRem ".$queryInsertRem."<br /><br />";
 
 

This is the data:

Code: Select all

queryUpdateRem UPDATE tbl_Reminders set ReminderStatus='1', DateModified='2008-09-05 6:21:25' WHERE ReminderID='184'
 
queryInsertRem INSERT INTO tbl_Reminders (ProjectID, JosUserID, ReminderDate, DateCreated, EmailID) VALUES ('6984', '703', '2008-10-05 6:21:25', '2008-09-05 6:21:25', '3')
 
Every time I the page runs this code I get this error. Got error 127 from storage engine

This is my table structure:

Code: Select all

 
ReminderID      int(11)     NULL               PRI     (NULL)   auto_increment  select,insert,update,references                                                             
ProjectID       int(11)     NULL       YES             (NULL)                   select,insert,update,references  Linked to Project table ID                                 
JosUserID       int(11)     NULL       YES             (NULL)                   select,insert,update,references  User to be reminded                                        
ReminderDate    date        NULL       YES             (NULL)                   select,insert,update,references                                                             
DateModified    date        NULL       YES             (NULL)                   select,insert,update,references                                                             
DateCreated     date        NULL       YES             (NULL)                   select,insert,update,references                                                             
ReminderStatus  tinyint(4)  NULL       YES             0                        select,insert,update,references  0 = not sent 1=sent                                        
EmailID         int(11)     NULL       YES             (NULL)                   select,insert,update,references  Reminder Email Key to be sent linked to ReminderEmail Table
 
When I repair this is Msg I get

Code: Select all

 
Table                             Op      Msg_type                      Msg_text
buy1give1free.tbl_Reminders     repair  info            Wrong bytesec:   5-  0- 29 at 188; Skipped
buy1give1free.tbl_Reminders     repair  info            Wrong bytesec:   1-  0- 29 at 244; Skipped
buy1give1free.tbl_Reminders     repair  warning     Number of rows changed from 11 to 9
buy1give1free.tbl_Reminders     repair  status  OK
 
Any way I could solve this? Any Ideas and suggestions.


thanks

Re: Mysql Database table problem

Posted: Fri Sep 05, 2008 8:22 am
by onion2k
The only thing I can see wrong is that you're trying to insert a datetime (eg '2008-10-05 6:21:25') into a date column. I wouldn't have thought that would break the table though.

Re: Mysql Database table problem

Posted: Sun Sep 07, 2008 5:04 am
by arunkar
I changed my datetype to datetime. But that did not help I still got the error 'Got error 127 from storage engine'... after hours of breaking my head I got a solution,

I changed table engine from MyISAM to INNODB and finally the problem seems to be fixed.

Thanks onion2k...


cheers