phpmyadmin / phpmyadmin/phpmyadmin
Error while exporting a database with tables that cannot be read
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 7.9k
- Forks
- 3.6k
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 36
Description
Describe the bug
If a table is created with a different version of MySQL, and if it says that it's in use, the database isn't exported successfully. Both 5.2.1-dev and 5.3.0-dev are affected.
To Reproduce
Steps to reproduce the behavior:
- Have a table that cannot be read (in use).
- Export database
- See error
Expected behavior
The database should be exported successfully, except the table that cannot be read.
Screenshots

Server configuration
- Operating system: Windows 10
- Web server: nginx/1.23.3
- Database version: 5.7.40 - MySQL Community Server (GPL)
- PHP version: 8.2.1
- phpMyAdmin version: 5.2.1-dev, 5.3.0-dev
Additional context
5.2.1-dev
CREATE TABLE `tbl_test` (
`id` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
<div class="alert alert-danger" role="alert"><strong>Internal error</strong> in .\libraries\classes\Plugins\Export\ExportSql.php#1532<br>
<img src="themes/dot.gif" title="" alt="" class="icon ic_s_error"> ErrorException: Error reading structure for table db_test.tbl_test1: #1033 - Table &#039;.\db_test\tbl_test1.frm&#039; was created with a different version of MySQL and cannot be read<br>
<br>
<strong>Backtrace</strong><br>
<br>
</div></body></html>
5.3.0-dev
CREATE TABLE `tbl_test` (
`id` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
<div class="alert alert-danger" role="alert"><p><strong>Internal error</strong> in .\libraries\classes\Plugins\Export\ExportSql.php#1417</p><img src="themes/dot.gif" title="" alt="" class="icon ic_s_error"> ErrorException: Error reading structure for table db_test.tbl_test1: #1033 - Table &#039;.\db_test\tbl_test1.frm&#039; was created with a different version of MySQL and cannot be read<p class="mt-3"><strong>Backtrace</strong></p><ol class="list-group"></ol></div>
</body></html>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libraries/classes/Plugins/Export/ExportSql.php, especially the export paths around the reported lines, and reproduce the failure with a table that cannot be read. Trace how the unreadable table error is handled during database export; done means the export completes while excluding that table, without producing the internal error shown in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100