From: Sasha Pachev Date: April 20 1999 6:55pm Subject: Re: Problem with create unique index List-Archive: http://lists.mysql.com/mysql/2132 Message-Id: <371CCD94.CF7EC5D3@direct1.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Miguel Oliveira wrote: > > Hello, > > I'm trying to create an unique index like this (to avoid login duplicates): > > CREATE UNIQUE INDEX alias_index ON users(alias) > > I always get this answer from mysql: > > Couldn't create the alias index on the users table! (Column 'alias' is > used with UNIQUE or INDEX but is not defined as NOT NULL) > > I've this working in an older version of mysql. At home i'm using 3.22.19b > and gives me that error. > > regards, > Miguel Oliveira > > E-mail: mailto:miguel@stripped > URL: http://sweet.ua.pt/~miguel > PGP key: finger://miguel@stripped alter table users change alias alias char(16) not null you may have to change char(16) to what is appropriate for you -- Sasha Pachev http://www.sashanet.com/ (home) http://www.direct1.com/ (work)