1

One of our database table tblpages seems to be corrupted. When I select the table, its says

show full fields from `favc`.`tblpages`
Table 'tblpages' doesn't exist

So I thought repairing it will be possible. I run a repair on the table and got this unsuccessful message.

tblpages                    repair  Warning   InnoDB: Tablespace is missing for table 'tblpages'
tblpages                    repair  Error     Table 'tblpages' doesn't exist                    
tblpages                    repair  status    Operation failed    

I don't have any latest copy of this table. Please help with any advise you may have. Thanks!

2
  • Are you using Innodb file per table? If so please check the filesystem for the favc/tblpages.ibd file. Are you making backups of your data? Can you restore it to another server, roll it forward using binary logs then dump the table out logically. – eroomydna Jan 15 '14 at 21:13
  • Okay, Let me try that. – Navneil Naicker Jan 15 '14 at 21:20
1

in my case I could simply fix the table-space-missing problem by:

cd /var/lib/mysql/psa/
cp -a ModuleSettings.ibd.bak ModuleSettings.ibd

psa.ModuleSettings was the table which gave me «#1812 table space is missing»-erros.

3
  • 3
    this is not a solution..it is not working – simplifiedDB Oct 18 '17 at 12:29
  • Not every solution could work for every system. – Fusca Software Nov 7 '17 at 15:00
  • 1
    It does work. The only downside is, If the table space is taken from a backup the data will reset to the table space of the backup and the new data will be lost. Still better than losing everything. – f_i Oct 31 '20 at 14:36
1

"Tablespace is missing for table XXXX”

There are broadly three ways in which this error can happen:

  1. Table files have the wrong ownership/permissions
  2. The table file is misplaced
  3. The data file is corrupted or deleted

in my situation was: 1 - wrong permission, after hard copy/

other solutions can be found here: https://bobcares.com/blog/mysql-tablespace-is-missing-for-table/

0

In this error case, first check if the tablespaces i.e the files that have the table data exists in the path

  1. In my case i had the tablespaces exist
$ cd {path_to_mysql_installation}/mysql/data/{db_name}/
MyTable1.ibd MyTable2.ibd
  1. Check Permission for the files
$ ls -l
-rw-r-----@ 1 vivek  884470207  114688 Apr 10 08:40 MyTable1.ibd
-rw-r-----@ 1 vivek  884470207  114688 Apr 10 08:40 MyTable2.ibd

(My permissions got modified, not sure how)

  1. Reset the permissions to the whole data directory

$ chmod -R 755 ../../data

Now tried accessing the data from mysql console and from java application, it worked perfectly fine.

Please note i'm answering only the permission problem, for file correction or missing check out the solutions here .

Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.