I want to run an app using MySQL on heroku. I have already installed and configured cleardb
for this purpose. All I have left to do is configure environment variables. However, I can't find a proper way to do this.
in this article, Matt explains how to configure the mentioned variables:
// config/database.php
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
$host = $url["host"];
$username = $url["user"];
$password = $url["pass"];
$database = substr($url["path"], 1);
// . . .
'mysql' => array(
'driver' => 'mysql',
'host' => $host,
'database' => $database,
'username' => $username,
'password' => $password,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
And he also says:
if you're actually working on a real site, you should be making sure you're just editing the database credentials specifically for your production environment
So, how exactly should environment variables be configured in production to run MySQL using cleardb
on heroku?