Link to home
Start Free TrialLog in
Avatar of birwin
birwinFlag for Canada

asked on

Missing tables in mySQL database

I have a database that has worked flawlessly for several years. Yesterday, two tables were missing. I did not delete them. I have not worked on that database for a few weeks. The database is identical in structure to several other databases that are used concurrently by other users. The tables in the other databases were not affected.

I reread the PHP code of everything that accesses that table, there are no "drop" options.

The database is for a quiz. I can only assume that someone used some malicious input to kill my tables. I have strengthened my code to prevent inserts.

Is there a way to harden these tables, such as a superuser password for DROP?

Is it possible the tables were dropped due to a mySQL error?

Is there a software or service that will do archived backups (yesterday, last week, last month) that allow table level restore?
Avatar of Adrian Pop
Adrian Pop
Flag of Sweden image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of birwin


Thank you for this information.

I did not know about the REVOKE statement. That sounds like what I need.

Is there any downside to making REVOKE DROP universal? I have only one program that drops tables. It does that as a substitute for temporary tables, since I need to be able to see what is held in the table should the program fail. Is there a way to grant drop rights for a single table using PHP?

Also, do you have any experience actually backing up from the file created by automysqlbackup? I was hoping for something that would allow a table level backup. Do you know if that is possible with the backup created by this program?


Have you looked into the Event Viewer?
It might contain more information on
why the service cannot be started.

Start->Control Panel->Administrative Tools->Event Viewer
Look into Application for errors happening at about the time
you tried to start the service. You can also try to start the
service and then refresh the Event Viewer and look on what
events appeared in the meantime.


Sorry, the post before was the anwer for some other question.

"Is there any downside to making REVOKE DROP universal?"
- There might be if your program has to drop tables.

"Is there a way to grant drop rights for a single table using PHP?"
- Yes, just put as query: "grant drop on table to user@host":

"Also, do you have any experience actually backing up from the file created by automysqlbackup?"
- I backup the entire database with this program, but I think that it has
  options to backup only one table or several tables. Download the script
  and look at the options.

Ok, what I would do is:
1. Create a user that only has SELECT, INSERT, UPDATE and DELETE rights on
    all tables and use that user in my application.
2. Create another user that can also drop tables and use that user for the
    part of the application that needs to drop tables.
This way people cannot do wrong stuff with your tables.