Mysql – What’s the set up database on Heroku

character encodingdatabaseherokuMySQLruby-on-rails-3.1

I have deployed my Rails 3.1 app with the MySQL database to Heroku and there everything works fine. I mean, into database are saved the chars right (seems to be used UTF charset on a databases on Heroku).

But when I will run the command heroku db:pull (this command will download a whole database from Heroku into the database on localhost), so the downloaded data stored in databased have bad coding – a chars are displayed bad (it looks like my local MySQL database have a different set up of charset than the MySQL on Heorku).

Could anyone give me a tip, how I can find the set up of charset used on Heroku database and how to use it on my local MySQL database?

Many thanks!

Best Answer

All is not lost - you really don't have to use PostgreSQL if you don't want to.

If your database is small enough (which it will have to be since the Heroku PostGres DB is also 5Mb) and you would prefer to remain on mySQL then you could use the ClearDB mySQL addon - http://addons.heroku.com/cleardb - their entry level DB is free and is the same size as the Heroku Shared PostGres DB that you get by default but be careful that the number of connections is limited so don't be going crazy with your web dyno counts.

Once you add the addon if you look at the output of heroku config then you can use the DATABASE_URL to create a connection in your favourite mySQL administration tool locally to restore/backup etc data to ClearDB. You may even find heroku db:push would work but personally I've not tried that so would be guessing.