“MySQL的-v”命令行错误(LINUX / Ubuntu的)(“mysql -v” comman

2019-10-31 16:50发布

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命令

谢谢。

Answer 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;

您应该具有完全ARGS,例如连接服务器:

> 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


文章来源: “mysql -v” command line error(linux/ubuntu)