Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
I have restarted the service and rebooted the machine too, but the issue is persisting.
The error file shows the below,
Error Code: 1813 - Tablespace for table '`testtable`.`actions`' exists. Please DISCARD the tablespace before IMPORT.
I have restarted the service and rebooted the machine too, but the issue is persisting.
The error file shows the below,
Error Code: 1813 - Tablespace for table '`testtable`.`actions`' exists. Please DISCARD the tablespace before IMPORT.
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)
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)
Thank you very much, I manually deleted the files so thought it is possible to trouble shoot from Linux file system itself, without logging in to MySQL db.
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.
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.
I am not worried about the data, at least take an effort to read my issue before replying. Its just a kind information for you, will help you in future.
But you will have to login to the MySQL client - this is not a filesystem issue.
agree this is not a filesystem issue, I think when the MySQL is run. It is trying to find a file which does not exist anymore on the particular location.
Quote:
I have deleted (rm -rf) a bunch of tables from /var/lib/mysql/sites/
Files were deleted, but not the reference in the database.
If i'm not wrong this is a MySQL issue not relating to Linux OS.
Last edited by JJJCR; 12-12-2013 at 11:23 PM.
Reason: edit
If you have removed the files you should be able to use (for example)...
Code:
DROP TABLESPACE site_field ENGINE...
Then you can recreate the tables with a CREATE TABLE statement.
Be sure that you have the table structure or pre-made CREATE TABLE statements or are restoring them from a dump of some sort.
This is a nice tip, but in my case I have tables backup, I want to restore it on the same db. It doesn't allow to restore the same tables because deleted manually from /var/lib/mysql/site/. There is a chance of current user’s session id and the batch id to be present there. But service restart and reboot is not a solution for this. Could you help me to trace which files still block me to restore the tables.
This is a nice tip, but in my case I have tables backup, I want to restore it on the same db. It doesn't allow to restore the same tables because deleted manually from /var/lib/mysql/site/. There is a chance of current user’s session id and the batch id to be present there. But service restart and reboot is not a solution for this. Could you help me to trace which files still block me to restore the tables.
I had thought that through and updated my above post earlier.
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;
DROP TABLE...
CREATE TABLE (from table spec) OR restore from backup dump.
You can do that without restarting the MySQL server, but not without access to the mysql client, or the ability to run it as a script on the affected server.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.