0

I am working with a SQL database on a Ubuntu LAMP server. I am attempting to create a new database then a new table in it, which can hold blobs. I can login, create my database, use it, but then I cannot create the table. I am doing:

$mysql -u root -p mypass
mysql> use frame;
Database changed
mysql> create table 'frame_info' ( 'frame_data' BLOB NOT NULL, 'frame_name' VARCHAR(45) NULL, 'creator_name' VARCHAR(45) NULL, PRIMARY KEY ('frame_data'));

From there, I get the error:

ERROR 1064 (4200): You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to user near ''fram
e_info' ( create table 'frame_info' ( 'frame_data' BLOB NOT NULL, 'frame_na' at 
line 1

Obviously that error is truncated by the mysql display, but you get the gist.

1 Answer 1

1

You should use backticks ` instead of single quotes ' or (in your case) you can succeed without them at all :

 create table `frame_info` (
     `frame_data` BLOB NOT NULL,
     `frame_name` VARCHAR(45) NULL,
     `creator_name` VARCHAR(45) NULL,
      PRIMARY KEY (`frame_data`)
 );
Sign up to request clarification or add additional context in comments.

1 Comment

Fantastic! I should have caught that. Thanks a ton!

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.