Can I use mysql database from my personal web server instead of heroku’s database?
I configured my production database like this:
production:
adapter: mysql2
database: somedatabase
username: someusername
password: somepassword
host: 1.1.1.1:1234
But, this doesn’t work, my app still uses heroku’s shared database.
This is old but in case anyone drops around looking for an answer, it’s much easier than using the gem. Just provide a
DATABASE_URLandSHARED_DATABASE_URL(not sure if the second is needed). The database url format isadapter://username:password@hostname:port/database, so for example, you would do:Then re-deploy your app. It will read your
DATABASE_URLand generate the database.yml from that. The default port is already 3306 so it’s not needed in the url in your case. When you deploy, you may notice that it generates your database.yml:Then you’re set (as long as your server accepts connections from your heroku host.