Yeah this is very straight forward and simple:
1 - create mysql db
2 - create mysql db user (set defaults)
3.1 - Go to your Heroku panel/Config Vars
3.2 - Click on "Reveal Vars" and edit (clicking on pencil icon) on the one you want to change in this case DATABASE_URL
(if not present just a new one with DATABASE_URL
as the name)
3 (#2) - Using command line
heroku config:add DATABASE_URL=mysql://dbusername:dbpassword@databasehostIP:databaseserverport/databasename
then just
heroku restart
And remember the syntax:
DATABASE_URL
mysql://user:password@hostnameOrIPAddress:PortNumber/databasename
MySQL DBMS's default port number is : 3306
That's why you see examples mentioned previously using DATABASE_URL=mysql://dbusername:dbpassword@databasehostIP:3306/databasename
Hope this helps!!!