Skip to content

CHECK_TARGET_DB #4

@gregoriopellegrino

Description

@gregoriopellegrino

In my MySQL installation, I receive an error when it is executed (line 1568):

CHECK_TARGET_DB=$(mysql -h "$TARGET_DB_HOST" -P "$TARGET_DB_PORT" -u "$TARGET_DB_USER" -p"$TARGET_DB_PASS" -e "USE \"${TARGET_DB_NAME}\";" 2>&1)

I receive:

Checking target DB...mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1064 (42000) at line 1: 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 '"my-db"' at line 1

The problem seems to be the use of " in USE \"${TARGET_DB_NAME}\";. Removing them works without any problems:

CHECK_TARGET_DB=$(/Applications/MAMP/Library/bin/mysql -h "$TARGET_DB_HOST" -P "$TARGET_DB_PORT" -u "$TARGET_DB_USER" -p"$TARGET_DB_PASS" -e "USE ${TARGET_DB_NAME};" 2>&1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions