J0celyn / ibd2mysql

MIT License
5 stars 2 forks source link

: SQLSTATE[HY000]: General error: 1812 Tablespace is missing for table #3

Open maczkojanos opened 1 month ago

maczkojanos commented 1 month ago

Hello,

your script a livesaver, but i run into a problem: sdi and sql phase is succesfull, repair run into this problem. I tried different databases, but same error.

mysql Ver 8.0.37-0ubuntu0.22.04.3 for Linux on x86_64 ((Ubuntu)) php -v : PHP 8.0.30 (cli) (built: Jun 6 2024 16:51:07) ( NTS )

[2024-07-13 16:39:43] Creating database 'aleves'
[2024-07-13 16:39:43] Database: aleves ; creating table: wp_wpgmza_polylines
[2024-07-13 16:39:43] Deleting the newly created tablespace
[2024-07-13 16:39:43] Copying old IBD files
[2024-07-13 16:39:43] wp_wpgmza_polylines.ibd
[2024-07-13 16:39:43] Importing the old tablespace
PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1812 Tablespace is missing for table `aleves`.`wp_wpgmza_polylines`. in /home/maczkoef/ibd2mysql/src/Repair.php:85
Stack trace:
#0 /home/maczkoef/ibd2mysql/src/Repair.php(85): PDO->query()
#1 /home/maczkoef/ibd2mysql/src/Repair.php(55): j0celyn\ibd2mysql\Repair->repairTable()
#2 /home/maczkoef/ibd2mysql/convert.php(53): j0celyn\ibd2mysql\Repair->repairTables()
#3 {main}
  thrown in /home/maczkoef/ibd2mysql/src/Repair.php on line 85
J0celyn commented 1 month ago

Hi maczkojanos, here are a few things to check:

Are you running this script using the same MySQL version used to create the IBD files you want to recover? This is highly advised to avoid issues or fatal errors.

Is your MySQL server configured with innodb_file_per_table setting?

Were you able to recover at least one table, or does it fail with the same error for other tables? (you can temporarily move other files outside of the OUTPUT_DIR directory)

After running the script, can you confirm the file wp_wpgmza_polylines.ibd was copied to MYSQL_DATA_DIR?

Is the table wp_wpgmza_polylines.ibd using partitions? (you can open wp_wpgmza_polylines.sql in a text editor and search for PARTITION or PARTITIONS keywords)