MySQL查询调试
MySQL Query debugging
我有一个创建 table 用户的查询,但它没有在 XAMPP 的 PHPMyAdmin 中执行。
这里是查询,
create table user (#user_id bigint unsigned primary key not null auto_increment,
email text not null,
phone text primary key not null,
gcm_id bigint unsigned,
name text,
age_group text,
landmark text,
appartment text,
country text,
adults int,
kids int,
workstation text,
lati decimal(9,6),
longi decimal(9,6),
pincode text,
brand_id bigint unsigned,
branch_id bigint unsigned,
app_money decimal(7,2),
member boolean,
checked_in boolean,
index user_table_index1(email(50), phone(20))
);
正在显示
#1170 - BLOB/TEXT column 'phone' used in key specification without a key length. Since its a TEXT datatype ,why key length is needed?
这里的Key长度是什么意思?
Text 数据类型不能用作 Primary Key
您需要使用带长度的 varchar。
我有一个创建 table 用户的查询,但它没有在 XAMPP 的 PHPMyAdmin 中执行。
这里是查询,
create table user (#user_id bigint unsigned primary key not null auto_increment,
email text not null,
phone text primary key not null,
gcm_id bigint unsigned,
name text,
age_group text,
landmark text,
appartment text,
country text,
adults int,
kids int,
workstation text,
lati decimal(9,6),
longi decimal(9,6),
pincode text,
brand_id bigint unsigned,
branch_id bigint unsigned,
app_money decimal(7,2),
member boolean,
checked_in boolean,
index user_table_index1(email(50), phone(20))
);
正在显示
#1170 - BLOB/TEXT column 'phone' used in key specification without a key length. Since its a TEXT datatype ,why key length is needed?
这里的Key长度是什么意思?
Text 数据类型不能用作 Primary Key 您需要使用带长度的 varchar。