25.5.26 NDB Select Count — 打印 NDB 表的行数
NDB Select Count 打印一个或多个 NDB 表的行数。对于单个表,结果等同于使用 MySQL 语句 SELECT COUNT(*) FROM 得到的结果。tbl_name
ndb_select_count [-c connection_string] -ddb_name tbl_name[, tbl_name2[, ...]]
可以与 NDB Select Count 一起使用的选项显示在下表中。附加描述随后出现。
-
Command-Line Format --character-sets-dir=path包含字符集的目录。
-
Command-Line Format --connect-retries=#Type 整数 Default Value 12Minimum Value 0Maximum Value 12重连次数,直到放弃。
-
Command-Line Format --connect-retry-delay=#Type Integer Default Value 5Minimum Value 0Maximum Value 5等待与管理服务器联系的秒数。
-
Command-Line Format --connect-string=connection_stringType String Default Value [none] -
Command-Line Format --core-file在出现错误时写入核心文件;用于调试。
-
Command-Line Format --defaults-file=pathType String Default Value [none]只从给定文件中读取默认选项。
-
Command-Line Format --defaults-extra-file=pathType String Default Value [none]读取给定文件后,先读取全局文件。
-
Command-Line Format --defaults-group-suffix=stringType String Default Value [none]同时读取组名后缀连接的组。
-
Command-Line Format --login-path=pathType String Default Value [none]从登录文件中读取给定路径。
-
Command-Line Format --no-login-paths跳过从登录路径文件中读取选项。
-
Command-Line Format --help显示帮助文本并退出。
-
Command-Line Format --ndb-connectstring=connection_stringType String Default Value [none]设置连接字符串,用于连接到ndb_mgmd。语法:
[nodeid=。覆盖id;][host=]hostname[:port]NDB_CONNECTSTRING和my.cnf中的条目。 -
Command-Line Format --ndb-mgm-tls=levelType 枚举值 Default Value relaxedValid Values relaxedstrict设置连接到管理服务器所需的TLS支持级别;可选值为
relaxed或strict。relaxed(默认)意味着尝试建立TLS连接,但成功不必要求;strict意味着必须使用TLS才能连接。 -
Command-Line Format --ndb-mgmd-host=connection_stringType String Default Value [none] -
Command-Line Format --ndb-nodeid=#Type Integer Default Value [none]设置节点ID,以覆盖
--ndb-connectstring中设置的任何ID。 -
--ndb-optimized-node-selectionCommand-Line Format --ndb-optimized-node-selection启用节点选择优化的交易。默认情况下启用;使用
--skip-ndb-optimized-node-selection禁用。 -
Command-Line Format --ndb-tls-search-path=listType 路径名 Default Value (Unix) $HOME/ndb-tlsDefault Value (Windows) $HOMEDIR/ndb-tls指定要搜索CA文件的目录列表。Unix平台上,目录名称由冒号(
:)分隔;Windows系统中使用分号字符(;)作为分隔符。一个目录引用可以是相对或绝对路径,它可能包含一个或多个环境变量,每个变量由前缀的美元符号($)表示,并在使用时进行扩展。搜索从左侧命名目录开始,自右向左依次进行,直到找到文件为止。一个空字符串表示空搜索路径,将导致所有搜索失败。一串由单个点(
.)组成的字符串表示搜索路径仅限于当前工作目录。如果未提供搜索路径,则使用编译时默认值。这取决于所使用的平台:在Windows上,这是
\ndb-tls;在其他平台(包括Linux)上,它是$HOME/ndb-tls。可以通过编译NDB集群时使用-DWITH_NDB_TLS_SEARCH_PATH来重写此值。 -
Command-Line Format --no-defaults不从任何选项文件(除了登录文件)中读取默认选项。
-
Command-Line Format --print-defaults打印程序参数列表并退出。
-
Command-Line Format --usage显示帮助文本并退出;与
--help相同。 -
Command-Line Format --version显示版本信息并退出。
您可以通过在调用此命令时列出表名(用空格分隔)来从多个表中获取行计数,如下所示的 样例输出 中显示。
$> ./ndb_select_count -c localhost -d ctest1 fish dogs
6 records in table fish
4 records in table dogs