Description:
when trying to create the following table I get an error.
MySQL said: 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 'group,user) DEFAULT group NOT NULL, part varchar(50), p
CREATE TABLE permissions (
id int(11) DEFAULT 0 NOT NULL,
id_type enum(group,user) DEFAULT group NOT NULL, <---error this line
part varchar(50),
perm set(read,delete,modify,add)
);
so then I tried and it worked.
CREATE TABLE permissions (
id_type enum('group','user') not null default 'group'
);
Next step I tried and it did not work.
CREATE TABLE permissions2 (
id integer not null default 0
, id_type enum('group','user') not null default 'group'
);
Error
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 'default0, id_type enum( 'group', 'user' ) NOT NULL
DEFAULT
notice is says "default0" -- it has lost the space between default and 0
How to repeat:
Try to create this table.
CREATE TABLE permissions (
id int(11) DEFAULT 0 NOT NULL,
id_type enum(group,user) DEFAULT group NOT NULL, <---error this line
part varchar(50),
perm set(read,delete,modify,add)
);
Suggested fix:
unknown, maybe different column names, in different orders, until you find
one combo that takes.