00:12 deploy:migrating 01 $HOME/.rbenv/bin/rbenv exec bundle exec rake db:migrate 01 rake aborted! 01 Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `initialize' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `mysql2_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_handling.rb:118:in `retrieve_connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_handling.rb:90:in `connection' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' 01 /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' 01 /home/ec2-user/.rbenv/versions/2.5.1/bin/bundle:23:in `load' 01 /home/ec2-user/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>' 01 Tasks: TOP => db:migrate 01 (See full trace by running task with --trace) #<Thread:0x00007ff75f06c378@/Users/handaryouhei/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 1: from /Users/handaryouhei/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' /Users/handaryouhei/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ec2-user@54.250.55.251: rake exit status: 1 (SSHKit::Runner::ExecuteError) rake stdout: Nothing written rake stderr: rake aborted! Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `initialize' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `mysql2_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_handling.rb:118:in `retrieve_connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/connection_handling.rb:90:in `connection' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/activerecord-5.2.4.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /var/www/cheaptweet/shared/bundle/ruby/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' /home/ec2-user/.rbenv/versions/2.5.1/bin/bundle:23:in `load' /home/ec2-user/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>' Tasks: TOP => db:migrate 以下省略
あらゆる再起動はしました。
config/database.yml
でsoketを指定しているのが、
default: &default adapter: mysql2 encoding: utf8 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: socket: /var/lib/mysql/mysql.sock
production: <<: *default database: cheaptweet_production username: root password: <%= ENV['DATABASE_PASSWORD'] %> socket: /var/lib/mysql/mysql.sock
の2箇所あって前者は関係ないと思うのですが、一応変えてみました。
これ以外にプロジェクト内に/tmp/mysql.sock
の記載は無いです。
よろしくお願いいたします。。。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。