Benjamin Pflugmann wrote:
> First about that missing row:
> First check how many rows you get by doing "SELECT * FROM checking":
select * from checking;
390 rows in set (0.02 sec)
select count(*) from checking;
> [I am not sure if you meant this when you said you checked this with
> the command line client: Did you "SELECT *" or "SELECT COUNT(*)"?].
> If it is 379, you definitely have a corrupted index or table, since
> "SELECT *" or "SELECT COUNT(*)" are showing differnt results.
> If it is 380, you have a row in the result set, where neither
> ($row[credit]<>0) nor ($row[debit]<>0) is true. In that case, your
> conditions in the while clause just do not trigger anything. (You
> could have checked out easily even without mysql_num_rows by adding
> another counter just for the number of loops your program stays in the
> while clause.)
Whoops, one row, in May, where I voided a transaction. Probably should
have placed a correcting entry. No matter. Data is still getting
Good catch, Benjamin. My eyes missed it, but, went right there when you
> Now about the corrupted table:
> You did not mention how you replicated the database on the second
> server, by copying the binary files or by dumping and inserting SQL
> statements? If you copied the binary data and something was corrupt,
> the replicated database will also be corrupt, of course.
mysqldump -u -p -hotherhost dbase | \
mysql -u -p dbase
> It sounds quite strange to me, that MySQL would corrupt new created
> Could you try to run isamchk -e (without -R1,R2). If an index is
> corrupt, I guess there is a good chance that the -R option will do
> even more damage (ordering according to an corrupt index!).
> I would suggest, that you dump your entire table with mysqldump. Look
> how many INSERT statements you get. Then drop the table, and use the
> mysql command line client to execute the dumped statements. Check if
> your problem is gone then.
Will try this. Perhaps will correct it.
Thanks, mucho Benjamin. You've given me a little perspective. I'm
getting data in there and getting it to stay, but, I have to do a
mysqladmin refresh after every insert. Not good. There's something
wrong in there.
Linux rocks!!! http://www.dedserius.com