2

I started a new project using laravel^6.2 using the laravel new myapp command.

I edit then my .env file to connect to my local database:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=8082
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root

I decide then to migrate the default database structure from laravel. when I say default structure I'm talking about the users migration which is already created from the beginning present in the 2014_10_12_000000_create_users_table.php file:

<?php

// *** This has been generated from `laravel new myapp` ***

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}

So I run the php artisan migrate command and then something unexpected happens. Indeed, after that the terminal doesn't do anything as if it was on break. I'm thinking maybe the command takes a while to execute but after several tries that lasted about ten minutes, nothing happens.

So I decide to consult the logs but absolutely nothing's written down, it's totally empty.

So I'm trying to execute php artisan cache:clear and start over but the result is the same: No error messages and nothing happens.

I know the question has been asked here before, but no answer really came up.

Has somebody an idea what I have missed ?

johannchopin
  • 13,720
  • 10
  • 55
  • 101
  • 1
    Port 8082 is an unusual port for MySQL, it's usually 3306, have you set that port on your MySQL server? – brombeer Jan 25 '20 at 17:03
  • What's your os and how you're hosting your MySQL? if you're using xampp, xampp is using 3306 port for mysql since it's default port after all. share your mysql informations. – Atlas-Pio Jan 25 '20 at 17:07
  • @kerbholz Well my localhost server run on port `8082` but this obviously has nothing to do with the MySql port. With port `3306` it's work well thanks. I'm still surprised that laravel's cli doesn't handle this error message. I'll be happy to validate your answer if you feel like writing it. – johannchopin Jan 25 '20 at 17:07
  • Glad it works.! – brombeer Jan 25 '20 at 17:11

1 Answers1

1

Try changing the port to the default MySQL port 3306.

Port 8082 as you have it sounds unusual, unless you have set that port in your MySQL server.

From your comment: there are multiple "localhost" servers running on your machine:

  • your localhost web server, port 80 usually (in your case 8082)
  • your localhost mysql server, port 3306 usually.

There might also be a localhost postgres server, running (default) at port 5432, a localhost redis server at port 6379 or many others.

brombeer
  • 8,716
  • 5
  • 21
  • 27