Whereas category.install declares:
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {category} (
cid int(10) unsigned NOT NULL default '0',
cnid int(10) unsigned NOT NULL default '0',
description longtext NOT NULL default '',
weight tinyint(4) NOT NULL default '0',
depth tinyint(4) NOT NULL default '0',
PRIMARY KEY (cid),
KEY tid (cnid),
KEY weight (weight)
) /*!40100 DEFAULT CHARACTER SET utf8 */
");
MySQL 5.2 (command line) told me that 'description longtext' could not declare a default value, had to add table manually w/out the default to install w/out throwing an error.
kwt
Comments
Comment #1
bdragon commentedI don't think MySQL 5.2 is even out yet.
I'd file it as a bug against MySQL, as it would be crazy to not allow default '' on a longtext...
Comment #2
1kenthomas commentedThanks for the response and sorry for the typo, mySQL is v5.0 (5.2 is in alpha).
A Google search shows this general kind of table creation error to come up frequently with Drupal installations. As I don't know what is causing it, or if there is a solution other than manually creating the table w/out the default, just wanted to make someone aware.
kwt
Comment #3
abramo commentedtip: check that MySql is not configured for "Strict" operation - this frequently causing such complications.
Comment #4
WorldFallz commentedjust a poke to say I just installed mysql/drupal/category today and encountered this same problem. It does indeed seem to be related to the "strict" setting which is enabled by default in the current version of mySQL. And drupal/category is not the only open source sw that it causes problems. I'm disabling it for the time being.
to disable, find "my.ini" in the mySQL program folder and prepend the line that begins with "sql-mode=" with a # to comment it out.
if you've already installed the category module, you can fix the error by creating the table manually:
1. login to mysql: mysql -u [your-username] -p
2. switch to the mysql drupal db: use [your-drupal-db-name]
3. copy the following and paste into the mysql command prompt:
CREATE TABLE category (cid int(10) unsigned NOT NULL default '0',
cnid int(10) unsigned NOT NULL default '0',
description longtext NOT NULL,
weight tinyint(4) NOT NULL default '0',
depth tinyint(4) NOT NULL default '0',
PRIMARY KEY (cid),
KEY tid (cnid),
KEY weight (weight)
);
sorry if this seems like basic stuff, but i'm new to WAMP/LAMP/WIMP and this took me over an hour to figure out. hopefully, this will save someone else some time.
Comment #5
bdragon commentedYikes.
Happened on my test site just now.
Fix committed to DRUPAL-5 and HEAD.
Sorry about the delay :-/
Comment #6
bdragon commentedComment #7
(not verified) commented