0

ターミナル (flush_hosts) 内でいくつかの mysqladmin 権限にアクセスしようとしたところ、ソケットの問題がエラーで再浮上したことに気付きました

ソケット '/tmp/mysql.sock' (2)* を介してローカルの MySQL サーバーに接続できません。

現在実行中のサーバーはありません。

これはどのように解決できますか?

4

3 に答える 3

0

database.ymlファイル内のソケットフィールドを削除するmysql.sockか、マシンのどこにあるかがわかっている場合は、正しいパスに変更してみてください。

于 2012-11-19T21:38:50.470 に答える
0

うわー、あなたはそれを接続できるサーバーを「実行する必要がある」と述べました。考慮してください:

root@debian:/etc/init.d# /etc/init.d/mysql stop
[ ok ] Stopping MySQL database server: mysqld.
root@debian:/etc/init.d# mysql 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@debian:/etc/init.d# /etc/init.d/mysql start
[ ok ] Starting MySQL database server: mysqld ..
[info] Checking for tables which need an upgrade, are corrupt or were 
not closed cleanly..
root@debian:/etc/init.d# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.5.24-5 (Debian)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
于 2012-07-20T18:04:12.803 に答える
0

OK、途中でいくつかの混乱した構成があったに違いないようです。最初に戻って、MySQL 用の最新の .DMG をインストールしたところ、すべて正常に動作しています。.sock の問題がある場合は、MySQL を再インストールするのが最善の策だと思いますが、それほど時間はかかりません。助けてくれてありがとう!

于 2012-07-24T19:51:09.550 に答える