Mysql ")" Is Not Valid at This Position, Expecting an Identifier

I need to import my mod-ap.sql file using the Reverse Engineering MySQL Create Script import command. When I go to do so I receive an error at two locations (10, 0) and (43, 0). Error: ")" is invalid at this position, expecting an identifier.

Lines 7-15;

DROP DATABASE IF EXISTS ap;
CREATE DATABASE ap;
USE ap;

CREATE TABLE IF NOT EXISTS vendors (
vendorID       INT          NOT NULL  PRIMARY KEY AUTO_INCREMENT, -- PG 551 : 1-2 per professor
vendorName     VARCHAR(45)  NOT NULL  UNIQUE,
vendorAddress  VARCHAR(45)  NOT NULL,
vendorCity     VARCHAR(45)  NOT NULL,

Lines 41 - 46

);

-- #2 create table called audit : 2.1-2.7 add columns
CREATE TABLE IF NOT EXISTS audit (
auditID                 INT           NOT NULL PRIMARY KEY AUTO_INCREMENT,
auditorFirstName        VARCHAR(45)   NOT NULL,   

*** Line 10 is empty

*** Line 43 is blocked out using a -- to comment

I've tried researching this issue and came up with a few bugs in workbench or specific words being reserved but nothing closely relating to this.

3

3 Answers

Could be you used in one line a hyphen (') for field name instead of backticks (`) or the other way round?

Remove any commas before the closing bracket )

This error could be because you have not specified the Table Names in both condition. Sometimes it is necessary to specify a table name because you need to refer to that table later in database

Your Answer

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

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest