1
#!/bin/bash

mysql -h 172.17.0.1 -P 13306 -u root -p123<<MYSQL_SCRIPT

USE 1DB;

        CREATE TABLE 111 (
        ID              TEXT,
        TEST_CASE       TEXT
        );

        INSERT INTO 111 (ID, TEST_CASE)
        VALUES ("111", "111");

MYSQL_SCRIPT

when run this script, bash returns:
ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '111 ( ID TEXT, TEST_CASE TEXT )' at line 1

1 Answer 1

2

Possibly look at this answer - Are you allowed to use numbers as table names in MySQL? - and more specifically the line 'Identifiers may begin with a digit but unless quoted may not consist solely of digits.'

You could try this:

USE 1DB;

    CREATE TABLE '111' (
    ID              TEXT,
    TEST_CASE       TEXT
    );

    INSERT INTO '111' (ID, TEST_CASE)
VALUES ("111", "111");

MYSQL_SCRIPT
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.