title: Executing command rake:db:schema:dump
body: <p>Im new with rails and Im trying to execute rake db:schema:dump, but Im having this problem.</p>
  
  <pre><code>rake db:schema:dump --trace
  ** Invoke db:schema:dump (first_time)
  ** Invoke environment (first_time)
  ** Execute environment
  ** Invoke db:load_config (first_time)
  ** Execute db:load_config
  ** Execute db:schema:dump
  rake aborted!
  Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
  /var/lib/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
  /var/lib/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection
  '
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_co
  nnection'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checko
  ut_new_connection'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block 
  (2 levels) in checkout'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block 
  in checkout'
  /usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checko
  ut'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block 
  in connection'
  /usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connec
  tion'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrie
  ve_connection'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:i
  n `retrieve_connection'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:i
  n `connection'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/railties/databases.rake:379:in `block (4 levels) in &lt;top (requ
  ired)&gt;'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/railties/databases.rake:378:in `open'
  /var/lib/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/railties/databases.rake:378:in `block (3 levels) in &lt;top (requ
  ired)&gt;'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
  /usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
  /var/lib/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `&lt;top (required)&gt;'
  /usr/local/bin/rake:23:in `load'
  /usr/local/bin/rake:23:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:schema:dump
  </code></pre>
  
  <p>I already create the database and Im having this problem when I try to connect. </p>
  
  <p>My database.yml is:</p>
  
  <pre><code># SQLite version 3.x
  #   gem install sqlite3
  #
  #   Ensure the SQLite 3 gem is defined in your Gemfile
  #   gem 'sqlite3'
  # development:
    # adapter: sqlite3
    # database: db/development.sqlite3
    # pool: 5
    # timeout: 5000
  
  development:
    adapter: mysql2
    encoding: utf8
    reconnect: false
    database: simple_cms_develoment  
    pool: 5
    username: simple_cms
    password: secretpassword
    socket: /tmp/mysql.sock
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    adapter: sqlite3
    database: db/test.sqlite3
    pool: 5
    timeout: 5000
  
  production:
    adapter: sqlite3
    database: db/production.sqlite3
    pool: 5
    timeout: 5000
  </code></pre>
  
  <p>And my gemfile is: </p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails', '3.2.9'
  
  # Bundle edge Rails instead:
  # gem 'rails', :git =&gt; 'git://github.com/rails/rails.git'
  
  gem 'mysql2'
  
  gem 'activerecord-mysql-adapter'
  
  gem 'bootstrap-sass'
  
  # Gems used only for assets and not required
  # in production environments by default.
  group :assets do
    gem 'sass-rails',   '~&gt; 3.2.3'
    gem 'coffee-rails', '~&gt; 3.2.1'
  
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer', :platforms =&gt; :ruby
  
    gem 'uglifier', '&gt;= 1.0.3'
  end
  
  gem 'jquery-rails'
  
  # To use ActiveModel has_secure_password
  # gem 'bcrypt-ruby', '~&gt; 3.0.0'
  
  # To use Jbuilder templates for JSON
  # gem 'jbuilder'
  
  # Use unicorn as the app server
  # gem 'unicorn'
  
  # Deploy with Capistrano
  # gem 'capistrano'
  
  # To use debugger
  # gem 'debugger'
  </code></pre>
  
  <p>Can anyone help me? </p>