deploy mysql database to heroku code example
Example 1: how to migrate database to heroku
heroku run rails db:migrate
Example 2: connect to db heroku
heroku pg:psql -f schema.sql -a HEROKU_APP_NAME
Example 3: heroku mysql
<?php
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
$server = $url["host"];
$username = $url["user"];
$password = $url["pass"];
$db = substr($url["path"], 1);
$conn = new mysqli($server, $username, $password, $db);
?>