Jump to content

Blob text + Key lenght?


Recommended Posts

Hi guys!

 

(I hope this is appropriate for this forum, if not, feel free to kick me out)

 

I'm moving my blog from one host to another. I'm using PHP myAdmin and mySQL 5. All is good except the only thing I can't import is my former posts. Looks like there is trouble with the CREATE Table syntax, I used mySQL 4 with my last host. I get this error code:

 

#1170 - BLOB/TEXT column 'post_content' used in key specification without a key length

 

And this is some of the text I'm trying to import:

 

CREATE TABLE `wp_posts` (

  `ID` bigint(20) unsigned not null auto_increment,

  `post_author` bigint(20) unsigned not null default '0',

  `post_date` datetime not null default '0000-00-00 00:00:00',

  `post_date_gmt` datetime not null default '0000-00-00 00:00:00',

  `post_content` longtext not null,

  `post_title` text not null,

  `post_excerpt` text not null,

  `post_status` varchar(20) not null default 'publish',

  `comment_status` varchar(20) not null default 'open',

  `ping_status` varchar(20) not null default 'open',

  `post_password` varchar(20) not null,

  `post_name` varchar(200) not null,

  `to_ping` text not null,

  `pinged` text not null,

  `post_modified` datetime not null default '0000-00-00 00:00:00',

  `post_modified_gmt` datetime not null default '0000-00-00 00:00:00',

  `post_content_filtered` text not null,

  `post_parent` bigint(20) unsigned not null default '0',

  `guid` varchar(255) not null,

  `menu_order` int(11) not null default '0',

  `post_type` varchar(20) not null default 'post',

  `post_mime_type` varchar(100) not null,

  `comment_count` bigint(20) not null default '0',

  PRIMARY KEY (`ID`),

  KEY `post_name` (`post_name`),

  KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`),

  KEY `post_parent` (`post_parent`),

  KEY `yarpp_title` (`post_title`),

  KEY `yarpp_content` (`post_content`),

  KEY `crp_related` (`post_title`,`post_content`),

  KEY `crp_related_title` (`post_title`),

  KEY `crp_related_content` (`post_content`)

 

I did try to change the "`post_title` text not null" to " post_title` bigint (20)" and the same error just skipped to the next line. I have no idea if it's a good idea to change it like this?

 

If anyone has any ideas what I could do, I'd be forever grateful!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.