MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQLのエラーが発生1170 ( 42000 ) :のBLOB /テキスト列で使用されキー仕様なしでキーの長さ

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:新しいテーブルを作成するとき、または既存のテーブルに主キーを変更する、独自の制約とインデックスか、または新しいインデックスを定義するときにALTER TABLEの声明にMySQLのデータベースの操作は、次のエラーが発生することが禁止すると、コマンドを完了:

ERROR 1170 (42000): BLOB/TEXT column ‘field_name’ used in key specification without a key lengthエラーが発生1170 ( 42000 ) :のBLOB / TEXTカラム' field_name '仕様書なしに使用されてキーキーの長さ

The error happens because MySQL can index only the first N chars of a BLOB or TEXT column.のエラーが発生するため、 MySQLはインデックスには、最初のn文字列のBLOBまたはテキストです。 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.主に起こるので、エラーが発生時には、フィールド/カラムのタイプのテキストまたはBLOBやテキストまたはBLOBの種類に属しているなど、 tinyblob 、 mediumblob 、 longblob 、 tinytext 、 mediumtext 、およびlongtextすることを試みるとして主キーまたはインデックスを作る。 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.を完全にBLOBやテキストなしの長さの値は、 MySQLができないの列の一意性を保証するための変数と同じことで動的なサイズです。 So, when using BLOB or TEXT types as index, the value of N must be supplied so that MySQL can determine the key length.そのため、インデックスを使用してBLOBやテキストの種類としては、 nの値を供給しなければならないようにMySQLはキーの長さを決定する。 However, MySQL doesn’t support limit on TEXT or BLOB.しかし、 MySQLをサポートしていませんBLOBのテキストまたは制限されています。 TEXT(88) simply won’t work.テキスト( 88 )だけでは動作しません。

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.のエラーが発生する場合もポップアップしようとしたときにテーブルからカラムを1列に変換するに非テキストと非BLOB型のようなテキストまたはvarcharおよび列挙型をBLOB型で、その列として定義されて既に独自の制約またはインデックスです。 The Alter Table SQL command will fail.テーブルには、 ALTER SQLコマンドは失敗します。

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.この問題の解決策を削除するには、テキストまたはBLOBカラムのインデックスや独自の制約からか、または別のフィールドとして主キーを設定します。 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.の場合はそんなことはできない、と希望を配置するテキストまたはBLOBカラムに制限され、 VARCHARタイプを使用しようと場所を長さを制限している。 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.デフォルトでは、初回限定してVARCHARは最大255文字とその限界を指定する必要がありますブラケットも暗黙のうちにその宣言の直後、すなわちvarchar ( 200 )は200文字までに制限することのみです。

Sometimes, even though you don’t use TEXT or BLOB related type in your table, the Error 1170 may also appear.場合によっては、使用していないにもかかわらず、テキストやテーブルのBLOB関連した入力して、 1170年5月にも、エラーが表示されます。 It happens in situation such as when you specify VARCHAR column as primary key, but wrongly set its length or characters size.それのような状況が起こるかをVARCHARカラムを指定するときに主キーとして、しかし、その長さや文字のサイズを誤って設定します。 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は、最大256文字のみ受け付けますので、何かなど、 varchar ( 512 )が強制的に自動変換してMySQLのvarchar ( 512 ) smalltextしてデータを失敗し、その後1170エラーが発生する場合は、列の長さのキーとして使用されてプライマリ固有のキーを押すか、または非ユニークなインデックスです。 To solve this problem, specify a figure less than 256 as the size for VARCHAR field.この問題を解決するために、図を指定するのは256未満のサイズをVARCHARフィールドです。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。

Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。



4 Responses to “MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length” 4つの応答を" MySQLエラー1170 ( 42000 ) :のBLOB /テキスト列で使用されキー仕様なしでキーの長さ"

  1. Felixフェリックス
    August 30th, 2007 18:33 2007年8月30日18:33
    1

    Thanks for putting this up.このパットいただきありがとうございます。 I didn’t get the error and you saved me a lot o frustration.私入手してエラーが発生しなかったと私に多くまたは欲求不満を保存します。 I’d put you in the ‘Goog people’ category anytime私ならば、 ' 6758人々 'カテゴリいつでも ;-)

  2. Ben Hardyベンハーディ
    February 20th, 2008 02:45 2008年2月20日02:45
    2

    Thanks!ありがとう! Very useful post.非常に有益なポストを作成。

  3. Jamie Slaterジェイミースレーター
    February 23rd, 2008 03:40 2008年2月23日03:40
    3

    Thanks for the post.ポストてくれてありがとう。 Very helpful.非常にhelpful 。

  4. Rezaレーザ
    March 7th, 2008 04:15 2008年3月7日04:15
    4

    Thanks, very good definedありがとう、非常に良い定義されて

Leave a Reply残して返信

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> これらのタグを使用することができます: <aのhref=のtitle= <abbrのtitle= <blockquote cite=""> <cite> <acronymのtitle= <b>ダウンロードの<code> <デル日時= " " >の<em> <i>て<strike> <strong> <q cite="">

Subscribe without commenting登録なしのコメント


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article検索用語を受信するには

