Reputation: 37
I am try to execute the below SQL and it is given the error above
CREATE TABLE IF NOT EXISTS `oic_assemblyman_data` (
`id` bigint( 100 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`firstname` varchar( 300 ) COLLATE utf8_unicode_ci NOT NULL ,
`lastname` varchar( 300 ) COLLATE utf8_unicode_ci NOT NULL ,
`email` varchar( 300 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`phone` varchar( 300 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`office_latitude` varchar( 20 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`office_longitude` varchar( 20 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`website_welcome_address` text COLLATE utf8_unicode_ci,
`website_header_color` varchar( 15 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`website_footer_color` varchar( 20 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`about_yourself` text COLLATE utf8_unicode_ci NOT NULL ,
`password` varchar( 100 ) COLLATE utf8_unicode_ci NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE KEY `email` ( `email` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci;
Could someone point out what is causing the problem
Upvotes: 1
Views: 9109
Reputation: 1346
change your email to varchar(255) should works. i think it using utf-8 encoding which max 3 bytes per character, then 767/3=255...2 so you can set max length to 255
Upvotes: 4