How to make connection to heroku mysql database
https://stackoverflow.com/questions/32109099/how-to-make-connection-to-heroku-mysql-database
Last updated
https://stackoverflow.com/questions/32109099/how-to-make-connection-to-heroku-mysql-database
Last updated
Ask QuestionAsked 4 years, 5 months agoActive 4 years, 5 months agoViewed 747 times1
I created a web app that I was able to successfully deploy to heroku. The site uses a mysql database that I dumped into the project directory for the app. I followed the instructions from this SO post as well as other online sources. I entered the following command into the terminal:
and got the CLEARDB_DATABASE_URL: mysql://be4beb15e4506b:f601032d@us-cdbr-iron-east-02.cleardb.net/heroku_e665c17e181f638?reconnect=true
Before deploying the app I then entered:
Inside of the actual files, I added the following code for the database connection:
For some reason whenever I navigate to a page where a query is done, I'm getting a connection error. Based on the url provided, have the correct arguments been passed to the connection?php mysql database heroku deploymentshareimprove this questionedited May 23 '17 at 12:22Community♦111 silver badgeasked Aug 20 '15 at 3:29loremIpsum17712,11911 gold badge2121 silver badges5454 bronze badges
I found the answer on server fault here – loremIpsum1771 Aug 21 '15 at 20:01
I found the answer on server fault here
The correct format for the database connection is: