ahmedash95/audio-spleeter

SQL connection refused during installation

Opened this issue · 3 comments

Hi, thanks for adapting a web interface for spleeter, nice job!!

I keep running into the same issue when I try to run any PHP part of the install commands, starting with

docker exec -it web-spleeter_app_1 php artisan migrate

Error:

   Illuminate\Database\QueryException  : SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `users` limit 1)

  at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:665
    661|         // If an exception occurs when attempting to run a query, we'll format the error
    662|         // message to include the bindings with SQL, which will make this exception a
    663|         // lot more helpful to the developer instead of just the database's errors.
    664|         catch (Exception $e) {
  > 665|             throw new QueryException(
    666|                 $query, $this->prepareBindings($bindings), $e
    667|             );
    668|         }
    669|

  Exception trace:

  1   Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(App\Providers\AppServiceProvider))
      [internal]:0

  2   PDOException::("SQLSTATE[HY000] [2002] Connection refused")
      /var/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

  Please use the argument -v to see more details.

What have I missed?

Hey @focusteve, Thanks for the kind words. can you please share your docker-compose ps + your .env file

Hi @ahmedash95 - here's docker-compose ps:

          Name                        Command               State                     Ports                   
--------------------------------------------------------------------------------------------------------------
web-spleeter_app_1         docker-php-entrypoint php-fpm    Up      9000/tcp                                  
web-spleeter_db_1          docker-entrypoint.sh mysqld      Up      0.0.0.0:3388->3306/tcp, 33060/tcp         
web-spleeter_redis_1       docker-entrypoint.sh redis ...   Up      6379/tcp                                  
web-spleeter_webserver_1   nginx -g daemon off;             Up      0.0.0.0:443->443/tcp, 0.0.0.0:8080->80/tcp

and my .env file

APP_NAME="Web Spleeter"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

FILESYSTEM_DRIVER=public

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=password

BROADCAST_DRIVER=pusher
CACHE_DRIVER=file
QUEUE_CONNECTION=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=930443
PUSHER_APP_KEY=f9871f34e034f231d609
PUSHER_APP_SECRET=372808783c950d1aa729
PUSHER_APP_CLUSTER=eu

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

TWITTER_KEY=
TWITTER_SECRET=
TWITTER_REDIRECT_URI=

FACEBOOK_KEY=
FACEBOOK_SECRET=
FACEBOOK_REDIRECT_URI=

Thanks for looking at this for me! Laravel and Homestead both seem to be running okay so I'm a bit stumped.

Hey @focusteve. I noticed that in docker-compose the password of MYSQL is root but in your .env file it's DB_PASSWORD=password change password to root should fix your problem.