gpt4 book ai didi

从命令行执行时MySQL输出帮助/选项

转载 作者:行者123 更新时间:2023-11-29 22:02:03 29 4
gpt4 key购买 nike

我正在 Raspbian 中从命令行运行以下查询:

mysql -u $NAME -p $PASS Tweets -e "SELECT count(*) FROM raw_tweets;"

它输出以下内容。我确信这是某个地方的设置,但我所有的搜索都没有结果。预先感谢您的帮助。

mysql Ver 14.14 Distrib 5.5.43, for debian-linux-gnu (armv7l) using readline 6.2 Copyright (c) 2000, 2015, 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.

Usage: mysql [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
--auto-rehash Enable automatic rehashing. One doesn't need to use
'rehash' to get table and field completion, but startup
and reconnecting may take a longer time. Disable with
--disable-auto-rehash.
(Defaults to on; use --skip-auto-rehash to disable.)
-A, --no-auto-rehash
No automatic rehashing. One has to use 'rehash' to get
table and field completion. This gives a quicker start of
mysql and disables rehashing on reconnect.
--auto-vertical-output
Automatically switch to vertical output mode if the
result is wider than the terminal width.
-B, --batch Don't use history file. Disable interactive behavior.
(Enables --silent.)
--character-sets-dir=name
Directory for character set files.
--column-type-info Display column type information.
-c, --comments Preserve comments. Send comments to the server. The
default is --skip-comments (discard comments), enable
with --comments.
-C, --compress Use compression in server/client protocol.
-#, --debug[=#] This is a non-debug version. Catch this and exit.
--debug-check Check memory and open file usage at exit.
-T, --debug-info Print some debug info at exit.
....... (Abbreviated, above should give enough of an example)

最佳答案

你的语法几乎是正确的,你忘记了添加数据库名称参数。试试这个:

mysql -u $NAME -p $PASS -e "SELECT count(*) FROM raw_tweets" yourDBname

如果 Tweets 是您的数据库名称,请尝试以下操作:

mysql -u $NAME -p $PASS -e "SELECT count(*) FROM raw_tweets" Tweets

其中 $NAME$PASS 是您的用户名和密码,并授予数据库和表的权限。

不需要分号。如果您只运行一个选择命令。

关于从命令行执行时MySQL输出帮助/选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32542823/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com