2

While trying to register, above (in the title) is the error that I get. The migrations were migrated successfully, so I don't think there is any connection problem with the database, but I don't know why this error is coming? I have just tried to create an authentication system using

php artisan make:auth

And I have migrated the migrations

Please help...

Ronit
  • 127
  • 1
  • 8
  • Please explain more thoroughly what you are trying to do, and what you have tried. – Per Enström May 10 '17 at 11:33
  • 2
    Possible duplicate of [PDOException SQLSTATE\[HY000\] \[2002\] No such file or directory](http://stackoverflow.com/questions/20723803/pdoexception-sqlstatehy000-2002-no-such-file-or-directory) – Devon Bessemer May 10 '17 at 11:37
  • If I was you, I'd mask your actual mail address in the title... – Amarnasan May 10 '17 at 11:37
  • I have updated it, hope you understand my problem now @PerEnström – Ronit May 10 '17 at 11:38
  • @Devon I am afraid, that's not my problem – Ronit May 10 '17 at 11:41
  • 1
    @Ronit, this error means it can't find the unix socket, so it has to be that MySQL isn't set up properly. Use `artisan tinker` and try running DB commands. – Devon Bessemer May 10 '17 at 11:45
  • 2
    @Ronit follow the answer below the accepted answer in the linked post: Change "DB_HOST" in the .env file from "localhost" to "127.0.0.1" – fez May 10 '17 at 12:19

2 Answers2

0

don't mean to necro bump. I found this solution

https://laracasts.com/discuss/channels/eloquent/table-json-generates-an-error-when-running-migrations

Basically changing json to text in your migration files seems to work

tldr

"I believe the Json type in migrations was translated to text. Since 5.2 it's actually Json type now. Either way if your db doesn't support Json just use text instead of varchar or Json. It will still store Json."

SJK
  • 91
  • 1
  • 10
-1

You need to make some changes in the .env file:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravelfive(DB name)
DB_USERNAME=root (Username must be Root)
DB_PASSWORD='' (Password should be empty)

Then change the config -> database file like this:

'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'laravelfive'),
        'username' => env('DB_USERNAME', 'root'),
        'password' => env('DB_PASSWORD', ''),
        'unix_socket' => env('DB_SOCKET', ''),

Finally, run Xampp Apache and MySQL like in the following link:

Xampp running picture

German Rocha
  • 55
  • 1
  • 14