SQL Error on Installation

chris-mccoy

Apr 23rd, 2017 12:35 PM

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table categories add unique categories_slug_unique(slug))

is shown in the installation part after permissions are done

devdojo

Apr 24th, 2017 02:20 PM

Hey Chris,

It looks like the problem is that you are using an older version of MySQL so you will need to add the following inside of your boot() method of your app\Providers\AppServiceProvider.php file:

public function boot()
{
    Schema::defaultStringLength(191);
}

Make sure to use the namespace:

use Illuminate\Support\Facades\Schema;

In that file as well :)

You can learn more about this by following this article: https://laravel-news.com/laravel-5-4-key-too-long-error

Let me know if that helps :)

Thanks.

chris-mccoy

Apr 24th, 2017 02:37 PM

thanks, got it working by using the dump, im running mysql version 5.7.18, shouldnt that work with that? thats the current version

devdojo

Apr 24th, 2017 02:52 PM

Great :) Glad you got it working.

Yep. If you are running v5.7.7 or higher you shouldn't have to worry about that. I'm going to add an easier way to detect if the user has an outdated version for future users.

Thanks for letting me know you got it working and let me know if you have any other questions :)

chris-mccoy

Apr 24th, 2017 03:17 PM

now what would it take to not load a popup when clicking on the download, just load the regular permalink as the full post

devdojo

Apr 27th, 2017 01:59 PM

Hey Chris, go ahead and take a look at this link here: https://devdojo.com/forums/discussion/product-support/how-to-open-downloads-in-a-different-window-pixel-v2

It will help you implement this on your site :)

Thanks. Talk to you soon.