Mysql - Alter table statement to create unique index on long text field

ALTER TABLE nextractor.tblhtml ADD UNIQUE INDEX uniqueindex_InnerHTML (InnerHtml (8000));


According to the MySQL docs, you need something like this:

alter table <table_name> 
  add unique index <index_name> (<column_name> (8000))

This is the relevant grammar:

| ADD [CONSTRAINT [symbol]]
        UNIQUE [INDEX|KEY] [index_name]
        [index_type] (index_col_name,...) [index_option] ...

and

index_col_name:
    col_name [(length)] [ASC | DESC]

Tags:

Mysql