MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL Error 1170 (42000): BLOB / TEXT Coluna Utilizado em Key Especificação Sem uma chave Comprimento

When creating a new table or altering an existing table with primary keys, unique constraints and indexes, or when defining a new index with Alter Table manipulation statement in MySQL database, the following error may occur and prohibit the the command from completing: Ao criar uma nova tabela ou modificar uma tabela existente com chaves primárias, únicas restrições e índices, ou quando a definição de um novo índice com ALTER TABLE manipulação declaração no banco de dados MySQL, o seguinte erro pode ocorrer e proibir a partir de completar o comando:

ERROR 1170 (42000): BLOB/TEXT column ‘field_name’ used in key specification without a key length ERROR 1170 (42000): BLOB / TEXT coluna 'field_name' usado na chave sem especificação uma chave comprimento

The error happens because MySQL can index only the first N chars of a BLOB or TEXT column. O erro ocorre porque o MySQL só pode indexar os primeiros N caracteres de uma coluna BLOB ou TEXT. So The error mainly happen when there is a field/column type of TEXT or BLOB or those belongs to TEXT or BLOB types such as TINYBLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, MEDIUMTEXT, and LONGTEXT that you try to make as primary key or index. Portanto, o erro acontece principalmente quando existe um campo / tipo de texto ou coluna BLOB ou TEXT ou pertence a esses tipos BLOB como TINYBLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, MEDIUMTEXT, e LONGTEXT que você tente fazer como chave primária ou índice. With full BLOB or TEXT without the length value, MySQL is unable to guarantee the uniqueness of the column as it’s of variable and dynamic size. Com pleno BLOB ou TEXT sem o comprimento valor, o MySQL é incapaz de garantir a unicidade da coluna como ele é de tamanho variável e dinâmica. So, when using BLOB or TEXT types as index, the value of N must be supplied so that MySQL can determine the key length. Portanto, ao utilizar tipos BLOB ou TEXT como índice, o valor de N devem ser fornecidas de forma que o MySQL pode determinar as principais comprimento. However, MySQL doesn’t support limit on TEXT or BLOB. No entanto, o MySQL não suporta limite para TEXT ou BLOB. TEXT(88) simply won’t work. TEXTO (88) simplesmente não funciona.

The error will also pop up when you try to convert a table column from non-TEXT and non-BLOB type such as VARCHAR and ENUM into TEXT or BLOB type, with the column already been defined as unique constraints or index. O erro também irá aparecer quando você tentar converter uma coluna de tabela não-texto e não-tipo BLOB como ENUM em VARCHAR e TEXT ou BLOB tipo, com a coluna já sido definido como únicas restrições ou índice. The Alter Table SQL command will fail. O comando SQL ALTER TABLE irá falhar.

The solution to the problem is to remove the TEXT or BLOB column from the index or unique constraint, or set another field as primary key. A solução para o problema é remover a coluna TEXT ou BLOB ou a partir do índice único constrangimento, ou definir um outro campo como chave primária. If you can’t do that, and wanting to place a limit on the TEXT or BLOB column, try to use VARCHAR type and place a limit of length on it. Se você não puder fazer isso, e querer colocar um limite para a coluna TEXT ou BLOB, tente usar tipo VARCHAR e coloque um limite de comprimento sobre o mesmo. By default, VARCHAR is limited to a maximum of 255 characters and its limit must be specified implicitly within a bracket right after its declaration, ie VARCHAR(200) will limit it to 200 characters long only. Por padrão, VARCHAR é limitado a um máximo de 255 caracteres e seu limite deve ser especificado implicitamente dentro de uma faixa direita depois da sua declaração, ou seja, VARCHAR (200) que irá limitar a apenas 200 caracteres.

Sometimes, even though you don’t use TEXT or BLOB related type in your table, the Error 1170 may also appear. Às vezes, mesmo que você não pode usar TEXT ou BLOB tipo relacionados na sua tabela, o erro 1170 também pode aparecer. It happens in situation such as when you specify VARCHAR column as primary key, but wrongly set its length or characters size. Ela acontece em situações como quando você precisar VARCHAR coluna como chave primária, mas erradamente definir a sua duração ou caracteres tamanho. VARCHAR can only accepts up to 256 characters, so anything such as VARCHAR(512) will force MySQL to auto-convert the VARCHAR(512) to a SMALLTEXT datatype, which subsequently fail with error 1170 on key length if the column is used as primary key or unique or non-unique index. VARCHAR só aceita até 256 caracteres, então qualquer coisa como VARCHAR (512) irá vigor MySQL para converter a auto-VARCHAR (512) para um SMALLTEXT dados, que posteriormente falhar com erros em 1170 comprimento chave se a coluna é usado como primário chave ou único ou não-único índice. To solve this problem, specify a figure less than 256 as the size for VARCHAR field. Para resolver este problema, especificar um valor inferior a 256 como o tamanho de campo VARCHAR.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.

Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .



4 Responses to “MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length” 4 Responses para "MySQL Error 1170 (42000): BLOB / TEXT Coluna Utilizado em Key Especificação Sem uma chave Comprimento"

  1. Felix
    August 30th, 2007 18:33 30 de agosto de 2007 18:33
    1

    Thanks for putting this up. Obrigado por colocar este tipo de ligações. I didn’t get the error and you saved me a lot o frustration. Eu não recebi o erro e você salvou-me um lote ou frustração. I’d put you in the ‘Goog people’ category anytime Eu não colocá-lo na "GOOG pessoas" categoria qualquer momento ;-)

  2. Ben Hardy Ben Hardy
    February 20th, 2008 02:45 20 de fevereiro de 2008 02:45
    2

    Thanks! Obrigado! Very useful post. Muito útil post.

  3. Jamie Slater Jamie Slater
    February 23rd, 2008 03:40 23 de fevereiro de 2008 03:40
    3

    Thanks for the post. Graças ao cargo. Very helpful. Muito útil.

  4. Reza
    March 7th, 2008 04:15 De 7 de março de 2008 04:15
    4

    Thanks, very good defined Obrigado, muito bem definida

