mysqlでソケットファイルエラーが出ています。
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
やったこと
・ソケットファイル作成
→すぐ消えてしまう
・mysqlの再インストール
作業環境
mac ruby 2.6.6 rails 5.2.4.2 MySQL 5.7 Homebrew 2.3.0 rbenv 1.1.2
Mysql2::Error::ConnectionError (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)): mysql2 (0.5.3) lib/mysql2/client.rb:90:in `connect' mysql2 (0.5.3) lib/mysql2/client.rb:90:in `initialize' activerecord (6.0.3.2) lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `new' activerecord (6.0.3.2) lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `mysql2_connection' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:887:in `new_connection' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `checkout_new_connection' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:910:in `try_to_checkout_new_connection' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:871:in `acquire_connection' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:593:in `checkout' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:437:in `connection' activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:1119:in `retrieve_connection' activerecord (6.0.3.2) lib/active_record/connection_handling.rb:221:in `retrieve_connection' activerecord (6.0.3.2) lib/active_record/connection_handling.rb:189:in `connection' activerecord (6.0.3.2) lib/active_record/migration.rb:562:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call' activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks' actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call' web-console (4.0.4) lib/web_console/middleware.rb:132:in `call_app' web-console (4.0.4) lib/web_console/middleware.rb:28:in `block in call' web-console (4.0.4) lib/web_console/middleware.rb:17:in `catch' web-console (4.0.4) lib/web_console/middleware.rb:17:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app' railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `block in call' activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `block in tagged' activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:28:in `tagged' activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `tagged' railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `call' sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call' rack (2.2.3) lib/rack/method_override.rb:24:in `call' rack (2.2.3) lib/rack/runtime.rb:22:in `call' activesupport (6.0.3.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/static.rb:126:in `call' rack (2.2.3) lib/rack/sendfile.rb:110:in `call' actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:82:in `call' webpacker (4.2.2) lib/webpacker/dev_server_proxy.rb:23:in `perform_request' rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call' railties (6.0.3.2) lib/rails/engine.rb:527:in `call' puma (4.3.5) lib/puma/configuration.rb:228:in `call' puma (4.3.5) lib/puma/server.rb:713:in `handle_request' puma (4.3.5) lib/puma/server.rb:472:in `process_client' puma (4.3.5) lib/puma/server.rb:328:in `block in run' puma (4.3.5) lib/puma/thread_pool.rb:134:in `block in spawn_thread'
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/07/23 00:49
2020/08/02 05:00
2020/08/02 16:44