title: app can't connect to local MySQL - osx
body: <p>I am running some rails app on osx, but when I launch a <code>rails generate</code> command type, I get this message : </p>
  
  <pre><code>/$root/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
  </code></pre>
  
  <p>For info, my mamp server is running, and the connection must pass through <code>/Applications/MAMP/Library/bin/mysql</code>, so I aliased it by setting in my bash profile : </p>
  
  <pre><code>alias mysql="/Applications/MAMP/Library/bin/mysql"
  </code></pre>
  
  <p>Btw, what is weird, is that my <code>rails s</code> command works perfectly, so my app can connect to the apache server in that case</p>