Leave a Reply Deixe uma resposta

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Você pode usar estas tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Subscreva sem comentar


Custom Search

New Articles Novos Artigos

Incoming Search Terms for the Article Incoming Termos de pesquisa para o artigo

BLOB/TEXT column used in key specification without a key length BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- used in key specification without a key length chave sem especificação utilizada em uma chave comprimento - -- mysql error 1170 MySQL erro 1170 - -- BLOB/TEXT column used in key specification without a key length BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- used in key specification without a key length chave sem especificação utilizada em uma chave comprimento - -- BLOB/TEXT column used in key specification without a key length BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- BLOB/TEXT column 'name' used in key specification without a key length BLOB / TEXT coluna 'nome' usado em uma chave sem especificação chave comprimento - -- mysql used in key specification without a key length mysql-chave utilizadas na especificação sem uma chave comprimento - -- ERROR 1170 (42000) at line 77: BLOB/TEXT column 'jid' used in key specification without a key length ERROR 1170 (42000) na linha 77: BLOB / TEXT coluna 'jid' usado na chave sem especificação uma chave comprimento - -- #1170 - BLOB/TEXT column used in key specification without a key length # 1170 - BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- mysql 1170 MySQL 1170 - -- mysql #1170 mysql # 1170 - -- #1170 - BLOB/TEXT column used in key specification without a key length # 1170 - BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- error 1170 mysql MySQL erro 1170 - -- #1170 - BLOB/TEXT column 'name' used in key specification without a key length # 1170 - BLOB / TEXT coluna 'nome' usado em uma chave sem especificação chave comprimento - -- mysql text key MySQL texto-chave - -- "used in key specification without a key length" "utilizado na chave sem especificação uma chave comprimento" - -- mysql error number 1170 MySQL erro número 1170 - -- error 1170 Erro 1170 - -- used in key specification without key length sem especificação utilizada na chave chave comprimento - -- #1170 - BLOB/TEXT column used in key specification without a key length # 1170 - BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- mysql "used in key specification without a key length" mysql ", utilizada na especificação chave sem uma chave comprimento" - -- key specification without a key length chave sem especificação uma chave comprimento - -- ERROR 1170 (42000) ERROR 1170 (42000) - -- The used table type doesn't support BLOB/TEXT columns A tabela utilizada não suporta tipo BLOB / TEXT colunas - -- #1170 - BLOB/TEXT column used in key specification without a key length # 1170 - BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- BLOB/TEXT column used in key specification without a key length BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- The used table type doesn't support BLOB/TEXT columns A tabela utilizada não suporta tipo BLOB / TEXT colunas - -- ERROR 1170 (42000): BLOB/TEXT column used in key specification without a key length ERROR 1170 (42000): BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- column used in key specification without a key length coluna sem especificação-chave utilizadas em uma chave comprimento - -- mysql text unique MySQL texto único - -- ERROR 1170 (42000): BLOB/TEXT column used in key specification without a key length ERROR 1170 (42000): BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- BLOB/TEXT column 'Name' used in key specification without a key length BLOB / TEXT coluna 'Nome' usada na especificação chave sem uma chave comprimento - -- BLOB/TEXT column 'id' used in key specification without a key length BLOB / TEXT coluna 'id' usado na chave sem especificação uma chave comprimento - -- MySQL KEY TEXT MySQL-chave texto - -- BLOB/TEXT column 'value' used in key specification without a key length BLOB / TEXT coluna "valor" sem especificação-chave utilizadas em uma chave comprimento - -- used in key specification without a key length mysql chave sem especificação utilizada em uma chave comprimento mysql - -- BLOB/TEXT column 'jid' used in key specification without a key length BLOB / TEXT coluna 'jid' usado na chave sem especificação uma chave comprimento - -- #1170 - BLOB/TEXT column # 1170 - BLOB / TEXT coluna - -- mysql ERROR 1170 (42000) mysql ERROR 1170 (42000) - -- mysql BLOB/TEXT column used in key specification without a key length mysql BLOB / TEXT coluna sem especificação-chave utilizadas em uma chave comprimento - -- #1170 - BLOB/TEXT column 'Title' used in key specification without a key length # 1170 - BLOB / TEXT coluna 'título' usado em uma chave sem especificação chave comprimento - -- "key specification without a key length" "chave especificação sem uma chave comprimento" - -- mysql text key length MySQL texto fundamental comprimento - -- #1170 - BLOB/TEXT column 'id' used in key specification without a key length # 1170 - BLOB / TEXT coluna 'id' usado na chave sem especificação uma chave comprimento - -- #1170 - BLOB/TEXT # 1170 - BLOB / TEXT - -- #1170 - BLOB/TEXT column 'name' used in key specification without a key length # 1170 - BLOB / TEXT coluna 'nome' usado em uma chave sem especificação chave comprimento - -- mysql blob key MySQL BLOB chave - -- without a key length sem uma chave comprimento - -- #1170 - BLOB/TEXT column # 1170 - BLOB / TEXT coluna - --