【发布时间】:2014-09-13 04:00:25
【问题描述】:
CREATE TABLE IF NOT EXISTS client_details (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
client_description VARCHAR(1024),
reuse_refresh_tokens BOOLEAN NOT NULL DEFAULT 1,
dynamically_registered BOOLEAN NOT NULL DEFAULT 0,
allow_introspection BOOLEAN NOT NULL DEFAULT 0,
id_token_validity_seconds BIGINT NOT NULL DEFAULT 600,
client_id VARCHAR(256),
client_secret VARCHAR(2048),
access_token_validity_seconds BIGINT,
refresh_token_validity_seconds BIGINT,
application_type VARCHAR(256),
client_name VARCHAR(256),
token_endpoint_auth_method VARCHAR(256),
subject_type VARCHAR(256),
logo_uri VARCHAR(2048),
policy_uri VARCHAR(2048),
client_uri VARCHAR(2048),
tos_uri VARCHAR(2048),
jwks_uri VARCHAR(2048),
sector_identifier_uri VARCHAR(2048),
request_object_signing_alg VARCHAR(256),
user_info_signed_response_alg VARCHAR(256),
user_info_encrypted_response_alg VARCHAR(256),
user_info_encrypted_response_enc VARCHAR(256),
id_token_signed_response_alg VARCHAR(256),
id_token_encrypted_response_alg VARCHAR(256),
id_token_encrypted_response_enc VARCHAR(256),
token_endpoint_auth_signing_alg VARCHAR(256),
default_max_age BIGINT,
require_auth_time BOOLEAN,
created_at TIMESTAMP NULL,
initiate_login_uri VARCHAR(2048),
post_logout_redirect_uri VARCHAR(2048),
unique(client_id)
);
===============
我想用 MySQL Workbench 创建一个表,但是出现错误:
“错误代码:1118。行大小太大。所用表类型的最大行大小(不包括 BLOB)为 65535。您必须将某些列更改为 TEXT 或 BLOB”
我不明白行大小如何大于 65535。
有什么帮助吗?
【问题讨论】:
-
这可能会对您有所帮助:stackoverflow.com/questions/22637733/…
-
请记住,这取决于字符集:utf-8 存储的 256 个字符可能需要 768 个字节来存储。例如,您的语句在指定
DEFAULT CHARACTER SET utf8时对我来说失败,但在DEFAULT CHARACTER SET latin1时成功(从 MySQL 4.1 开始,VARCHAR 的列长度是字符,而不是字节。) -
请注意,由于您似乎在存储 URL,您可以通过专门存储具有“较小”字符集(甚至可能是直接 ASCII)的 URL 列作为 Unicode 字符URL 没有得到很好的支持,这些是您最大的列。