mrwho
mrwho

Reputation: 67

I can't connect to clearDB laravel heroku

I'm trying to connect to clearDB

in database.php file, I did this

$databaseUrl = parse_url(getenv("CLEARDB_DATABASE_URL"));
'url' => $databaseUrl,
            'host' => $databaseUrl['host'],
            'port' => $databaseUrl['port'],
            'database' => substr($url["path"], 1),
            'username' => $databaseUrl['user'],
            'password' => $databaseUrl['pass'],

I got PHP Notice: Undefined index: port in /app/config/database.php also the url

Is there any Heroku command to get port, username, password and host .. information ?

Upvotes: 0

Views: 548

Answers (1)

Christophe Hubert
Christophe Hubert

Reputation: 2951

please try the default MySQL Port 3306:

$databaseUrl = parse_url(getenv("CLEARDB_DATABASE_URL"));
'url' => $databaseUrl,
            'host' => $databaseUrl['host'],
            'port' => 3306,
            'database' => substr($url["path"], 1),
            'username' => $databaseUrl['user'],
            'password' => $databaseUrl['pass'],

Upvotes: 0

Related Questions