MySQL table deletion.
I have deleted (rm -rf) a bunch of tables from /var/lib/mysql/sites/. Now am not able to execute the same tables in to the sites db and able to execute if the table name got changed. Please help me to solve this issue, I need to use the same table with same table name for execution.
sample of deleted tables are listed below, site_field.frm site_field_instance.frm site_field_instance.MYD site_field_instance.MYI site_field.MYD site_field.MYI site_circular.frm site_circular.MYD site_circular.MYI site_allery.frm site_allery.MYD site_allery.MYI site_......... site_.........etc |
have you tried to stop my sql service? and check whether you can execute again the same table name.
or if it is okay to reboot the server please reboot it, because there could be some process that still points the old data. |
Quote:
The error file shows the below, Error Code: 1813 - Tablespace for table '`testtable`.`actions`' exists. Please DISCARD the tablespace before IMPORT. |
Quote:
|
looks like you need something like this:
alter table <tablename> discard tablespace; |
Quote:
There are 'n' number of tables, how to alter a group of tables. The db is having other tables too, so have to handle careful. |
I would say one by one, you need to collect all the names and create a script to do the work
(next time try to delete tables by drop table instead of removing files) |
Quote:
|
no, the problem is that you did not delete the bookings of those tables, just those files. You need to cleanup that booking now.
|
There is no way to get the data because it was physically removed from the server . The Only way is you can restore the backup and then you can get the data.
|
Quote:
|
*** UPDATE *** (Think before posting...)
pan64 has your answer in post #5,7. But you will have to login to the MySQL client - this is not a fielsystem issue. |
Quote:
Quote:
If i'm not wrong this is a MySQL issue not relating to Linux OS. :) |
Quote:
|
Quote:
But the difficulty for you is that it is not a 'file' that is blocking the recreation of the tables - it is the internal MySQL meta-data. SO there is really not a solution that can be performed from the filesystem. I think that you will need at minimum to do the following from within mysql client or from a script (for each affected table): Code:
ALTER TABLE... DISCARD TABLESPACE; |
All times are GMT -5. The time now is 08:19 PM. |