Skip to content

Commit 0c2b7cc

Browse files
authored
Fix Mysql Error Code: 1071. Specified key was too long; max key length is 3072 bytes (#77)
1 parent 7accc7d commit 0c2b7cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/WebAuthn/Store/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct(array $config)
6767
CREATE TABLE IF NOT EXISTS credentials (
6868
creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
6969
user_id VARCHAR(80) NOT NULL,
70-
credentialId VARCHAR(1024) NOT NULL,
70+
credentialId VARCHAR(1024) " . ($driver === 'mysql' ? "CHARACTER SET 'binary'" : '') . " NOT NULL,
7171
credential " . ($driver === 'pgsql' ? 'BYTEA' : 'MEDIUMBLOB') . " NOT NULL,
7272
algo INT DEFAULT NULL,
7373
presenceLevel INT DEFAULT NULL,

0 commit comments

Comments
 (0)