0

in windows command promt full eror it gives same with some php artisan commands

C:\xampp\htdocs\jj>php artisan migrate

In Connection.php line 664:

  SQLSTATE[HY000] [1049] Unknown database 'juwelleryjournal' (SQL: select * from information_schema
  .tables where table_schema = juwelleryjournal and table_name = migrations)


In Connector.php line 67:

  SQLSTATE[HY000] [1049] Unknown database 'juwelleryjournal'

, & php artisan make:"blabla" works well

If you encounter same error, latest windows php version could be an option for you, but it helped only my classmate, not me. The i found on already being in stack overflow (Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()) and didn't help either. This occurs same on laptop(win7) and desktop pc(win10). I have laravel5.5.28 on both.

Have anyone any suggestions?

2 Answers2

0

Add this to your AppServiceProvider

use Illuminate\Support\Facades\Schema;
function boot()
  {
   Schema::defaultStringLength(191);
  }
BM2ilabs
  • 522
  • 6
  • 11
  • yes and no - actually u revealed me that little misstake but it wasn't the main reason. Writing length stil gives missing sql base eror, so the grammar misake is not "serious" enough for asking how to solve it when i actually need to solve automatic database creation problem, which stil exists but i setled it in the simpliest way - making juwelleryjuornal database manually. by the way - stil thx – Jurgis Florijonas Vaiginis Jan 08 '18 at 21:01
0
 Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLenght()

=> the method name is wrong, it should be defaultStringLength

Wouter Van Damme
  • 761
  • 9
  • 15