Forum OpenACS Q&A: Please help on a Mysql basic issue

Posted by Alex Val on
In a unix/apache server, through a web-interface
I tried to define a table and get the following,
can you tell me where's the error?

Do you know what's wrong with this?

Database test2 - table table1
SQL-query :
CREATE TABLE `table1` (`tkey` INT(4) NOT NULL AUTO_INCREMENT, `tdate` DATE(10) NOT NULL, `ttext` CHAR(60) NOT NULL, INDEX (`tkey`))

MySQL said:
You have an error in your SQL syntax near '(10) NOT NULL, `ttext` CHAR(60) NOT NULL, INDEX (`tkey`))' at line 1

Posted by John Pickett on
Not quite sure why you're posting this here?  OpenACS doesn't run on MySQL...  Either way, I'm not 100% sure, but I don't think you need to specify the (10) size for the date data type.  just say 'tdate' date not null, etc...

The MySQL docs don't say there's an optional length to the date type, so I'm guessing that's where the problem is (especially since that's where the error points to).