BLOB/TEXT column used in key specification without a key length のBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - used in key specification without a key length 仕様書なしに使用されてキーキーの長さ - - used in key specification without a key length 仕様書なしに使用されてキーキーの長さ - - BLOB/TEXT column used in key specification without a key length のBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - mysql error 1170 MySQLエラー1170 - - BLOB/TEXT column used in key specification without a key length のBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - mysql used in key specification without a key length MySQLの仕様書なしに使用されてキーキーの長さ - - BLOB/TEXT column 'name' used in key specification without a key length のBLOB / TEXTカラム ' 名'仕様書なしに使用されてキーキーの長さ - - #1170 - BLOB/TEXT column used in key specification without a key length # 1170 -のB LOB/テキスト列で使用されキー仕様なしでキーの長さ - - "used in key specification without a key length" "仕様書なしに使用されてキーキーの長さ" - - mysql 1170 MySQLの1170 - - ERROR 1170 (42000) at line 77: BLOB/TEXT column 'jid' used in key specification without a key length エラーが発生1170 ( 42000 )の行77 :のBLOB / TEXTカラム' jid ' 仕様書なしに使用されてキーキーの長さ - - mysql error number 1170 MySQLのエラー番号1170 - - ERROR 1170 (42000) エラーが発生117042000 ) - - error 1170 mysql 1170 MySQLのエラーが発生 - - mysql text key MySQLのテキストキー - - mysql "used in key specification without a key length" MySQLの"仕様書なしに使用されてキーキーの長さ" - - #1170 - BLOB/TEXT column 'name' used in key specification without a key length # 1170 -のB LOB/ T EXTカラム'名'仕様書なしに使用されてキーキーの長さ - - #1170 - BLOB/TEXT column used in key specification without a key length # 1170 -のB LOB/テキスト列で使用されキー仕様なしでキーの長さ - - error 1170 エラー1170 - - mysql #1170 MySQLの# 1170 - - #1170 - BLOB/TEXT column used in key specification without a key length # 1170 -のB LOB/テキスト列で使用されキー仕様なしでキーの長さ - - key specification without a key length キー仕様なしでキーの長さ - - BLOB/TEXT column 'jid' used in key specification without a key length のBLOB / TEXTカラム ' jid '仕様書なしに使用されてキーキーの長さ - - The used table type doesn't support BLOB/TEXT columns は、使われるテーブルタイプをサポートしていませんのBLOB / TEXTカラム - - #1170 - BLOB/TEXT column used in key specification without a key length # 1170 -のB LOB/テキスト列で使用されキー仕様なしでキーの長さ - - The used table type doesn't support BLOB/TEXT columns は、使われるテーブルタイプをサポートしていませんのBLOB / TEXTカラム - - used in key specification without key length 仕様書なしで使用されキーキーの長さ - - BLOB/TEXT column used in key specification without a key length のBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - mysql text unique MySQLのテキストをユニークな - - mysql text key length MySQLのテキストキーの長さ - - BLOB/TEXT column 'Name' used in key specification without a key length のBLOB / TEXTカラム ' 名'仕様書なしに使用されてキーキーの長さ - - #1170 mysql # 1170のMySQL - - #1170 - BLOB/TEXT column 'name' used in key specification without a key length # 1170 -のB LOB/ T EXTカラム'名'仕様書なしに使用されてキーキーの長さ - - ERROR 1170 (42000): BLOB/TEXT column used in key specification without a key length エラーが発生1170 ( 42000 ) :のBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - #1170 - BLOB/TEXT column # 1170 -のB LOB/ T EXTカラム - - ERROR 1170 (42000): BLOB/TEXT column used in key specification without a key length エラーが発生1170 ( 42000 ) :のBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - BLOB/TEXT column 'id' used in key specification without a key length のBLOB / TEXTカラム ' 番号'で使用されキー仕様なしでキーの長さ - - column used in key specification without a key length 仕様書なしに使用されるキー列のキーの長さ - - mysql BLOB/TEXT column used in key specification without a key length のMySQLのBLOB /テキスト列で使用されキー仕様なしでキーの長さ - - mysql text primary key MySQLのテキストの主キー - - used in key specification without a key length 仕様書なしに使用されてキーキーの長さ - - used in key specification without a key length mysql 仕様書なしに使用されてキーキーの長さのMySQL - - #1170 - BLOB/TEXT # 1170 -のB LOB/本文 - - MySQL KEY TEXT MySQLのキーをテキスト - - blob text column 'name' used in key specification without a key length BLOBのテキスト列'名'仕様書なしに使用されてキーキーの長さ - - BLOB/TEXT column 'value' used in key specification without a key length のBLOB / TEXTカラム' value ' 仕様書なしに使用されてキーキーの長さ - - BLOB/TEXT column '' used in key specification without a key length のBLOB / TEXTカラム''仕様書なしに使用されてキーキーの長さ - - #1170 - BLOB/TEXT column 'id' used in key specification without a key length # 1170 -のB LOB/ T EXTカラム'番号'で使用されキー仕様なしでキーの長さ - - key specification without a key length キー仕様なしでキーの長さ - -