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

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]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)