winter icon indicating copy to clipboard operation
winter copied to clipboard

Specified key was too long; max key length is 767 bytes

Open euge001 opened this issue 3 years ago • 1 comments

Winter CMS Build

1.2

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

no plugins

Issue description

Fresh Winter installation, runs well on localhost, no plugins. When trying to transfer a DB from localhost to any of my 3 or 4 servers I see this:

-- Indexes for table `backend_user_groups`
--
ALTER TABLE `backend_user_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name_unique` (`name`),
  ADD KEY `code_index` (`code`);
MySQL said: Documentation

#1071 - Specified key was too long; max key length is 767 bytes

And after that it is not possible of course to login at the server with a message like this: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert into backend_user_throttle (user_id, ip_address) values (1, 180.183.155.114))

I see no any problems with any of my previous Winter installations - everything works just fine.

Steps to replicate

just try ro transfer fresh installed DB from localhost to remote server with the same characteristics

Workaround

No response

euge001 avatar Aug 24 '22 03:08 euge001

Sounds like something is screwed up with your database, try deleting it and then recreating it with artisan winter:up

LukeTowers avatar Aug 24 '22 16:08 LukeTowers

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at [email protected].

github-actions[bot] avatar Feb 24 '23 00:02 github-actions[bot]

The actual issue was that the database server was using a version that was unsupported, please review the requirements if you come across this issue in the future: https://wintercms.com/docs/setup/installation#system-requirements

LukeTowers avatar Feb 24 '23 00:02 LukeTowers