skip to Main Content

I am trying to deploy a Laravel application to Heroku and connect it with a database which has already been deployed to Azure.
But I am having error "unsupported driver[https]".

My database.php:

<?php

use IlluminateSupportStr;

return [

    'default' => env('DB_CONNECTION', 'mysql'),

    /

        'mysql' => [
            'driver' => 'mysql'
            'url' => env('DATABASE_URL','https://firstsqlaap.scm.azurewebsites.net/phpMyAdmin/db_structure.php?server=1&db=localdb&token=51b0b3471e798a712e129bcd1ebe5b01'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '53082'),
            'database' => env('DB_DATABASE', 'localdb'),
            'username' => env('DB_USERNAME', 'user'),
            'password' => env('DB_PASSWORD', 'pass'),
            
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

];

My SESSION_DRIVER is set to database because when set to file it was saying 419 error. I do not have any migration files as my database is deployed to Azure.

How to resolve this issue?

2

Answers


  1. This certainly isn’t the right URL to use:

    https://firstsqlaap.scm.azurewebsites.net/phpMyAdmin/db_structure.php
    

    You appear to be pointing to an instance of phpMyAdmin. phpMyAdmin isn’t a database server, it’s a dataase client. It’s a tool that you might use to interact with your database. You need to provide the URL to your actual database.

    Your database URL should look more like this:

    driver://username:password@host:port/database?options
    

    For MySQL, driver:// is likely mysql://.

    I don’t have any MySQL databases running on Azure, but it looks like a real URL might be something like

    mysql://user:[email protected]/your-database-name
    

    Go into the Azure portal and navigate to your database instance. Then, in the left navigation panel, click on "Connection strings". The information you need should be there, though not in URL format. You can either build your own URL by plugging the right values in or use the individual settings in your config/database.php file.

    Login or Signup to reply.
  2. I commented url and it work for me
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search