Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create db in non local mysql server #42

Open
dexternica opened this issue Oct 31, 2017 · 2 comments
Open

Can't create db in non local mysql server #42

dexternica opened this issue Oct 31, 2017 · 2 comments

Comments

@dexternica
Copy link

Hi.

I have CentOS 7, with Ruby 2.1.0 via rvm
My db server is MariaDB 5.5.56

When I execute rake db:migrate I receive the following message:

rake aborted! Mysql2::Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/mysql2-0.3.21/lib/mysql2/client.rb:70:in 'connect' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/mysql2-0.3.21/lib/mysql2/client.rb:70:in 'initialize' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in 'new' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in 'mysql2_connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in 'new_connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in 'checkout_new_connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in 'acquire_connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in 'block in checkout' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in 'checkout' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in 'block in connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in 'connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in 'retrieve_connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_handling.rb:79:in 'retrieve_connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_handling.rb:53:in 'connection' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:863:in 'initialize' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:764:in 'new' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:764:in 'up' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:742:in 'migrate' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/railties/databases.rake:42:in 'block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.1.0@fluxday/gems/rake-12.2.1/exe/rake:27:in '<top (required)>' /usr/local/rvm/gems/ruby-2.1.0@fluxday/bin/ruby_executable_hooks:15:in 'eval' /usr/local/rvm/gems/ruby-2.1.0@fluxday/bin/ruby_executable_hooks:15:in '<main>' Tasks: TOP => db:migrate (See full trace by running task with --trace)

It's because the db is in another server?

Cheers.

@tachyons
Copy link
Contributor

tachyons commented Nov 1, 2017

Make sure that db is configured properly in database.yml

@bneelon85
Copy link

I am getting the same thing. Could it be that I am using Amazon RDS with MySQL 5.6? I've doublechecked my connection string and credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants