0
bitnami@ip-10-99-67-123:~/.rvm/gems$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

bitnami@ip-10-99-67-123:~/.rvm/gems$ rails -v
Rails 3.2.3

bitnami@ip-10-99-67-123:~/.rvm/gems$ mysql --version
mysql  Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (x86_64) using readline 6.2

bitnami@ip-10-99-67-123:~/.rvm/gems$ mysql -v
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
bitnami@ip-10-99-67-123:~/.rvm/gems$

知道为什么会这样吗?

mysql -v我只收到命令错误

谢谢你。

4

1 回答 1

1
   ·   --verbose, -v

       Verbose mode. Produce more output about what the program does. This option can be given multiple times to produce more and more output. (For example, -v -v -v produces table output format even in
       batch mode.)

   ·   --version, -V

       Display version information and exit.

你想要什么 ?详细还是版本?

如果你想要服务器端版本,连接到服务器,发送查询status;

您应该使用完整的参数连接服务器,例如:

> mysql --user=user --password=password --host=serverip

或者把 args 放在~/.my.cnf

就像我的一样:

[mysql]
default-character-set=utf8
prompt="\\u@\\h \\r:\\m:\\s > "
user=user
password=DqvQ86ls1VQit617C
host=127.0.0.1
port=3306
于 2012-05-16T05:13:47.383 回答