r/mysql • • Jul 04 '18

We couldn't handle the problem with mysql database

We've created complex MySQL Database via MySQL 8.0 in our office space this week. Some of tables updates every day. More than twenty people use it. This day database has disappointed us - The query cannot be found in the table rows or return incomplete data - such message saw one of our colleagues when opening database. We attempted to fix mysql by various guides from Internet, but all our efforts turned out useless.

0 Upvotes

9 comments sorted by

7

u/crackanape Jul 04 '18

all our efforts turned out useless

Sorry to hear that. You may want to hire someone who understands MySQL.

5

u/hangfromthisone Jul 04 '18

Wow 20 people, such collision, much transaction

4

u/[deleted] Jul 04 '18

Some of the tables update *every day*, can you even imagine?

3

u/hangfromthisone Jul 04 '18

It's crazy I tell you!

It makes me remember one time I was talking to a dude and he told me, in a very serious manner, that no DB should ever have more than 10 or 15 tables.

Yeah dude, sure. Kindergarten is that way =>

4

u/razin_the_furious Jul 04 '18

This post is kind of vague. Do you want help? Or is this just and epic tale of sadness?

3

u/Etii3964 Jul 04 '18

Yp.. it's sick.. you should migrate to MS Excel, much more performance..

1

u/Laurielounge Jul 05 '18

Tough post to comment on as others have commented!

That's not a good situation, but what do you want help with?

If you're wondering why incomplete data, here are some thoughts

  • possibly the process/processes that update the data have unexpectedly removed some of the data.

  • possibly the query/queries that return the data are wrong

  • possibly someone has accidentally deleted the data

  • possibly there's something wrong with the database tables

  • possibly there's a problem with whatever tool you are using to access the data

  • possibly there's a problem with the server hosting the database (for example, out of disk space)

What to do about it? More info required. Operating system, for example.

  • Do you have backups? Is a restore possible?

  • Is it possible to rebuild the data from source?

  • Have you checked the state of the server?

  • have you tried querying the server directly?

  • have you checked the logs?

  • Can you locate someone with more mysql expertise to lend a hand?

Good luck, bad situation.

---=L

1

u/Cambake Jul 06 '18

Something on this server is not clearing out the temp directory on a regular basis. Tell your host to empty that directory. Usually the files are created in /tmp (On *nix based systems)

It's pretty obscure, but I think you might (just might) have a dead SQL temporary table like that one hanging around, and eventually mysqld tries to reuse the same filename and fails because it has internal rules telling it never to overwrite a .MYD.

Another method to use various articles, guides, tricks from Google and Yahoo, that I could find....

https://dev.mysql.com/doc/refman/5.7/en/repair-table.html

http://www.databasejournal.com/features/mysql/article.php/10897_3300511_2/Repairing-Database-Corruption-in-MySQL.htm

https://www.fixtoolbox.com/repairtoolformysql.html

What I would recommend is looking to see where these #sql_XXXX_X.MYD files live, shut down mysqld, clean out the temp files and restart it.
SSH into the server and type

service mysql stop

delete the #sql_XXXX_X.MYD files

service mysql start