PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

Migration shout out an error

Solved
guppy

Jul 22nd, 2020 01:51 PM

When i do the migration of DB at a fresh installation. I am getting the error message that the key is too long. How come? What can i do?

In Connection.php line 671: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) In PDOStatement.php line 129: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes In PDOStatement.php line 127: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

bobbyiliev

Jul 23rd, 2020 07:03 AM

Best Answer

Hi there,

Is this regarding one of the scripts on the DevDojo site or is it plain Laravel application?

What I could suggest is using this command here to create your database:

CREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_general_ci;

Another thing you could try is adding the following values in /etc/mysql/mariadb.conf.d/50-server.cnf:

innodb-file-format=barracuda
innodb-file-per-table=ON
innodb-large-prefix=ON
innodb_default_row_format = 'DYNAMIC'

And then restart MySQL/MariaDB.

Let me know how it goes.

Report
1
guppy

Jul 23rd, 2020 11:16 AM

Hi Bob! It always bugs me if people write: it doesn't work. And do not describe it precisely. And now i did on my own. Sorry about that. Yes, I was getting this error when i installed Wave on Ubuntu server running with Plesk. I did go straight forward to your second suggestion. And it worked fine. You are brain! Thank you very much!!

bobbyiliev

Jul 23rd, 2020 11:48 AM

Hey,

No problem at all! Happy to hear that it's all working now!

appspopo5

Aug 14th, 2020 07:00 PM

Thank you so much for this. I was into this issue and tired to tinker around to che ck if its possible but couldnt get it done. Now that i have seen the way you did it, thanks guys with regards https://shareit.onl/