Dreamfactory on Rpi 3 with Mysql


When trying to follow a setup guide here and here(mostly this, with generous permission reset commands from the other) to get Dreamfactory(and later Freeboard) going, I kept running into an issue when it would try to set up my MySql tables and getting a big fat error:  Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Well that's less than ideal... Everytime I retry requires a delete of the directory/database and reclone and recreation. After being up till 4 am trying over-and-over I gave up and fortunately a new day provided me with the sanity to actually read the documentation I'd been staring at. One of the composer dependencies is Laravel and while I'm short on the specifics basically the pre-5.7 mysql character set is the limiting factor here. Laravel themselves provided a page on how to fix it but the files they referenced didn't exist for me.

https://laravel-news.com/laravel-5-4-key-too-long-error

They point at "your" AppServiceProvider.php and based on their screenshot assumed it was in vendor\Laravel\Illuminate\Support\Facades\Schema. Eventually it turns out but "your" they mean the software you're setting up. Here's what you need to do after running composer install --no-dev:

cd dreamfactory/app/Providers
nano AppServiceProvider.php

and make the top of your file look like this


<?php
namespace DreamFactory\Providers;

use DreamFactory\Services\Registrar;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        Schema::defaultStringLength(191);
    }

Continue with your double  php artisan dreamfactory:setup runs and you should be golden.

Comments