ターミナルで,$mongo と記入すると,次の様なメッセージが,,,
motegiyuuta:~ motegiyuta$ mongo MongoDB shell version v4.0.1 connecting to: mongodb://127.0.0.1:27017 2019-06-10T13:17:51.738+0900 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:257:13 @(connect):1:6 exception: connect failed
mysqlをいじくってからこのように,mongodbまで使えなくなってしまったような気がします.
PC内でプロセスが被っているのでしょうか?
mysqlを使ってもsocketエラーが発生します.
motegiyuuta:~ motegiyuta$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
motegiyuuta:~ motegiyuta$ mongod -dbpath /usr/local/var/mongodb 2019-06-10T13:39:21.323+0900 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] MongoDB starting : pid=31425 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=motegiyuuta.local 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] db version v4.0.1 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] git version: 54f1582fc6eb01de4d4c42f26fc133e623f065fb 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] allocator: system 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] modules: none 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] build environment: 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] distarch: x86_64 2019-06-10T13:39:21.444+0900 I CONTROL [initandlisten] target_arch: x86_64 2019-06-10T13:39:21.445+0900 I CONTROL [initandlisten] options: { storage: { dbPath: "/usr/local/var/mongodb" } } 2019-06-10T13:39:21.453+0900 I STORAGE [initandlisten] Detected data files in /usr/local/var/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 2019-06-10T13:39:21.454+0900 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1536M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress), 2019-06-10T13:39:22.581+0900 I STORAGE [initandlisten] WiredTiger message [1560141562:581092][31425:0x1166055c0], txn-recover: Main recovery loop: starting at 28/10880 2019-06-10T13:39:22.728+0900 I STORAGE [initandlisten] WiredTiger message [1560141562:728247][31425:0x1166055c0], txn-recover: Recovering log 28 through 29 2019-06-10T13:39:22.823+0900 I STORAGE [initandlisten] WiredTiger message [1560141562:823366][31425:0x1166055c0], txn-recover: Recovering log 29 through 29 2019-06-10T13:39:22.894+0900 I STORAGE [initandlisten] WiredTiger message [1560141562:894475][31425:0x1166055c0], txn-recover: Set global recovery timestamp: 0 2019-06-10T13:39:23.087+0900 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0) 2019-06-10T13:39:23.212+0900 I CONTROL [initandlisten] 2019-06-10T13:39:23.212+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server. 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning. 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] 2019-06-10T13:39:23.213+0900 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 2019-06-10T13:39:23.374+0900 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/usr/local/var/mongodb/diagnostic.data' 2019-06-10T13:39:23.382+0900 I NETWORK [initandlisten] waiting for connections on port 27017
ここで止まってしまいます
mysql socketエラー
この辺片っ端から調べてみても,治りませんでした.
別にmysqlが使えなくても,MongoDBだけ使えればよいのですが,
この二つのエラーは関係していると思っていました.
どなたかこのようなsocketエラーの解決方法をご存知の方がいれば
非常に助かります.
回答1件
あなたの回答
tips
プレビュー