PDA

View Full Version : MySQL Error Nr. 1064 When Creating Table???


dealmaker
11-16-2005, 07:12 PM
Hi,
I am using Mysql-query-browser(mysql gui from mysql.com) to create a table.

CREATE TABLE `mydb`.`mytable` (
`client` INT(11) UNSIGNED NOT NULL,
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR NOT NULL,
`description` VARCHAR NOT NULL,
`url` VARCHAR NOT NULL,
`keywords` TEXT NOT NULL,
PRIMARY KEY(`id`)
)
ENGINE = MYISAM;


But I keep getting the following error message:

Error executing SQL commands to create table.
MySQL Error Nr. 1064
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 'NOT NULL,
`description` VARCHAR NOT NULL,
`url` VARCHAR NOT NULL,
`keywo' at line 4


Do you know why? How to fix it?
Many thanks.

dealmaker
11-17-2005, 01:22 AM
mysql-query-browser sucks. I used phpMyAdmin and did the same thing and it worked without problem.

Kid Charming
11-17-2005, 05:06 AM
The problem with your CREATE statement as posted is that you're not specifying a length for your VARCHAR columns. I'm not familiar enough with the query-browser GUI, though, to say where you'd do that.