1

Manually creating a table while in mariadb console;
got the following error:

MariaDB [mysql]> CREATE TABLE learningdb(command varchar(255) text2disp varchar(255));

ERROR 1064 (42000): 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 'varchar(255))' at line 1

MariaDB [mysql]> CREATE TABLE learningdb(command varchar(2048) text2disp varchar(2048));

ERROR 1064 (42000): 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 'varchar(2048))' at line 1

Cannot find out the correct syntax.

2
  • Have you tried separating each field declaration by a comma? tutorialspoint.com/mariadb/mariadb_create_tables.htm I'm no MariaDB expert but I guess that you need a primary key too. Commented Jun 12, 2018 at 7:03
  • Isn't this pretty much the definition of a typographical error? Commented Jun 12, 2018 at 11:46

1 Answer 1

2

Dont you think a comma separator is required between each of type definition!?

Example:

CREATE TABLE learningdb(command varchar(255),  -- <--- this comma was missing
                        text2disp varchar(255));

Refer to Documentation:

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.