1

Exporting a table with 22,245 rows using TablePlus, after which TablePlus tells me "Export completed successfully".

If I create a new database and try to import the file I just exported, I get the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"transfers" (
  "pkey" int NOT NULL AUTO_INCREMENT,
  "timestamp" timestamp NOT ' at line 1

Perhaps it jumps on the reserved word timestamp but hey, if that same software created the export in the first place, shouldn't it know how to escape reserved words in the dump file that it just created?

Or is there something else at play here?

This is not the first issue I have with exporting and importing with TablePlus, I thought it was a pretty well renowned piece of software. Should I move to something different?

The same thing seems to happen with a completely different database. This time it has nothing to do with reserved words, I export a pretty standard AspNet webapp db and already on the first table there is an error thrown concerning the syntax:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"__EFMigrationsHistory" (
  "MigrationId" varchar(150) NOT NULL,
  "ProductVersi' at line 1

I am admonished to check the MySQL documentation for the correct syntax to use, but I did not create that syntax, the same software complaining about the syntax actually created the syntax a few minutes before =)

The SQL file starts out like this:

-- -------------------------------------------------------------
-- TablePlus 5.3.8(500)
--
-- https://tableplus.com/
--
-- Database: defaultdb
-- Generation Time: 2023-07-02 00:06:47.9090
-- -------------------------------------------------------------


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


CREATE TABLE "__EFMigrationsHistory" (
  "MigrationId" varchar(150) NOT NULL,
  "ProductVersion" varchar(32) NOT NULL,
  PRIMARY KEY ("MigrationId")
);

In this case both source databases are hosted with DigitalOceans service "database cluster", if it makes a difference =).

1 Answer 1

2

This guy seems to have resolved the issue:

https://www.yellowduck.be/posts/fixing-the-mysql-export-from-tableplus

DigitalOcean DBs by default have ANSI-QUOTES option on, whereas that is apparently not recommended, and not what my target DB was using either. Turning that off allowed me to move on =)

That guy deserves at least a coffe or two ;-)

1
  • You are allowed to tick your answer, I think there is a 24hr wait Jul 1, 2023 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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