Welcome Guest, Not a member yet? Register   Sign In
Creating indexes in mysql?
#1

[eluser]kyleect[/eluser]
I'm creating a users table with the following fields:

id
username
password
email
group
profile

'username' and 'email' are set as varchar, 255 length and as unique keys so multiple users can't register the same username or have more than one account with the same email address however I'm getting the following error message:

Code:
#1071 - Specified key was too long; max key length is 1000 bytes

I change username length to 20 and it works. Now, I could set the username to 20 and be fine as 255 was just a number because I would always change it later but I want to know why the error is coming up as sql is a weak link for me.


Messages In This Thread
Creating indexes in mysql? - by El Forum - 03-31-2009, 01:21 PM
Creating indexes in mysql? - by El Forum - 03-31-2009, 01:41 PM
Creating indexes in mysql? - by El Forum - 03-31-2009, 03:40 PM
Creating indexes in mysql? - by El Forum - 03-31-2009, 03:44 PM
Creating indexes in mysql? - by El Forum - 03-31-2009, 03:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB