seat
seat copied to clipboard
SQL missing primary key on table password_resets
Problem: Fresh install using mysql database throwing error when running the below command. Run the database migrations with: sudo -H -u www-data bash -c 'php /var/www/seat/artisan migrate'
Expected: Create the table password_resets but instead fails with error no primary_key set.
Logs / Screenshots / Proof: Screenshot: https://i.imgur.com/uI5f0RC.png
Error Message: SQLSTATE[HY000]: General error: 3750 Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. N
ote that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. (Connection: mysql, SQL: create table password_resets
(email
varchar(255) no
t null, token
varchar(255) not null, created_at
timestamp not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
Version Info: Seat V5.0
- Using mysql is not officially supported. SeAT is designed for MariaDB and PostgreSQL. That being said, it will probably also work with mysql, but you might need to tweak a few things here and there.
- the
sql_require_primary_key
should be off by default: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_sql_require_primary_key. I don't know why it is on in your case, but you need to turn it off. Fixing this in SeAT is in my opinion out of scope, since it is on an unsupported DB with a non-default configuration.
What I suggest to do to fix this is to disable the sql_require_primary_key
setting.
Closing as we no longer support mysql and a fix has been given