url
stringlengths
45
122
content
stringlengths
380
3.07M
https://dev.mysql.com/doc/refman/8.4/en/show-table-status.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h4 class="title"> <a name="show-table-status"> </a> 15.7.7.38 SHOW TABLE STATUS Statement </h4> </div> </div> </div> <a class="indexterm" name="idm46045169287984"> </a> <a class="indexterm" name="idm46045169286928"> </a> <a class="indexterm" name="idm46045169285440"> </a> <a class="indexterm" name="idm46045169283952"> </a> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa92183339"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SHOW</span> <span class="token keyword">TABLE</span> <span class="token keyword">STATUS</span> <span class="token punctuation">[</span>{<span class="token keyword">FROM</span> <span class="token operator">|</span> <span class="token keyword">IN</span>} <em class="replaceable">db_name</em><span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token operator">LIKE</span> <span class="token string">'<em class="replaceable">pattern</em>'</span> <span class="token operator">|</span> <span class="token keyword">WHERE</span> <em class="replaceable">expr</em><span class="token punctuation">]</span></code></pre> </div> <p> <a class="link" href="show-table-status.html" title="15.7.7.38 SHOW TABLE STATUS Statement"> <code class="literal"> SHOW TABLE STATUS </code> </a> works like <a class="link" href="show-tables.html" title="15.7.7.39 SHOW TABLES Statement"> <code class="literal"> SHOW TABLES </code> </a> , but provides a lot of information about each non- <code class="literal"> TEMPORARY </code> table. You can also get this list using the <a class="link" href="mysqlshow.html" title="6.5.6 mysqlshow — Display Database, Table, and Column Information"> <span class="command"> <strong> mysqlshow --status <em class="replaceable"> <code> db_name </code> </em> </strong> </span> </a> command. The <a class="link" href="string-comparison-functions.html#operator_like"> <code class="literal"> LIKE </code> </a> clause, if present, indicates which table names to match. The <code class="literal"> WHERE </code> clause can be given to select rows using more general conditions, as discussed in <a class="xref" href="extended-show.html" title="28.8 Extensions to SHOW Statements"> Section 28.8, “Extensions to SHOW Statements” </a> . </p> <p> This statement also displays information about views. </p> <p> <a class="link" href="show-table-status.html" title="15.7.7.38 SHOW TABLE STATUS Statement"> <code class="literal"> SHOW TABLE STATUS </code> </a> output has these columns: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <code class="literal"> Name </code> </p> <p> The name of the table. </p> </li> <li class="listitem"> <p> <code class="literal"> Engine </code> </p> <p> The storage engine for the table. See <a class="xref" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine"> Chapter 17, <i> The InnoDB Storage Engine </i> </a> , and <a class="xref" href="storage-engines.html" title="Chapter 18 Alternative Storage Engines"> Chapter 18, <i> Alternative Storage Engines </i> </a> . </p> <p> For partitioned tables, <code class="literal"> Engine </code> shows the name of the storage engine used by all partitions. </p> </li> <li class="listitem"> <p> <code class="literal"> Version </code> </p> <p> This column is unused. With the removal of <code class="filename"> .frm </code> files in MySQL 8.0, this column now reports a hardcoded value of <code class="literal"> 10 </code> , which was the last <code class="filename"> .frm </code> file version used in MySQL 5.7. </p> </li> <li class="listitem"> <p> <code class="literal"> Row_format </code> </p> <p> The row-storage format ( <code class="literal"> Fixed </code> , <code class="literal"> Dynamic </code> , <code class="literal"> Compressed </code> , <code class="literal"> Redundant </code> , <code class="literal"> Compact </code> ). For <code class="literal"> MyISAM </code> tables, <code class="literal"> Dynamic </code> corresponds to what <a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility"> <span class="command"> <strong> myisamchk -dvv </strong> </span> </a> reports as <code class="literal"> Packed </code> . </p> </li> <li class="listitem"> <p> <code class="literal"> Rows </code> </p> <p> The number of rows. Some storage engines, such as <code class="literal"> MyISAM </code> , store the exact count. For other storage engines, such as <code class="literal"> InnoDB </code> , this value is an approximation, and may vary from the actual value by as much as 40% to 50%. In such cases, use <code class="literal"> SELECT COUNT(*) </code> to obtain an accurate count. </p> <p> The <code class="literal"> Rows </code> value is <code class="literal"> NULL </code> for <code class="literal"> INFORMATION_SCHEMA </code> tables. </p> <p> For <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine"> <code class="literal"> InnoDB </code> </a> tables, the row count is only a rough estimate used in SQL optimization. (This is also true if the <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine"> <code class="literal"> InnoDB </code> </a> table is partitioned.) </p> </li> <li class="listitem"> <p> <code class="literal"> Avg_row_length </code> </p> <p> The average row length. </p> </li> <li class="listitem"> <p> <code class="literal"> Data_length </code> </p> <p> For <code class="literal"> MyISAM </code> , <code class="literal"> Data_length </code> is the length of the data file, in bytes. </p> <p> For <code class="literal"> InnoDB </code> , <code class="literal"> Data_length </code> is the approximate amount of space allocated for the clustered index, in bytes. Specifically, it is the clustered index size, in pages, multiplied by the <code class="literal"> InnoDB </code> page size. </p> <p> Refer to the notes at the end of this section for information regarding other storage engines. </p> </li> <li class="listitem"> <p> <code class="literal"> Max_data_length </code> </p> <p> For <code class="literal"> MyISAM </code> , <code class="literal"> Max_data_length </code> is maximum length of the data file. This is the total number of bytes of data that can be stored in the table, given the data pointer size used. </p> <p> Unused for <code class="literal"> InnoDB </code> . </p> <p> Refer to the notes at the end of this section for information regarding other storage engines. </p> </li> <li class="listitem"> <p> <code class="literal"> Index_length </code> </p> <p> For <code class="literal"> MyISAM </code> , <code class="literal"> Index_length </code> is the length of the index file, in bytes. </p> <p> For <code class="literal"> InnoDB </code> , <code class="literal"> Index_length </code> is the approximate amount of space allocated for non-clustered indexes, in bytes. Specifically, it is the sum of non-clustered index sizes, in pages, multiplied by the <code class="literal"> InnoDB </code> page size. </p> <p> Refer to the notes at the end of this section for information regarding other storage engines. </p> </li> <li class="listitem"> <p> <code class="literal"> Data_free </code> </p> <p> The number of allocated but unused bytes. </p> <p> <code class="literal"> InnoDB </code> tables report the free space of the tablespace to which the table belongs. For a table located in the shared tablespace, this is the free space of the shared tablespace. If you are using multiple tablespaces and the table has its own tablespace, the free space is for only that table. Free space means the number of bytes in completely free extents minus a safety margin. Even if free space displays as 0, it may be possible to insert rows as long as new extents need not be allocated. </p> <p> For NDB Cluster, <code class="literal"> Data_free </code> shows the space allocated on disk for, but not used by, a Disk Data table or fragment on disk. (In-memory data resource usage is reported by the <code class="literal"> Data_length </code> column.) </p> <p> For partitioned tables, this value is only an estimate and may not be absolutely correct. A more accurate method of obtaining this information in such cases is to query the <code class="literal"> INFORMATION_SCHEMA </code> <a class="link" href="information-schema-partitions-table.html" title="28.3.21 The INFORMATION_SCHEMA PARTITIONS Table"> <code class="literal"> PARTITIONS </code> </a> table, as shown in this example: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa88615181"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>DATA_FREE<span class="token punctuation">)</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">PARTITIONS</span> <span class="token keyword">WHERE</span> TABLE_SCHEMA <span class="token operator">=</span> <span class="token string">'mydb'</span> <span class="token operator">AND</span> <span class="token keyword">TABLE_NAME</span> <span class="token operator">=</span> <span class="token string">'mytable'</span><span class="token punctuation">;</span></code></pre> </div> <p> For more information, see <a class="xref" href="information-schema-partitions-table.html" title="28.3.21 The INFORMATION_SCHEMA PARTITIONS Table"> Section 28.3.21, “The INFORMATION_SCHEMA PARTITIONS Table” </a> . </p> </li> <li class="listitem"> <p> <code class="literal"> Auto_increment </code> </p> <p> The next <code class="literal"> AUTO_INCREMENT </code> value. </p> </li> <li class="listitem"> <p> <code class="literal"> Create_time </code> </p> <p> When the table was created. </p> </li> <li class="listitem"> <p> <code class="literal"> Update_time </code> </p> <p> When the data file was last updated. For some storage engines, this value is <code class="literal"> NULL </code> . For example, <code class="literal"> InnoDB </code> stores multiple tables in its <a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace"> system tablespace </a> and the data file timestamp does not apply. Even with <a class="link" href="glossary.html#glos_file_per_table" title="file-per-table"> file-per-table </a> mode with each <code class="literal"> InnoDB </code> table in a separate <code class="literal"> .ibd </code> file, <a class="link" href="glossary.html#glos_change_buffering" title="change buffering"> change buffering </a> can delay the write to the data file, so the file modification time is different from the time of the last insert, update, or delete. For <code class="literal"> MyISAM </code> , the data file timestamp is used; however, on Windows the timestamp is not updated by updates, so the value is inaccurate. </p> <p> <code class="literal"> Update_time </code> displays a timestamp value for the last <a class="link" href="update.html" title="15.2.17 UPDATE Statement"> <code class="literal"> UPDATE </code> </a> , <a class="link" href="insert.html" title="15.2.7 INSERT Statement"> <code class="literal"> INSERT </code> </a> , or <a class="link" href="delete.html" title="15.2.2 DELETE Statement"> <code class="literal"> DELETE </code> </a> performed on <code class="literal"> InnoDB </code> tables that are not partitioned. For MVCC, the timestamp value reflects the <a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"> <code class="literal"> COMMIT </code> </a> time, which is considered the last update time. Timestamps are not persisted when the server is restarted or when the table is evicted from the <code class="literal"> InnoDB </code> data dictionary cache. </p> </li> <li class="listitem"> <p> <code class="literal"> Check_time </code> </p> <p> When the table was last checked. Not all storage engines update this time, in which case, the value is always <code class="literal"> NULL </code> . </p> <p> For partitioned <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine"> <code class="literal"> InnoDB </code> </a> tables, <code class="literal"> Check_time </code> is always <code class="literal"> NULL </code> . </p> </li> <li class="listitem"> <p> <code class="literal"> Collation </code> </p> <p> The table default collation. The output does not explicitly list the table default character set, but the collation name begins with the character set name. </p> </li> <li class="listitem"> <p> <code class="literal"> Checksum </code> </p> <p> The live checksum value, if any. </p> </li> <li class="listitem"> <p> <code class="literal"> Create_options </code> </p> <p> Extra options used with <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement"> <code class="literal"> CREATE TABLE </code> </a> . </p> <p> <code class="literal"> Create_options </code> shows <code class="literal"> partitioned </code> for a partitioned table. </p> <p> <code class="literal"> Create_options </code> shows the <code class="literal"> ENCRYPTION </code> clause for file-per-table tablespaces if the table is encrypted or if the specified encryption differs from the schema encryption. The encryption clause is not shown for tables created in general tablespaces. To identify encrypted file-per-table and general tablespaces, query the <a class="link" href="information-schema-innodb-tablespaces-table.html" title="28.4.24 The INFORMATION_SCHEMA INNODB_TABLESPACES Table"> <code class="literal"> INNODB_TABLESPACES </code> </a> <code class="literal"> ENCRYPTION </code> column. </p> <p> When creating a table with <a class="link" href="glossary.html#glos_strict_mode" title="strict mode"> strict mode </a> disabled, the storage engine's default row format is used if the specified row format is not supported. The actual row format of the table is reported in the <code class="literal"> Row_format </code> column. <code class="literal"> Create_options </code> shows the row format that was specified in the <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement"> <code class="literal"> CREATE TABLE </code> </a> statement. </p> <p> When altering the storage engine of a table, table options that are not applicable to the new storage engine are retained in the table definition to enable reverting the table with its previously defined options to the original storage engine, if necessary. <code class="literal"> Create_options </code> may show retained options. </p> </li> <li class="listitem"> <p> <code class="literal"> Comment </code> </p> <p> The comment used when creating the table (or information as to why MySQL could not access the table information). </p> </li> </ul> </div> <h5> <a name="idm46045169157904"> </a> Notes </h5> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> For <code class="literal"> InnoDB </code> tables, <a class="link" href="show-table-status.html" title="15.7.7.38 SHOW TABLE STATUS Statement"> <code class="literal"> SHOW TABLE STATUS </code> </a> does not give accurate statistics except for the physical size reserved by the table. The row count is only a rough estimate used in SQL optimization. </p> </li> <li class="listitem"> <p> For <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4"> <code class="literal"> NDB </code> </a> tables, the output of this statement shows appropriate values for the <code class="literal"> Avg_row_length </code> and <code class="literal"> Data_length </code> columns, with the exception that <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types"> <code class="literal"> BLOB </code> </a> columns are not taken into account. </p> </li> <li class="listitem"> <p> For <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4"> <code class="literal"> NDB </code> </a> tables, <code class="literal"> Data_length </code> includes data stored in main memory only; the <code class="literal"> Max_data_length </code> and <code class="literal"> Data_free </code> columns apply to Disk Data. </p> </li> <li class="listitem"> <p> For NDB Cluster Disk Data tables, <code class="literal"> Max_data_length </code> shows the space allocated for the disk part of a Disk Data table or fragment. (In-memory data resource usage is reported by the <code class="literal"> Data_length </code> column.) </p> </li> <li class="listitem"> <p> For <code class="literal"> MEMORY </code> tables, the <code class="literal"> Data_length </code> , <code class="literal"> Max_data_length </code> , and <code class="literal"> Index_length </code> values approximate the actual amount of allocated memory. The allocation algorithm reserves memory in large amounts to reduce the number of allocation operations. </p> </li> <li class="listitem"> <p> For views, most columns displayed by <a class="link" href="show-table-status.html" title="15.7.7.38 SHOW TABLE STATUS Statement"> <code class="literal"> SHOW TABLE STATUS </code> </a> are 0 or <code class="literal"> NULL </code> except that <code class="literal"> Name </code> indicates the view name, <code class="literal"> Create_time </code> indicates the creation time, and <code class="literal"> Comment </code> says <code class="literal"> VIEW </code> . </p> </li> </ul> </div> <p> Table information is also available from the <code class="literal"> INFORMATION_SCHEMA </code> <a class="link" href="information-schema-tables-table.html" title="28.3.38 The INFORMATION_SCHEMA TABLES Table"> <code class="literal"> TABLES </code> </a> table. See <a class="xref" href="information-schema-tables-table.html" title="28.3.38 The INFORMATION_SCHEMA TABLES Table"> Section 28.3.38, “The INFORMATION_SCHEMA TABLES Table” </a> . </p> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/replication-features-variables.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h4 class="title"> <a name="replication-features-variables"> </a> 19.5.1.39 Replication and Variables </h4> </div> </div> </div> <a class="indexterm" name="idm46045134848128"> </a> <a class="indexterm" name="idm46045134846640"> </a> <a class="indexterm" name="idm46045134845152"> </a> <a class="indexterm" name="idm46045134843664"> </a> <a class="indexterm" name="idm46045134842176"> </a> <p> System variables are not replicated correctly when using <code class="literal"> STATEMENT </code> mode, except for the following variables when they are used with session scope: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <a class="link" href="replication-options-source.html#sysvar_auto_increment_increment"> <code class="literal"> auto_increment_increment </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="replication-options-source.html#sysvar_auto_increment_offset"> <code class="literal"> auto_increment_offset </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_character_set_client"> <code class="literal"> character_set_client </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_character_set_connection"> <code class="literal"> character_set_connection </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_character_set_database"> <code class="literal"> character_set_database </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_character_set_server"> <code class="literal"> character_set_server </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_collation_connection"> <code class="literal"> collation_connection </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_collation_database"> <code class="literal"> collation_database </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_collation_server"> <code class="literal"> collation_server </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_foreign_key_checks"> <code class="literal"> foreign_key_checks </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_identity"> <code class="literal"> identity </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_last_insert_id"> <code class="literal"> last_insert_id </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_lc_time_names"> <code class="literal"> lc_time_names </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_pseudo_thread_id"> <code class="literal"> pseudo_thread_id </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_sql_auto_is_null"> <code class="literal"> sql_auto_is_null </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_time_zone"> <code class="literal"> time_zone </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_timestamp"> <code class="literal"> timestamp </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_unique_checks"> <code class="literal"> unique_checks </code> </a> </p> </li> </ul> </div> <p> When <code class="literal"> MIXED </code> mode is used, the variables in the preceding list, when used with session scope, cause a switch from statement-based to row-based logging. See <a class="xref" href="binary-log-mixed.html" title="7.4.4.3 Mixed Binary Logging Format"> Section 7.4.4.3, “Mixed Binary Logging Format” </a> . </p> <p> <a class="link" href="server-system-variables.html#sysvar_sql_mode"> <code class="literal"> sql_mode </code> </a> is also replicated except for the <a class="link" href="sql-mode.html#sqlmode_no_dir_in_create"> <code class="literal"> NO_DIR_IN_CREATE </code> </a> mode; the replica always preserves its own value for <a class="link" href="sql-mode.html#sqlmode_no_dir_in_create"> <code class="literal"> NO_DIR_IN_CREATE </code> </a> , regardless of changes to it on the source. This is true for all replication formats. </p> <p> However, when <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files"> <span class="command"> <strong> mysqlbinlog </strong> </span> </a> parses a <code class="literal"> SET @@sql_mode = <em class="replaceable"> <code> mode </code> </em> </code> statement, the full <em class="replaceable"> <code> mode </code> </em> value, including <a class="link" href="sql-mode.html#sqlmode_no_dir_in_create"> <code class="literal"> NO_DIR_IN_CREATE </code> </a> , is passed to the receiving server. For this reason, replication of such a statement may not be safe when <code class="literal"> STATEMENT </code> mode is in use. </p> <p> The <a class="link" href="server-system-variables.html#sysvar_default_storage_engine"> <code class="literal"> default_storage_engine </code> </a> system variable is not replicated, regardless of the logging mode; this is intended to facilitate replication between different storage engines. </p> <p> The <a class="link" href="server-system-variables.html#sysvar_read_only"> <code class="literal"> read_only </code> </a> system variable is not replicated. In addition, the enabling this variable has different effects with regard to temporary tables, table locking, and the <a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement"> <code class="literal"> SET PASSWORD </code> </a> statement in different MySQL versions. </p> <p> The <a class="link" href="server-system-variables.html#sysvar_max_heap_table_size"> <code class="literal"> max_heap_table_size </code> </a> system variable is not replicated. Increasing the value of this variable on the source without doing so on the replica can lead eventually to <span class="errortext"> Table is full </span> errors on the replica when trying to execute <a class="link" href="insert.html" title="15.2.7 INSERT Statement"> <code class="literal"> INSERT </code> </a> statements on a <a class="link" href="memory-storage-engine.html" title="18.3 The MEMORY Storage Engine"> <code class="literal"> MEMORY </code> </a> table on the source that is thus permitted to grow larger than its counterpart on the replica. For more information, see <a class="xref" href="replication-features-memory.html" title="19.5.1.21 Replication and MEMORY Tables"> Section 19.5.1.21, “Replication and MEMORY Tables” </a> . </p> <p> In statement-based replication, session variables are not replicated properly when used in statements that update tables. For example, the following sequence of statements does not insert the same data on the source and the replica: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa45702363"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> max_join_size<span class="token operator">=</span><span class="token number">1000</span><span class="token punctuation">;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> mytable <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token variable">@@max_join_size</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> </div> <p> This does not apply to the common sequence: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa87823290"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> time_zone<span class="token operator">=</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> mytable <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token function">CONVERT_TZ</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">,</span> <span class="token variable">@@time_zone</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> </div> <p> Replication of session variables is not a problem when row-based replication is being used, in which case, session variables are always replicated safely. See <a class="xref" href="replication-formats.html" title="19.2.1 Replication Formats"> Section 19.2.1, “Replication Formats” </a> . </p> <p> The following session variables are written to the binary log and honored by the replica when parsing the binary log, regardless of the logging format: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_sql_mode"> <code class="literal"> sql_mode </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_foreign_key_checks"> <code class="literal"> foreign_key_checks </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_unique_checks"> <code class="literal"> unique_checks </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_character_set_client"> <code class="literal"> character_set_client </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_collation_connection"> <code class="literal"> collation_connection </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_collation_database"> <code class="literal"> collation_database </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_collation_server"> <code class="literal"> collation_server </code> </a> </p> </li> <li class="listitem"> <p> <a class="link" href="server-system-variables.html#sysvar_sql_auto_is_null"> <code class="literal"> sql_auto_is_null </code> </a> </p> </li> </ul> </div> <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"> <div class="admon-title"> Important </div> <p> Even though session variables relating to character sets and collations are written to the binary log, replication between different character sets is not supported. </p> </div> <p> To help reduce possible confusion, we recommend that you always use the same setting for the <a class="link" href="server-system-variables.html#sysvar_lower_case_table_names"> <code class="literal"> lower_case_table_names </code> </a> system variable on both source and replica, especially when you are running MySQL on platforms with case-sensitive file systems. The <a class="link" href="server-system-variables.html#sysvar_lower_case_table_names"> <code class="literal"> lower_case_table_names </code> </a> setting can only be configured when initializing the server. </p> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/group-replication-launching.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h4 class="title"> <a name="group-replication-launching"> </a> 20.2.1.4 Launching Group Replication </h4> </div> </div> </div> <a class="indexterm" name="idm46045134114624"> </a> <p> It is first necessary to ensure that the Group Replication plugin is installed on server s1. If you used <code class="literal"> plugin_load_add='group_replication.so' </code> in the option file then the Group Replication plugin is already installed, and you can proceed to the next step. Otherwise, you must install the plugin manually; to do this, connect to the server using the <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client"> <span class="command"> <strong> mysql </strong> </span> </a> client, and issue the SQL statement shown here: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa29244611"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">INSTALL</span> <span class="token keyword">PLUGIN</span> <span class="token keyword">group_replication</span> <span class="token keyword">SONAME</span> <span class="token string">'group_replication.so'</span><span class="token punctuation">;</span></code></pre> </div> <p> To check that the plugin was installed successfully, issue <code class="literal"> SHOW PLUGINS; </code> and check the output. It should show something like this: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa40645657"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">PLUGINS</span><span class="token punctuation">;</span> <span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span> <span class="token output"><span class="token punctuation">|</span> Name <span class="token punctuation">|</span> Status <span class="token punctuation">|</span> Type <span class="token punctuation">|</span> Library <span class="token punctuation">|</span> License <span class="token punctuation">|</span></span> <span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span> <span class="token output"><span class="token punctuation">|</span> binlog <span class="token punctuation">|</span> ACTIVE <span class="token punctuation">|</span> STORAGE ENGINE <span class="token punctuation">|</span> NULL <span class="token punctuation">|</span> PROPRIETARY <span class="token punctuation">|</span></span> <span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span> <span class="token output"><span class="token punctuation">|</span> group_replication <span class="token punctuation">|</span> ACTIVE <span class="token punctuation">|</span> GROUP REPLICATION <span class="token punctuation">|</span> group_replication.so <span class="token punctuation">|</span> PROPRIETARY <span class="token punctuation">|</span></span> <span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre> </div> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-added-deprecated-removed.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h3 class="title"> <a name="mysql-cluster-added-deprecated-removed"> </a> 25.2.5 Options, Variables, and Parameters Added, Deprecated or Removed in NDB 8.4 </h3> </div> </div> </div> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <a class="xref" href="mysql-cluster-added-deprecated-removed.html#params-added-ndb-8.4" title="Parameters Introduced in NDB 8.4"> Parameters Introduced in NDB 8.4 </a> </p> </li> <li class="listitem"> <p> <a class="xref" href="mysql-cluster-added-deprecated-removed.html#params-deprecated-ndb-8.4" title="Parameters Deprecated in NDB 8.4"> Parameters Deprecated in NDB 8.4 </a> </p> </li> <li class="listitem"> <p> <a class="xref" href="mysql-cluster-added-deprecated-removed.html#params-removed-ndb-8.4" title="Parameters Removed in NDB 8.4"> Parameters Removed in NDB 8.4 </a> </p> </li> <li class="listitem"> <p> <a class="xref" href="mysql-cluster-added-deprecated-removed.html#optvars-added-ndb-8.4" title="Options and Variables Introduced in NDB 8.4"> Options and Variables Introduced in NDB 8.4 </a> </p> </li> <li class="listitem"> <p> <a class="xref" href="mysql-cluster-added-deprecated-removed.html#optvars-deprecated-ndb-8.4" title="Options and Variables Deprecated in NDB 8.4"> Options and Variables Deprecated in NDB 8.4 </a> </p> </li> <li class="listitem"> <p> <a class="xref" href="mysql-cluster-added-deprecated-removed.html#optvars-removed-ndb-8.4" title="Options and Variables Removed in NDB 8.4"> Options and Variables Removed in NDB 8.4 </a> </p> </li> </ul> </div> <p> The next few sections contain information about <code class="literal"> NDB </code> node configuration parameters and NDB-specific <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server"> <span class="command"> <strong> mysqld </strong> </span> </a> options and variables that have been added to, deprecated in, or removed from NDB 8.4 since NDB 8.0. </p> <div class="simplesect"> <div class="titlepage"> <div> <div class="simple"> <h4 class="title"> <a name="params-added-ndb-8.4"> </a> Parameters Introduced in NDB 8.4 </h4> </div> </div> </div> <p> The following node configuration parameters have been added in NDB 8.4. </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-requirecertificate"> RequireCertificate </a> </code> : Node is required to find key and certificate in TLS search path. Added in NDB 8.3.0. </p> </li> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-tcp-definition.html#ndbparam-tcp-requirelinktls"> RequireLinkTls </a> </code> : Read-only; is set to true if either endpoint of this connection requires TLS. Added in NDB 8.3.0. </p> </li> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-mgm-definition.html#ndbparam-mgmd-requiretls"> RequireTls </a> </code> : Client connection must authenticate with TLS before being used otherwise. Added in NDB 8.3.0. </p> </li> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-requiretls"> RequireTls </a> </code> : Require TLS-authenticated secure connections. Added in NDB 8.3.0. </p> </li> </ul> </div> </div> <div class="simplesect"> <div class="titlepage"> <div> <div class="simple"> <h4 class="title"> <a name="params-deprecated-ndb-8.4"> </a> Parameters Deprecated in NDB 8.4 </h4> </div> </div> </div> <p> No node configuration parameters have been deprecated in NDB 8.4. </p> </div> <div class="simplesect"> <div class="titlepage"> <div> <div class="simple"> <h4 class="title"> <a name="params-removed-ndb-8.4"> </a> Parameters Removed in NDB 8.4 </h4> </div> </div> </div> <p> No node configuration parameters have been removed in NDB 8.4. </p> </div> <div class="simplesect"> <div class="titlepage"> <div> <div class="simple"> <h4 class="title"> <a name="optvars-added-ndb-8.4"> </a> Options and Variables Introduced in NDB 8.4 </h4> </div> </div> </div> <p> The following system variables, status variables, and server options have been added in NDB 8.4. </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-options-variables.html#option_mysqld_ndb-mgm-tls"> ndb-mgm-tls </a> </code> : Whether TLS connection requirements are strict or relaxed. Added in NDB 8.3.0-ndb-8.3.0. </p> </li> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-options-variables.html#option_mysqld_ndb-tls-search-path"> ndb-tls-search-path </a> </code> : Directories to search for NDB TLS CAs and private keys. Added in NDB 8.3.0-ndb-8.3.0. </p> </li> <li class="listitem"> <p> <code class="literal"> <a class="link" href="mysql-cluster-options-variables.html#sysvar_ndb_log_cache_size"> ndb_log_cache_size </a> </code> : Set size of transaction cache used for recording NDB binary log. Added in NDB 8.4.3-ndb-8.4.3. </p> </li> </ul> </div> </div> <div class="simplesect"> <div class="titlepage"> <div> <div class="simple"> <h4 class="title"> <a name="optvars-deprecated-ndb-8.4"> </a> Options and Variables Deprecated in NDB 8.4 </h4> </div> </div> </div> <p> No system variables, status variables, or server options have been deprecated in NDB 8.4. </p> </div> <div class="simplesect"> <div class="titlepage"> <div> <div class="simple"> <h4 class="title"> <a name="optvars-removed-ndb-8.4"> </a> Options and Variables Removed in NDB 8.4 </h4> </div> </div> </div> <p> No system variables, status variables, or options have been removed in NDB 8.4. </p> </div> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/fulltext-search-ngram.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h3 class="title"> <a name="fulltext-search-ngram"> </a> 14.9.8 ngram Full-Text Parser </h3> </div> </div> </div> <p> The built-in MySQL full-text parser uses the white space between words as a delimiter to determine where words begin and end, which is a limitation when working with ideographic languages that do not use word delimiters. To address this limitation, MySQL provides an ngram full-text parser that supports Chinese, Japanese, and Korean (CJK). The ngram full-text parser is supported for use with <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine"> <code class="literal"> InnoDB </code> </a> and <a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine"> <code class="literal"> MyISAM </code> </a> . </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <div class="admon-title"> Note </div> <p> MySQL also provides a MeCab full-text parser plugin for Japanese, which tokenizes documents into meaningful words. For more information, see <a class="xref" href="fulltext-search-mecab.html" title="14.9.9 MeCab Full-Text Parser Plugin"> Section 14.9.9, “MeCab Full-Text Parser Plugin” </a> . </p> </div> <p> An ngram is a contiguous sequence of <em class="replaceable"> <code> n </code> </em> characters from a given sequence of text. The ngram parser tokenizes a sequence of text into a contiguous sequence of <em class="replaceable"> <code> n </code> </em> characters. For example, you can tokenize <span class="quote"> “ <span class="quote"> abcd </span> ” </span> for different values of <em class="replaceable"> <code> n </code> </em> using the ngram full-text parser. </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa5930408"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">n<span class="token operator">=</span>1<span class="token operator">:</span> 'a'<span class="token punctuation">,</span> 'b'<span class="token punctuation">,</span> 'c'<span class="token punctuation">,</span> 'd' n<span class="token operator">=</span>2<span class="token operator">:</span> 'ab'<span class="token punctuation">,</span> 'bc'<span class="token punctuation">,</span> 'cd' n<span class="token operator">=</span>3<span class="token operator">:</span> 'abc'<span class="token punctuation">,</span> 'bcd' n<span class="token operator">=</span>4<span class="token operator">:</span> 'abcd'</code></pre> </div> <p> The ngram full-text parser is a built-in server plugin. As with other built-in server plugins, it is automatically loaded when the server is started. </p> <p> The full-text search syntax described in <a class="xref" href="fulltext-search.html" title="14.9 Full-Text Search Functions"> Section 14.9, “Full-Text Search Functions” </a> applies to the ngram parser plugin. Differences in parsing behavior are described in this section. Full-text-related configuration options, except for minimum and maximum word length options ( <a class="link" href="innodb-parameters.html#sysvar_innodb_ft_min_token_size"> <code class="literal"> innodb_ft_min_token_size </code> </a> , <a class="link" href="innodb-parameters.html#sysvar_innodb_ft_max_token_size"> <code class="literal"> innodb_ft_max_token_size </code> </a> , <a class="link" href="server-system-variables.html#sysvar_ft_min_word_len"> <code class="literal"> ft_min_word_len </code> </a> , <a class="link" href="server-system-variables.html#sysvar_ft_max_word_len"> <code class="literal"> ft_max_word_len </code> </a> ) are also applicable. </p> <h4> <a name="idm46045201293696"> </a> Configuring ngram Token Size </h4> <p> The ngram parser has a default ngram token size of 2 (bigram). For example, with a token size of 2, the ngram parser parses the string <span class="quote"> “ <span class="quote"> abc def </span> ” </span> into four tokens: <span class="quote"> “ <span class="quote"> ab </span> ” </span> , <span class="quote"> “ <span class="quote"> bc </span> ” </span> , <span class="quote"> “ <span class="quote"> de </span> ” </span> and <span class="quote"> “ <span class="quote"> ef </span> ” </span> . </p> <p> ngram token size is configurable using the <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> configuration option, which has a minimum value of 1 and maximum value of 10. </p> <p> Typically, <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> is set to the size of the largest token that you want to search for. If you only intend to search for single characters, set <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> to 1. A smaller token size produces a smaller full-text search index, and faster searches. If you need to search for words comprised of more than one character, set <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> accordingly. For example, <span class="quote"> “ <span class="quote"> Happy Birthday </span> ” </span> is <span class="quote"> “ <span class="quote"> <span class="phrase" lang="zh-cn"> 生日快乐 </span> </span> ” </span> in simplified Chinese, where <span class="quote"> “ <span class="quote"> <span class="phrase" lang="zh-cn"> 生日 </span> </span> ” </span> is <span class="quote"> “ <span class="quote"> birthday </span> ” </span> , and <span class="quote"> “ <span class="quote"> <span class="phrase" lang="zh-cn"> 快乐 </span> </span> ” </span> translates as <span class="quote"> “ <span class="quote"> happy </span> ” </span> . To search on two-character words such as these, set <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> to a value of 2 or higher. </p> <p> As a read-only variable, <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> may only be set as part of a startup string or in a configuration file: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> Startup string: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa39143297"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysqld <span class="token constant">--ngram_token_size</span><span class="token attr-value"><span class="token punctuation">=</span>2</span></code></pre> </div> </li> <li class="listitem"> <p> Configuration file: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa22435550"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span> <span class="token constant">ngram_token_size</span><span class="token attr-value"><span class="token punctuation">=</span>2</span></code></pre> </div> </li> </ul> </div> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <div class="admon-title"> Note </div> <p> The following minimum and maximum word length configuration options are ignored for <code class="literal"> FULLTEXT </code> indexes that use the ngram parser: <a class="link" href="innodb-parameters.html#sysvar_innodb_ft_min_token_size"> <code class="literal"> innodb_ft_min_token_size </code> </a> , <a class="link" href="innodb-parameters.html#sysvar_innodb_ft_max_token_size"> <code class="literal"> innodb_ft_max_token_size </code> </a> , <a class="link" href="server-system-variables.html#sysvar_ft_min_word_len"> <code class="literal"> ft_min_word_len </code> </a> , and <a class="link" href="server-system-variables.html#sysvar_ft_max_word_len"> <code class="literal"> ft_max_word_len </code> </a> . </p> </div> <h4> <a name="idm46045201266384"> </a> Creating a FULLTEXT Index that Uses the ngram Parser </h4> <p> To create a <code class="literal"> FULLTEXT </code> index that uses the ngram parser, specify <code class="literal"> WITH PARSER ngram </code> with <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement"> <code class="literal"> CREATE TABLE </code> </a> , <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement"> <code class="literal"> ALTER TABLE </code> </a> , or <a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement"> <code class="literal"> CREATE INDEX </code> </a> . </p> <p> The following example demonstrates creating a table with an <code class="literal"> ngram </code> <code class="literal"> FULLTEXT </code> index, inserting sample data (Simplified Chinese text), and viewing tokenized data in the Information Schema <a class="link" href="information-schema-innodb-ft-index-cache-table.html" title="28.4.18 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table"> <code class="literal"> INNODB_FT_INDEX_CACHE </code> </a> table. </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa82243211"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">USE</span> test<span class="token punctuation">;</span> <span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> articles <span class="token punctuation">(</span> id <span class="token datatype">INT</span> <span class="token keyword">UNSIGNED</span> <span class="token keyword">AUTO_INCREMENT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span> title <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">,</span> body <span class="token datatype">TEXT</span><span class="token punctuation">,</span> <span class="token keyword">FULLTEXT</span> <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> ngram <span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span>InnoDB <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> utf8mb4<span class="token punctuation">;</span> <span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> <span class="token keyword">NAMES</span> utf8mb4<span class="token punctuation">;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> articles <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token string">'数据库管理'</span><span class="token punctuation">,</span><span class="token string">'在本教程中我将向你展示如何管理数据库'</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token string">'数据库应用开发'</span><span class="token punctuation">,</span><span class="token string">'学习开发数据库应用程序'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> innodb_ft_aux_table<span class="token operator">=</span><span class="token string">"test/articles"</span><span class="token punctuation">;</span> <span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_FT_INDEX_CACHE <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> doc_id<span class="token punctuation">,</span> position<span class="token punctuation">;</span></code></pre> </div> <p> To add a <code class="literal"> FULLTEXT </code> index to an existing table, you can use <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement"> <code class="literal"> ALTER TABLE </code> </a> or <a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement"> <code class="literal"> CREATE INDEX </code> </a> . For example: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa32541260"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> articles <span class="token punctuation">(</span> id <span class="token datatype">INT</span> <span class="token keyword">UNSIGNED</span> <span class="token keyword">AUTO_INCREMENT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span> title <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">,</span> body <span class="token datatype">TEXT</span> <span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span>InnoDB <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> utf8mb4<span class="token punctuation">;</span> <span class="token keyword">ALTER</span> <span class="token keyword">TABLE</span> articles <span class="token keyword">ADD</span> <span class="token keyword">FULLTEXT</span> <span class="token keyword">INDEX</span> ft_index <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> ngram<span class="token punctuation">;</span> <span class="token comment" spellcheck="true"># Or:</span> <span class="token keyword">CREATE</span> <span class="token keyword">FULLTEXT</span> <span class="token keyword">INDEX</span> ft_index <span class="token keyword">ON</span> articles <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> ngram<span class="token punctuation">;</span></code></pre> </div> <h4> <a name="idm46045201249536"> </a> ngram Parser Space Handling </h4> <p> The ngram parser eliminates spaces when parsing. For example: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <span class="quote"> “ <span class="quote"> ab cd </span> ” </span> is parsed to <span class="quote"> “ <span class="quote"> ab </span> ” </span> , <span class="quote"> “ <span class="quote"> cd </span> ” </span> </p> </li> <li class="listitem"> <p> <span class="quote"> “ <span class="quote"> a bc </span> ” </span> is parsed to <span class="quote"> “ <span class="quote"> bc </span> ” </span> </p> </li> </ul> </div> <h4> <a name="idm46045201244288"> </a> ngram Parser Stopword Handling </h4> <p> The built-in MySQL full-text parser compares words to entries in the stopword list. If a word is equal to an entry in the stopword list, the word is excluded from the index. For the ngram parser, stopword handling is performed differently. Instead of excluding tokens that are equal to entries in the stopword list, the ngram parser excludes tokens that <span class="emphasis"> <em> contain </em> </span> stopwords. For example, assuming <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size=2 </code> </a> , a document that contains <span class="quote"> “ <span class="quote"> a,b </span> ” </span> is parsed to <span class="quote"> “ <span class="quote"> a, </span> ” </span> and <span class="quote"> “ <span class="quote"> ,b </span> ” </span> . If a comma ( <span class="quote"> “ <span class="quote"> , </span> ” </span> ) is defined as a stopword, both <span class="quote"> “ <span class="quote"> a, </span> ” </span> and <span class="quote"> “ <span class="quote"> ,b </span> ” </span> are excluded from the index because they contain a comma. </p> <p> By default, the ngram parser uses the default stopword list, which contains a list of English stopwords. For a stopword list applicable to Chinese, Japanese, or Korean, you must create your own. For information about creating a stopword list, see <a class="xref" href="fulltext-stopwords.html" title="14.9.4 Full-Text Stopwords"> Section 14.9.4, “Full-Text Stopwords” </a> . </p> <p> Stopwords greater in length than <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size </code> </a> are ignored. </p> <h4> <a name="idm46045201234848"> </a> ngram Parser Term Search </h4> <p> For <span class="emphasis"> <em> natural language mode </em> </span> search, the search term is converted to a union of ngram terms. For example, the string <span class="quote"> “ <span class="quote"> abc </span> ” </span> (assuming <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size=2 </code> </a> ) is converted to <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> . Given two documents, one containing <span class="quote"> “ <span class="quote"> ab </span> ” </span> and the other containing <span class="quote"> “ <span class="quote"> abc </span> ” </span> , the search term <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> matches both documents. </p> <p> For <span class="emphasis"> <em> boolean mode search </em> </span> , the search term is converted to an ngram phrase search. For example, the string 'abc' (assuming <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size=2 </code> </a> ) is converted to ' <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> '. Given two documents, one containing 'ab' and the other containing 'abc', the search phrase ' <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> ' only matches the document containing 'abc'. </p> <h4> <a name="idm46045201226448"> </a> ngram Parser Wildcard Search </h4> <p> Because an ngram <code class="literal"> FULLTEXT </code> index contains only ngrams, and does not contain information about the beginning of terms, wildcard searches may return unexpected results. The following behaviors apply to wildcard searches using ngram <code class="literal"> FULLTEXT </code> search indexes: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> If the prefix term of a wildcard search is shorter than ngram token size, the query returns all indexed rows that contain ngram tokens starting with the prefix term. For example, assuming <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size=2 </code> </a> , a search on <span class="quote"> “ <span class="quote"> a* </span> ” </span> returns all rows starting with <span class="quote"> “ <span class="quote"> a </span> ” </span> . </p> </li> <li class="listitem"> <p> If the prefix term of a wildcard search is longer than ngram token size, the prefix term is converted to an ngram phrase and the wildcard operator is ignored. For example, assuming <a class="link" href="server-system-variables.html#sysvar_ngram_token_size"> <code class="literal"> ngram_token_size=2 </code> </a> , an <span class="quote"> “ <span class="quote"> abc* </span> ” </span> wildcard search is converted to <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> . </p> </li> </ul> </div> <h4> <a name="idm46045201216928"> </a> ngram Parser Phrase Search </h4> <p> Phrase searches are converted to ngram phrase searches. For example, The search phrase <span class="quote"> “ <span class="quote"> abc </span> ” </span> is converted to <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> , which returns documents containing <span class="quote"> “ <span class="quote"> abc </span> ” </span> and <span class="quote"> “ <span class="quote"> ab bc </span> ” </span> . </p> <p> The search phrase <span class="quote"> “ <span class="quote"> abc def </span> ” </span> is converted to <span class="quote"> “ <span class="quote"> ab bc de ef </span> ” </span> , which returns documents containing <span class="quote"> “ <span class="quote"> abc def </span> ” </span> and <span class="quote"> “ <span class="quote"> ab bc de ef </span> ” </span> . A document that contains <span class="quote"> “ <span class="quote"> abcdef </span> ” </span> is not returned. </p> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/mysql-enterprise-telemetry.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h2 class="title"> <a name="mysql-enterprise-telemetry"> </a> 32.9 MySQL Telemetry </h2> </div> </div> </div> <a class="indexterm" name="idm46045060155264"> </a> <p> The MySQL telemetry component is based on the OpenTelemetry (OTel) project, an open-source, vendor-neutral observability framework providing a common observability standard. It enables users to instrument their applications in order to export observability data: traces, metrics and logs, enabling increased granularity of debugging and testing. </p> <p> For more information, see <a class="xref" href="telemetry.html" title="Chapter 35 Telemetry"> Chapter 35, <i> Telemetry </i> </a> . </p> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/condition-filtering.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h4 class="title"> <a name="condition-filtering"> </a> 10.2.1.13 Condition Filtering </h4> </div> </div> </div> <p> In join processing, prefix rows are those rows passed from one table in a join to the next. In general, the optimizer attempts to put tables with low prefix counts early in the join order to keep the number of row combinations from increasing rapidly. To the extent that the optimizer can use information about conditions on rows selected from one table and passed to the next, the more accurately it can compute row estimates and choose the best execution plan. </p> <p> Without condition filtering, the prefix row count for a table is based on the estimated number of rows selected by the <code class="literal"> WHERE </code> clause according to whichever access method the optimizer chooses. Condition filtering enables the optimizer to use other relevant conditions in the <code class="literal"> WHERE </code> clause not taken into account by the access method, and thus improve its prefix row count estimates. For example, even though there might be an index-based access method that can be used to select rows from the current table in a join, there might also be additional conditions for the table in the <code class="literal"> WHERE </code> clause that can filter (further restrict) the estimate for qualifying rows passed to the next table. </p> <p> A condition contributes to the filtering estimate only if: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> It refers to the current table. </p> </li> <li class="listitem"> <p> It depends on a constant value or values from earlier tables in the join sequence. </p> </li> <li class="listitem"> <p> It was not already taken into account by the access method. </p> </li> </ul> </div> <p> In <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement"> <code class="literal"> EXPLAIN </code> </a> output, the <code class="literal"> rows </code> column indicates the row estimate for the chosen access method, and the <code class="literal"> filtered </code> column reflects the effect of condition filtering. <code class="literal"> filtered </code> values are expressed as percentages. The maximum value is 100, which means no filtering of rows occurred. Values decreasing from 100 indicate increasing amounts of filtering. </p> <p> The prefix row count (the number of rows estimated to be passed from the current table in a join to the next) is the product of the <code class="literal"> rows </code> and <code class="literal"> filtered </code> values. That is, the prefix row count is the estimated row count, reduced by the estimated filtering effect. For example, if <code class="literal"> rows </code> is 1000 and <code class="literal"> filtered </code> is 20%, condition filtering reduces the estimated row count of 1000 to a prefix row count of 1000 × 20% = 1000 × .2 = 200. </p> <p> Consider the following query: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa95816594"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> employee <span class="token keyword">JOIN</span> department <span class="token keyword">ON</span> employee<span class="token punctuation">.</span>dept_no <span class="token operator">=</span> department<span class="token punctuation">.</span>dept_no <span class="token keyword">WHERE</span> employee<span class="token punctuation">.</span>first_name <span class="token operator">=</span> <span class="token string">'John'</span> <span class="token operator">AND</span> employee<span class="token punctuation">.</span>hire_date <span class="token operator">BETWEEN</span> <span class="token string">'2018-01-01'</span> <span class="token operator">AND</span> <span class="token string">'2018-06-01'</span><span class="token punctuation">;</span></code></pre> </div> <p> Suppose that the data set has these characteristics: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> The <code class="literal"> employee </code> table has 1024 rows. </p> </li> <li class="listitem"> <p> The <code class="literal"> department </code> table has 12 rows. </p> </li> <li class="listitem"> <p> Both tables have an index on <code class="literal"> dept_no </code> . </p> </li> <li class="listitem"> <p> The <code class="literal"> employee </code> table has an index on <code class="literal"> first_name </code> . </p> </li> <li class="listitem"> <p> 8 rows satisfy this condition on <code class="literal"> employee.first_name </code> : </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa75874779"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql">employee<span class="token punctuation">.</span>first_name <span class="token operator">=</span> <span class="token string">'John'</span></code></pre> </div> </li> <li class="listitem"> <p> 150 rows satisfy this condition on <code class="literal"> employee.hire_date </code> : </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa54153249"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql">employee<span class="token punctuation">.</span>hire_date <span class="token operator">BETWEEN</span> <span class="token string">'2018-01-01'</span> <span class="token operator">AND</span> <span class="token string">'2018-06-01'</span></code></pre> </div> </li> <li class="listitem"> <p> 1 row satisfies both conditions: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa8630614"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql">employee<span class="token punctuation">.</span>first_name <span class="token operator">=</span> <span class="token string">'John'</span> <span class="token operator">AND</span> employee<span class="token punctuation">.</span>hire_date <span class="token operator">BETWEEN</span> <span class="token string">'2018-01-01'</span> <span class="token operator">AND</span> <span class="token string">'2018-06-01'</span></code></pre> </div> </li> </ul> </div> <p> Without condition filtering, <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement"> <code class="literal"> EXPLAIN </code> </a> produces output like this: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-none"><div class="docs-select-all right" id="sa97289758"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">+----+------------+--------+------------------+---------+---------+------+----------+ | id | table | type | possible_keys | key | ref | rows | filtered | +----+------------+--------+------------------+---------+---------+------+----------+ | 1 | employee | ref | name,h_date,dept | name | const | 8 | 100.00 | | 1 | department | eq_ref | PRIMARY | PRIMARY | dept_no | 1 | 100.00 | +----+------------+--------+------------------+---------+---------+------+----------+</code></pre> </div> <p> For <code class="literal"> employee </code> , the access method on the <code class="literal"> name </code> index picks up the 8 rows that match a name of <code class="literal"> 'John' </code> . No filtering is done ( <code class="literal"> filtered </code> is 100%), so all rows are prefix rows for the next table: The prefix row count is <code class="literal"> rows </code> × <code class="literal"> filtered </code> = 8 × 100% = 8. </p> <p> With condition filtering, the optimizer additionally takes into account conditions from the <code class="literal"> WHERE </code> clause not taken into account by the access method. In this case, the optimizer uses heuristics to estimate a filtering effect of 16.31% for the <a class="link" href="comparison-operators.html#operator_between"> <code class="literal"> BETWEEN </code> </a> condition on <code class="literal"> employee.hire_date </code> . As a result, <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement"> <code class="literal"> EXPLAIN </code> </a> produces output like this: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-none"><div class="docs-select-all right" id="sa75839927"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">+----+------------+--------+------------------+---------+---------+------+----------+ | id | table | type | possible_keys | key | ref | rows | filtered | +----+------------+--------+------------------+---------+---------+------+----------+ | 1 | employee | ref | name,h_date,dept | name | const | 8 | 16.31 | | 1 | department | eq_ref | PRIMARY | PRIMARY | dept_no | 1 | 100.00 | +----+------------+--------+------------------+---------+---------+------+----------+</code></pre> </div> <p> Now the prefix row count is <code class="literal"> rows </code> × <code class="literal"> filtered </code> = 8 × 16.31% = 1.3, which more closely reflects actual data set. </p> <p> Normally, the optimizer does not calculate the condition filtering effect (prefix row count reduction) for the last joined table because there is no next table to pass rows to. An exception occurs for <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement"> <code class="literal"> EXPLAIN </code> </a> : To provide more information, the filtering effect is calculated for all joined tables, including the last one. </p> <p> To control whether the optimizer considers additional filtering conditions, use the <a class="link" href="switchable-optimizations.html#optflag_condition-fanout-filter"> <code class="literal"> condition_fanout_filter </code> </a> flag of the <a class="link" href="server-system-variables.html#sysvar_optimizer_switch"> <code class="literal"> optimizer_switch </code> </a> system variable (see <a class="xref" href="switchable-optimizations.html" title="10.9.2 Switchable Optimizations"> Section 10.9.2, “Switchable Optimizations” </a> ). This flag is enabled by default but can be disabled to suppress condition filtering (for example, if a particular query is found to yield better performance without it). </p> <p> If the optimizer overestimates the effect of condition filtering, performance may be worse than if condition filtering is not used. In such cases, these techniques may help: </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> If a column is not indexed, index it so that the optimizer has some information about the distribution of column values and can improve its row estimates. </p> </li> <li class="listitem"> <p> Similarly, if no column histogram information is available, generate a histogram (see <a class="xref" href="optimizer-statistics.html" title="10.9.6 Optimizer Statistics"> Section 10.9.6, “Optimizer Statistics” </a> ). </p> </li> <li class="listitem"> <p> Change the join order. Ways to accomplish this include join-order optimizer hints (see <a class="xref" href="optimizer-hints.html" title="10.9.3 Optimizer Hints"> Section 10.9.3, “Optimizer Hints” </a> ), <code class="literal"> STRAIGHT_JOIN </code> immediately following the <code class="literal"> SELECT </code> , and the <code class="literal"> STRAIGHT_JOIN </code> join operator. </p> </li> <li class="listitem"> <p> Disable condition filtering for the session: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa16379787"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> optimizer_switch <span class="token operator">=</span> <span class="token string">'condition_fanout_filter=off'</span><span class="token punctuation">;</span></code></pre> </div> <p> Or, for a given query, using an optimizer hint: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa86543194"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token comment" spellcheck="true">/*+ SET_VAR(optimizer_switch = 'condition_fanout_filter=off') */</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre> </div> </li> </ul> </div> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/group-replication-background.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h2 class="title"> <a name="group-replication-background"> </a> 20.1 Group Replication Background </h2> </div> </div> </div> <div class="toc"> <dl class="toc"> <dt> <span class="section"> <a href="group-replication-replication-technologies.html"> 20.1.1 Replication Technologies </a> </span> </dt> <dt> <span class="section"> <a href="group-replication-use-cases.html"> 20.1.2 Group Replication Use Cases </a> </span> </dt> <dt> <span class="section"> <a href="group-replication-deploying-in-multi-primary-or-single-primary-mode.html"> 20.1.3 Multi-Primary and Single-Primary Modes </a> </span> </dt> <dt> <span class="section"> <a href="group-replication-details.html"> 20.1.4 Group Replication Services </a> </span> </dt> <dt> <span class="section"> <a href="group-replication-plugin-architecture.html"> 20.1.5 Group Replication Plugin Architecture </a> </span> </dt> </dl> </div> <a class="indexterm" name="idm46045134588512"> </a> <p> This section provides background information on MySQL Group Replication. </p> <p> The most common way to create a fault-tolerant system is to resort to making components redundant, in other words the component can be removed and the system should continue to operate as expected. This creates a set of challenges that raise complexity of such systems to a whole different level. Specifically, replicated databases have to deal with the fact that they require maintenance and administration of several servers instead of just one. Moreover, as servers are cooperating together to create the group several other classic distributed systems problems have to be dealt with, such as network partitioning or split brain scenarios. </p> <p> Therefore, the ultimate challenge is to fuse the logic of the database and data replication with the logic of having several servers coordinated in a consistent and simple way. In other words, to have multiple servers agreeing on the state of the system and the data on each and every change that the system goes through. This can be summarized as having servers reaching agreement on each database state transition, so that they all progress as one single database or alternatively that they eventually converge to the same state. Meaning that they need to operate as a (distributed) state machine. </p> <p> MySQL Group Replication provides distributed state machine replication with strong coordination between servers. Servers coordinate themselves automatically when they are part of the same group. The group can operate in a single-primary mode with automatic primary election, where only one server accepts updates at a time. Alternatively, for more advanced users the group can be deployed in multi-primary mode, where all servers can accept updates, even if they are issued concurrently. This power comes at the expense of applications having to work around the limitations imposed by such deployments. </p> <p> There is a built-in group membership service that keeps the view of the group consistent and available for all servers at any given point in time. Servers can leave and join the group and the view is updated accordingly. Sometimes servers can leave the group unexpectedly, in which case the failure detection mechanism detects this and notifies the group that the view has changed. This is all automatic. </p> <p> For a transaction to commit, the majority of the group have to agree on the order of a given transaction in the global sequence of transactions. Deciding to commit or abort a transaction is done by each server individually, but all servers make the same decision. If there is a network partition, resulting in a split where members are unable to reach agreement, then the system does not progress until this issue is resolved. Hence there is also a built-in, automatic, split-brain protection mechanism. </p> <p> All of this is powered by the provided Group Communication System (GCS) protocols. These provide a failure detection mechanism, a group membership service, and safe and completely ordered message delivery. All these properties are key to creating a system which ensures that data is consistently replicated across the group of servers. At the very core of this technology lies an implementation of the Paxos algorithm. It acts as the group communication engine. </p> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/json-functions.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h2 class="title"> <a name="json-functions"> </a> 14.17 JSON Functions </h2> </div> </div> </div> <div class="toc"> <dl class="toc"> <dt> <span class="section"> <a href="json-function-reference.html"> 14.17.1 JSON Function Reference </a> </span> </dt> <dt> <span class="section"> <a href="json-creation-functions.html"> 14.17.2 Functions That Create JSON Values </a> </span> </dt> <dt> <span class="section"> <a href="json-search-functions.html"> 14.17.3 Functions That Search JSON Values </a> </span> </dt> <dt> <span class="section"> <a href="json-modification-functions.html"> 14.17.4 Functions That Modify JSON Values </a> </span> </dt> <dt> <span class="section"> <a href="json-attribute-functions.html"> 14.17.5 Functions That Return JSON Value Attributes </a> </span> </dt> <dt> <span class="section"> <a href="json-table-functions.html"> 14.17.6 JSON Table Functions </a> </span> </dt> <dt> <span class="section"> <a href="json-validation-functions.html"> 14.17.7 JSON Schema Validation Functions </a> </span> </dt> <dt> <span class="section"> <a href="json-utility-functions.html"> 14.17.8 JSON Utility Functions </a> </span> </dt> </dl> </div> <a class="indexterm" name="idm46045195837968"> </a> <p> The functions described in this section perform operations on JSON values. For discussion of the <a class="link" href="json.html" title="13.5 The JSON Data Type"> <code class="literal"> JSON </code> </a> data type and additional examples showing how to use these functions, see <a class="xref" href="json.html" title="13.5 The JSON Data Type"> Section 13.5, “The JSON Data Type” </a> . </p> <p> For functions that take a JSON argument, an error occurs if the argument is not a valid JSON value. Arguments parsed as JSON are indicated by <em class="replaceable"> <code> json_doc </code> </em> ; arguments indicated by <em class="replaceable"> <code> val </code> </em> are not parsed. </p> <p> Functions that return JSON values always perform normalization of these values (see <a class="xref" href="json.html#json-normalization" title="Normalization, Merging, and Autowrapping of JSON Values"> Normalization, Merging, and Autowrapping of JSON Values </a> ), and thus orders them. <span class="emphasis"> <em> The precise outcome of the sort is subject to change at any time; do not rely on it to be consistent between releases </em> </span> . </p> <p> A set of spatial functions for operating on GeoJSON values is also available. See <a class="xref" href="spatial-geojson-functions.html" title="14.16.11 Spatial GeoJSON Functions"> Section 14.16.11, “Spatial GeoJSON Functions” </a> . </p> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/upgrading-from-previous-series.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h2 class="title"> <a name="upgrading-from-previous-series"> </a> 3.5 Changes in MySQL 8.4 </h2> </div> </div> </div> <p> Before upgrading to MySQL 8.4, review the changes linked in this section to identify those that apply to your current MySQL installation and applications. </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <a class="ulink" href="/doc/refman/8.4/en/mysql-nutshell.html" target="_top"> Overview of changes in MySQL 8.4.0 </a> </p> </li> <li class="listitem"> <p> <a class="ulink" href="/doc/relnotes/mysql/8.4/en/news-8-4-0.html" target="_top"> MySQL 8.4.0 Release Notes </a> </p> </li> </ul> </div> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/point-in-time-recovery-positions.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h3 class="title"> <a name="point-in-time-recovery-positions"> </a> 9.5.2 Point-in-Time Recovery Using Event Positions </h3> </div> </div> </div> <p> The last section, <a class="xref" href="point-in-time-recovery-binlog.html" title="9.5.1 Point-in-Time Recovery Using Binary Log"> Section 9.5.1, “Point-in-Time Recovery Using Binary Log” </a> , explains the general idea of using the binary log to perform a point-in-time-recovery. The section explains the operation in details with an example. </p> <p> As an example, suppose that around 20:06:00 on March 11, 2020, an SQL statement was executed that deleted a table. You can perform a point-in-time recovery to restore the server up to its state right before the table deletion. These are some sample steps to achieve that: </p> <div class="orderedlist"> <ol class="orderedlist" type="1"> <li class="listitem"> <p> Restore the last full backup created before the point-in-time of interest (call it <code class="literal"> t <sub> p </sub> </code> , which is 20:06:00 on March 11, 2020 in our example). When finished, note the binary log position up to which you have restored the server for later use, and restart the server. </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <div class="admon-title"> Note </div> <p> While the last binary log position recovered is also displayed by InnoDB after the restore and server restart, that is <span class="emphasis"> <em> not </em> </span> a reliable means for obtaining the ending log position of your restore, as there could be DDL events and non-InnoDB changes that have taken place after the time reflected by the displayed position. Your backup and restore tool should provide you with the last binary log position for your recovery: for example, if you are using <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files"> <span class="command"> <strong> mysqlbinlog </strong> </span> </a> for the task, check the stop position of the binary log replay; if you are using MySQL Enterprise Backup, the last binary log position has been saved in your backup. See <a class="ulink" href="/doc/mysql-enterprise-backup/8.4/en/advanced.point.html" target="_top"> Point-in-Time Recovery </a> . </p> </div> </li> <li class="listitem"> <p> Find the precise binary log event position corresponding to the point in time up to which you want to restore your database. In our example, given that we know the rough time where the table deletion took place ( <code class="literal"> t <sub> p </sub> </code> ), we can find the log position by checking the log contents around that time using the <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files"> <span class="command"> <strong> mysqlbinlog </strong> </span> </a> utility. Use the <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_start-datetime"> <code class="option"> --start-datetime </code> </a> and <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-datetime"> <code class="option"> --stop-datetime </code> </a> options to specify a short time period around <code class="literal"> t <sub> p </sub> </code> , and then look for the event in the output. For example: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa18339269"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqlbinlog</span> <span class="token constant">--start-datetime</span>=<span class="token atrule">"2020-03-11 20:05:00"</span> \ <span class="token constant">--stop-datetime</span>=<span class="token atrule">"2020-03-11 20:08:00"</span> <span class="token property">--verbose</span> \ /var/lib/mysql/bin<span class="token punctuation">.</span>123456 | grep <span class="token property">-C</span> 15 <span class="token atrule">"DROP TABLE"</span> /*!80014 SET @@session<span class="token punctuation">.</span>original_server_version<span class="token attr-value"><span class="token punctuation">=</span>80019*//*!*/;</span> /*!80014 SET @@session<span class="token punctuation">.</span>immediate_server_version<span class="token attr-value"><span class="token punctuation">=</span>80019*//*!*/;</span> SET @@SESSION<span class="token punctuation">.</span>GTID_NEXT= <span class="token atrule">'ANONYMOUS'</span>/*!*/<span class="token punctuation">;</span> <span class="token comment" spellcheck="true"># at 232</span> <span class="token comment" spellcheck="true">#200311 20:06:20 server id 1 end_log_pos 355 CRC32 0x2fc1e5ea Query thread_id=16 exec_time=0 error_code=0</span> SET TIMESTAMP<span class="token attr-value"><span class="token punctuation">=</span>1583971580/*!*/;</span> SET @@session<span class="token punctuation">.</span>pseudo_thread_id<span class="token attr-value"><span class="token punctuation">=</span>16/*!*/;</span> SET @@session<span class="token punctuation">.</span>foreign_key_checks<span class="token attr-value"><span class="token punctuation">=</span>1,</span> @@session<span class="token punctuation">.</span>sql_auto_is_null<span class="token attr-value"><span class="token punctuation">=</span>0,</span> @@session<span class="token punctuation">.</span>unique_checks<span class="token attr-value"><span class="token punctuation">=</span>1,</span> @@session<span class="token punctuation">.</span>autocommit<span class="token attr-value"><span class="token punctuation">=</span>1/*!*/;</span> SET @@session<span class="token punctuation">.</span>sql_mode<span class="token attr-value"><span class="token punctuation">=</span>1168113696/*!*/;</span> SET @@session<span class="token punctuation">.</span>auto_increment_increment<span class="token attr-value"><span class="token punctuation">=</span>1,</span> @@session<span class="token punctuation">.</span>auto_increment_offset<span class="token attr-value"><span class="token punctuation">=</span>1/*!*/;</span> /*!\C utf8mb4 *//*!*/<span class="token punctuation">;</span> SET @@session<span class="token punctuation">.</span>character_set_client<span class="token attr-value"><span class="token punctuation">=</span>255,@@session.collation_connection=255,@@session.collation_server=255/*!*/;</span> SET @@session<span class="token punctuation">.</span>lc_time_names<span class="token attr-value"><span class="token punctuation">=</span>0/*!*/;</span> SET @@session<span class="token punctuation">.</span>collation_database<span class="token attr-value"><span class="token punctuation">=</span>DEFAULT/*!*/;</span> /*!80011 SET @@session<span class="token punctuation">.</span>default_collation_for_utf8mb4<span class="token attr-value"><span class="token punctuation">=</span>255*//*!*/;</span> DROP TABLE `pets`<span class="token punctuation">.</span>`cats` /* generated by server */ /*!*/<span class="token punctuation">;</span> <span class="token comment" spellcheck="true"># at 355</span> <span class="token comment" spellcheck="true">#200311 20:07:48 server id 1 end_log_pos 434 CRC32 0x123d65df Anonymous_GTID last_committed=1 sequence_number=2 rbr_only=no original_committed_timestamp=1583971668462467 immediate_commit_timestamp=1583971668462467 transaction_length=473</span> <span class="token comment" spellcheck="true"># original_commit_timestamp=1583971668462467 (2020-03-11 20:07:48.462467 EDT)</span> <span class="token comment" spellcheck="true"># immediate_commit_timestamp=1583971668462467 (2020-03-11 20:07:48.462467 EDT)</span> /*!80001 SET @@session<span class="token punctuation">.</span>original_commit_timestamp<span class="token attr-value"><span class="token punctuation">=</span>1583971668462467*//*!*/;</span> /*!80014 SET @@session<span class="token punctuation">.</span>original_server_version<span class="token attr-value"><span class="token punctuation">=</span>80019*//*!*/;</span> /*!80014 SET @@session<span class="token punctuation">.</span>immediate_server_version<span class="token attr-value"><span class="token punctuation">=</span>80019*//*!*/;</span> SET @@SESSION<span class="token punctuation">.</span>GTID_NEXT= <span class="token atrule">'ANONYMOUS'</span>/*!*/<span class="token punctuation">;</span> <span class="token comment" spellcheck="true"># at 434</span> <span class="token comment" spellcheck="true">#200311 20:07:48 server id 1 end_log_pos 828 CRC32 0x57fac9ac Query thread_id=16 exec_time=0 error_code=0 Xid = 217</span> use `pets`/*!*/<span class="token punctuation">;</span> SET TIMESTAMP<span class="token attr-value"><span class="token punctuation">=</span>1583971668/*!*/;</span> /*!80013 SET @@session<span class="token punctuation">.</span>sql_require_primary_key<span class="token attr-value"><span class="token punctuation">=</span>0*//*!*/;</span> CREATE TABLE dogs</code></pre> </div> <p> From the output of <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files"> <span class="command"> <strong> mysqlbinlog </strong> </span> </a> , the <code class="literal"> DROP TABLE `pets`.`cats` </code> statement can be found in the segment of the binary log between the line <code class="literal"> # at 232 </code> and <code class="literal"> # at 355 </code> , which means the statement takes place <span class="emphasis"> <em> after </em> </span> the log position 232, and the log is at position 355 after the <code class="literal"> DROP TABLE </code> statement. </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <div class="admon-title"> Note </div> <p> Only use the <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_start-datetime"> <code class="option"> --start-datetime </code> </a> and <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-datetime"> <code class="option"> --stop-datetime </code> </a> options to help you find the actual event positions of interest. Using the two options to specify the range of binary log segment to apply is not recommended: there is a higher risk of missing binary log events when using the options. Use <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_start-position"> <code class="option"> --start-position </code> </a> and <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-position"> <code class="option"> --stop-position </code> </a> instead. </p> </div> </li> <li class="listitem"> <p> Apply the events in binary log file to the server, starting with the log position your found in step 1 (assume it is 155) and ending at the position you have found in step 2 that is <span class="emphasis"> <em> before </em> </span> your point-in-time of interest (which is 232): </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa77577236"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqlbinlog</span> <span class="token constant">--start-position</span><span class="token attr-value"><span class="token punctuation">=</span>155</span> <span class="token constant">--stop-position</span><span class="token attr-value"><span class="token punctuation">=</span>232</span> /var/lib/mysql/bin<span class="token punctuation">.</span>123456 \ | mysql <span class="token property">-u</span> root <span class="token property">-p</span></code></pre> </div> <p> The command recovers all the transactions from the starting position until just before the stop position. Because the output of <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files"> <span class="command"> <strong> mysqlbinlog </strong> </span> </a> includes <code class="literal"> SET TIMESTAMP </code> statements before each SQL statement recorded, the recovered data and related MySQL logs reflect the original times at which the transactions were executed. </p> <p> Your database has now been restored to the point-in-time of interest, <code class="literal"> t <sub> p </sub> </code> , right before the table <code class="literal"> pets.cats </code> was dropped. </p> </li> <li class="listitem"> <p> Beyond the point-in-time recovery that has been finished, if you also want to reexecute all the statements <span class="emphasis"> <em> after </em> </span> your point-in-time of interest, use <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files"> <span class="command"> <strong> mysqlbinlog </strong> </span> </a> again to apply all the events after <code class="literal"> t <sub> p </sub> </code> to the server. We noted in step 2 that after the statement we wanted to skip, the log is at position 355; we can use it for the <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_start-position"> <code class="option"> --start-position </code> </a> option, so that any statements after the position are included: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa4423772"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqlbinlog</span> <span class="token constant">--start-position</span><span class="token attr-value"><span class="token punctuation">=</span>355</span> /var/lib/mysql/bin<span class="token punctuation">.</span>123456 \ | mysql <span class="token property">-u</span> root <span class="token property">-p</span></code></pre> </div> <p> Your database has been restored the latest statement recorded in the binary log file, but with the selected event skipped. </p> </li> </ol> </div> </div> <br/> </div>
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-programs-ndb-mgm.html
<div id="docs-body"> <div class="section"> <div class="titlepage"> <div> <div> <h3 class="title"> <a name="mysql-cluster-programs-ndb-mgm"> </a> 25.5.5 ndb_mgm — The NDB Cluster Management Client </h3> </div> </div> </div> <a class="indexterm" name="idm46045106433568"> </a> <a class="indexterm" name="idm46045106432624"> </a> <a class="indexterm" name="idm46045106431264"> </a> <a class="indexterm" name="idm46045106429936"> </a> <a class="indexterm" name="idm46045106428544"> </a> <a class="indexterm" name="idm46045106427216"> </a> <a class="indexterm" name="idm46045106425856"> </a> <p> The <a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client"> <span class="command"> <strong> ndb_mgm </strong> </span> </a> management client process is actually not needed to run the cluster. Its value lies in providing a set of commands for checking the cluster's status, starting backups, and performing other administrative functions. The management client accesses the management server using a C API. Advanced users can also employ this API for programming dedicated management processes to perform tasks similar to those performed by <a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client"> <span class="command"> <strong> ndb_mgm </strong> </span> </a> . </p> <p> To start the management client, it is necessary to supply the host name and port number of the management server: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa3048634"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">ndb_mgm</span> <span class="token punctuation">[</span><em class="replaceable">host_name</em> <span class="token punctuation">[</span><em class="replaceable">port_num</em><span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre> </div> <p> For example: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa19403710"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">ndb_mgm</span> ndb_mgmd<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>com 1186</code></pre> </div> <p> The default host name and port number are <code class="literal"> localhost </code> and 1186, respectively. </p> <a class="indexterm" name="idm46045106415040"> </a> <a class="indexterm" name="idm46045106413552"> </a> <a class="indexterm" name="idm46045106412064"> </a> <a class="indexterm" name="idm46045106410560"> </a> <p> All options that can be used with <a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client"> <span class="command"> <strong> ndb_mgm </strong> </span> </a> are shown in the following table. Additional descriptions follow the table. </p> <p> </p> <div class="itemizedlist"> <ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> <a name="option_ndb_mgm_backup-password-from-stdin"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_backup-password-from-stdin"> <code class="option"> --backup-password-from-stdin[=TRUE|FALSE] </code> </a> </p> <a class="indexterm" name="idm46045106404144"> </a> <a class="indexterm" name="idm46045106402640"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for backup-password-from-stdin"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --backup-password-from-stdin </code> </td> </tr> </tbody> </table> </div> <p> This option enables input of the backup password from the system shell ( <code class="literal"> stdin </code> ) when using <code class="option"> --execute "START BACKUP" </code> or similar to create a backup. Use of this option requires use of <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_execute"> <code class="option"> --execute </code> </a> as well. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_character-sets-dir"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_character-sets-dir"> <code class="option"> --character-sets-dir </code> </a> </p> <a class="indexterm" name="idm46045106390256"> </a> <a class="indexterm" name="idm46045106388800"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for character-sets-dir"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --character-sets-dir=path </code> </td> </tr> </tbody> </table> </div> <p> Directory containing character sets. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_connect-retries"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_connect-retries"> <code class="option"> --connect-retries= <em class="replaceable"> <code> # </code> </em> </code> </a> </p> <a class="indexterm" name="idm46045106378752"> </a> <a class="indexterm" name="idm46045106377264"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for connect-retries"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --connect-retries=# </code> </td> </tr> <tr> <th> Type </th> <td> Numeric </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> 3 </code> </td> </tr> <tr> <th> Minimum Value </th> <td> <code class="literal"> 0 </code> </td> </tr> <tr> <th> Maximum Value </th> <td> <code class="literal"> 4294967295 </code> </td> </tr> </tbody> </table> </div> <p> This option specifies the number of times following the first attempt to retry a connection before giving up (the client always tries the connection at least once). The length of time to wait per attempt is set using <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_connect-retry-delay"> <code class="option"> --connect-retry-delay </code> </a> . </p> <p> This option is synonymous with the <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_try-reconnect"> <code class="option"> --try-reconnect </code> </a> option, which is now deprecated. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_connect-retry-delay"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_connect-retry-delay"> <code class="option"> --connect-retry-delay </code> </a> </p> <a class="indexterm" name="idm46045106355344"> </a> <a class="indexterm" name="idm46045106353888"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for connect-retry-delay"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --connect-retry-delay=# </code> </td> </tr> <tr> <th> Type </th> <td> Integer </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> 5 </code> </td> </tr> <tr> <th> Minimum Value </th> <td> <code class="literal"> 0 </code> </td> </tr> <tr> <th> Maximum Value </th> <td> <code class="literal"> 5 </code> </td> </tr> </tbody> </table> </div> <p> Number of seconds to wait between attempts to contact management server. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_connect-string"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_connect-string"> <code class="option"> --connect-string </code> </a> </p> <a class="indexterm" name="idm46045106334704"> </a> <a class="indexterm" name="idm46045106333216"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for connect-string"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --connect-string=connection_string </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Same as <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-connectstring"> <code class="option"> --ndb-connectstring </code> </a> . </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_core-file"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_core-file"> <code class="option"> --core-file </code> </a> </p> <a class="indexterm" name="idm46045106317808"> </a> <a class="indexterm" name="idm46045106316320"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for core-file"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --core-file </code> </td> </tr> </tbody> </table> </div> <p> Write core file on error; used in debugging. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_defaults-extra-file"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_defaults-extra-file"> <code class="option"> --defaults-extra-file </code> </a> </p> <a class="indexterm" name="idm46045106306480"> </a> <a class="indexterm" name="idm46045106305024"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for defaults-extra-file"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --defaults-extra-file=path </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Read given file after global files are read. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_defaults-file"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_defaults-file"> <code class="option"> --defaults-file </code> </a> </p> <a class="indexterm" name="idm46045106290608"> </a> <a class="indexterm" name="idm46045106289120"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for defaults-file"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --defaults-file=path </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Read default options from given file only. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_defaults-group-suffix"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_defaults-group-suffix"> <code class="option"> --defaults-group-suffix </code> </a> </p> <a class="indexterm" name="idm46045106274848"> </a> <a class="indexterm" name="idm46045106273392"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for defaults-group-suffix"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --defaults-group-suffix=string </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Also read groups with concat(group, suffix). </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_encrypt-backup"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_encrypt-backup"> <code class="option"> --encrypt-backup </code> </a> </p> <a class="indexterm" name="idm46045106259040"> </a> <a class="indexterm" name="idm46045106257552"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for encrypt-backup"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --encrypt-backup </code> </td> </tr> </tbody> </table> </div> <p> When used, this option causes all backups to be encrypted. To make this happen whenever <a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client"> <span class="command"> <strong> ndb_mgm </strong> </span> </a> is run, put the option in the <code class="literal"> [ndb_mgm] </code> section of the <code class="filename"> my.cnf </code> file. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_execute"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_execute"> <code class="option"> --execute= <code class="literal"> command </code> </code> </a> , <code class="option"> -e <code class="literal"> command </code> </code> </p> <a class="indexterm" name="idm46045106243728"> </a> <a class="indexterm" name="idm46045106242240"> </a> <a class="indexterm" name="idm46045106240752"> </a> <a class="indexterm" name="idm46045106239264"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for execute"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --execute=command </code> </td> </tr> </tbody> </table> </div> <p> This option can be used to send a command to the NDB Cluster management client from the system shell. For example, either of the following is equivalent to executing <a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-show"> <code class="literal"> SHOW </code> </a> in the management client: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa12723900"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">ndb_mgm</span> <span class="token property">-e</span> <span class="token atrule">"SHOW"</span> <span class="token prompt">$&gt; </span><span class="token command">ndb_mgm</span> <span class="token constant">--execute</span>=<span class="token atrule">"SHOW"</span></code></pre> </div> <p> This is analogous to how the <a class="link" href="mysql-command-options.html#option_mysql_execute"> <code class="option"> --execute </code> </a> or <code class="option"> -e </code> option works with the <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client"> <span class="command"> <strong> mysql </strong> </span> </a> command-line client. See <a class="xref" href="command-line-options.html" title="6.2.2.1 Using Options on the Command Line"> Section 6.2.2.1, “Using Options on the Command Line” </a> . </p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <div class="admon-title"> Note </div> <p> If the management client command to be passed using this option contains any space characters, then the command <span class="emphasis"> <em> must </em> </span> be enclosed in quotation marks. Either single or double quotation marks may be used. If the management client command contains no space characters, the quotation marks are optional. </p> </div> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_help"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_help"> <code class="option"> --help </code> </a> </p> <a class="indexterm" name="idm46045106220464"> </a> <a class="indexterm" name="idm46045106218976"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for help"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --help </code> </td> </tr> </tbody> </table> </div> <p> Display help text and exit. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_login-path"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_login-path"> <code class="option"> --login-path </code> </a> </p> <a class="indexterm" name="idm46045106209120"> </a> <a class="indexterm" name="idm46045106207632"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for login-path"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --login-path=path </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Read given path from login file. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_no-login-paths"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_no-login-paths"> <code class="option"> --no-login-paths </code> </a> </p> <a class="indexterm" name="idm46045106193424"> </a> <a class="indexterm" name="idm46045106191936"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for no-login-paths"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --no-login-paths </code> </td> </tr> </tbody> </table> </div> <p> Skips reading options from the login path file. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_ndb-connectstring"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-connectstring"> <code class="option"> --ndb-connectstring </code> </a> </p> <a class="indexterm" name="idm46045106182272"> </a> <a class="indexterm" name="idm46045106180816"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for ndb-connectstring"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --ndb-connectstring=connection_string </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Set connect string for connecting to <a class="link" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon"> <span class="command"> <strong> ndb_mgmd </strong> </span> </a> . Syntax: [ <code class="literal"> nodeid= <em class="replaceable"> <code> id </code> </em> ; </code> ][ <code class="literal"> host= </code> ] <code class="literal"> <em class="replaceable"> <code> hostname </code> </em> </code> [ <code class="literal"> : <em class="replaceable"> <code> port </code> </em> </code> ]. Overrides entries in <code class="literal"> NDB_CONNECTSTRING </code> and <code class="filename"> my.cnf </code> . </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_ndb-nodeid"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-nodeid"> <code class="option"> --ndb-nodeid </code> </a> </p> <a class="indexterm" name="idm46045106160208"> </a> <a class="indexterm" name="idm46045106158720"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for ndb-nodeid"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --ndb-nodeid=# </code> </td> </tr> <tr> <th> Type </th> <td> Integer </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Set node ID for this node, overriding any ID set by <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-connectstring"> <code class="option"> --ndb-connectstring </code> </a> . </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_ndb-mgm-tls"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-mgm-tls"> <code class="option"> --ndb-mgm-tls </code> </a> </p> <a class="indexterm" name="idm46045106143440"> </a> <a class="indexterm" name="idm46045106141952"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for ndb-mgm-tls"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --ndb-mgm-tls=level </code> </td> </tr> <tr> <th> Type </th> <td> Enumeration </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> relaxed </code> </td> </tr> <tr> <th> Valid Values </th> <td> <p class="valid-value"> <code class="literal"> relaxed </code> </p> <p class="valid-value"> <code class="literal"> strict </code> </p> </td> </tr> </tbody> </table> </div> <p> Sets the level of TLS support required to connect to the management server; one of <code class="literal"> relaxed </code> or <code class="literal"> strict </code> . <code class="literal"> relaxed </code> (the default) means that a TLS connection is attempted, but success is not required; <code class="literal"> strict </code> means that TLS is required to connect. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_ndb-mgmd-host"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-mgmd-host"> <code class="option"> --ndb-mgmd-host </code> </a> </p> <a class="indexterm" name="idm46045106120896"> </a> <a class="indexterm" name="idm46045106119408"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for ndb-mgmd-host"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --ndb-mgmd-host=connection_string </code> </td> </tr> <tr> <th> Type </th> <td> String </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> [none] </code> </td> </tr> </tbody> </table> </div> <p> Same as <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-connectstring"> <code class="option"> --ndb-connectstring </code> </a> . </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_ndb-optimized-node-selection"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-optimized-node-selection"> <code class="option"> --ndb-optimized-node-selection </code> </a> </p> <a class="indexterm" name="idm46045106104144"> </a> <a class="indexterm" name="idm46045106102640"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for ndb-optimized-node-selection"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --ndb-optimized-node-selection </code> </td> </tr> </tbody> </table> </div> <p> Enable optimizations for selection of nodes for transactions. Enabled by default; use <code class="option"> --skip-ndb-optimized-node-selection </code> to disable. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_ndb-tls-search-path"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_ndb-tls-search-path"> <code class="option"> --ndb-tls-search-path </code> </a> </p> <a class="indexterm" name="idm46045106092288"> </a> <a class="indexterm" name="idm46045106090832"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for ndb-tls-search-path"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --ndb-tls-search-path=list </code> </td> </tr> <tr> <th> Type </th> <td> Path name </td> </tr> <tr> <th> Default Value (Unix) </th> <td> <code class="literal"> $HOME/ndb-tls </code> </td> </tr> <tr> <th> Default Value (Windows) </th> <td> <code class="literal"> $HOMEDIR/ndb-tls </code> </td> </tr> </tbody> </table> </div> <p> Specify a list of directories to search for a CA file. On Unix platforms, the directory names are separated by colons ( <code class="literal"> : </code> ); on Windows systems, the semicolon character ( <code class="literal"> ; </code> ) is used as the separator. A directory reference may be relative or absolute; it may contain one or more environment variables, each denoted by a prefixed dollar sign ( <code class="literal"> $ </code> ), and expanded prior to use. </p> <p> Searching begins with the leftmost named directory and proceeds from left to right until a file is found. An empty string denotes an empty search path, which causes all searches to fail. A string consisting of a single dot ( <code class="literal"> . </code> ) indicates that the search path limited to the current working directory. </p> <p> If no search path is supplied, the compiled-in default value is used. This value depends on the platform used: On Windows, this is <code class="literal"> \ndb-tls </code> ; on other platforms (including Linux), it is <code class="literal"> $HOME/ndb-tls </code> . This can be overridden by compiling NDB Cluster using <a class="link" href="source-configuration-options.html#option_cmake_with_ndb_tls_search_path"> <code class="option"> -DWITH_NDB_TLS_SEARCH_PATH </code> </a> . </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_no-defaults"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_no-defaults"> <code class="option"> --no-defaults </code> </a> </p> <a class="indexterm" name="idm46045106067072"> </a> <a class="indexterm" name="idm46045106065584"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for no-defaults"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --no-defaults </code> </td> </tr> </tbody> </table> </div> <p> Do not read default options from any option file other than login file. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_print-defaults"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_print-defaults"> <code class="option"> --print-defaults </code> </a> </p> <a class="indexterm" name="idm46045106055696"> </a> <a class="indexterm" name="idm46045106054208"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for print-defaults"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --print-defaults </code> </td> </tr> </tbody> </table> </div> <p> Print program argument list and exit. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_test-tls"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_test-tls"> <code class="option"> --test-tls </code> </a> </p> <a class="indexterm" name="idm46045106044720"> </a> <a class="indexterm" name="idm46045106043232"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for test-tls"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --test-tls </code> </td> </tr> </tbody> </table> </div> <p> Connect using TLS, then exit. Output if successful is similar to what is shown here: </p> <div class="copytoclipboard-wrapper"> <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa33989433"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">&gt;$ ndb_mgm <span class="token property">--test-tls</span> Connected to Management Server at<span class="token punctuation">:</span> sakila<span class="token punctuation">:</span>1186 &gt;$</code></pre> </div> <p> See <a class="xref" href="mysql-cluster-tls.html" title="25.6.15 TLS Link Encryption for NDB Cluster"> Section 25.6.15, “TLS Link Encryption for NDB Cluster” </a> , for more information. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_try-reconnect"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_try-reconnect"> <code class="option"> --try-reconnect= <em class="replaceable"> <code> number </code> </em> </code> </a> </p> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for try-reconnect"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --try-reconnect=# </code> </td> </tr> <tr> <th> Deprecated </th> <td> Yes </td> </tr> <tr> <th> Type </th> <td> Numeric </td> </tr> <tr> <th> Type </th> <td> Integer </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> 12 </code> </td> </tr> <tr> <th> Default Value </th> <td> <code class="literal"> 3 </code> </td> </tr> <tr> <th> Minimum Value </th> <td> <code class="literal"> 0 </code> </td> </tr> <tr> <th> Maximum Value </th> <td> <code class="literal"> 4294967295 </code> </td> </tr> </tbody> </table> </div> <p> If the connection to the management server is broken, the node tries to reconnect to it every 5 seconds until it succeeds. By using this option, it is possible to limit the number of attempts to <em class="replaceable"> <code> number </code> </em> before giving up and reporting an error instead. </p> <p> This option is deprecated and subject to removal in a future release. Use <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_connect-retries"> <code class="option"> --connect-retries </code> </a> , instead. </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_usage"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_usage"> <code class="option"> --usage </code> </a> </p> <a class="indexterm" name="idm46045106004256"> </a> <a class="indexterm" name="idm46045106002768"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for usage"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --usage </code> </td> </tr> </tbody> </table> </div> <p> Display help text and exit; same as <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_help"> <code class="option"> --help </code> </a> . </p> </li> <li class="listitem"> <p> <a name="option_ndb_mgm_version"> </a> <a class="link" href="mysql-cluster-programs-ndb-mgm.html#option_ndb_mgm_version"> <code class="option"> --version </code> </a> </p> <a class="indexterm" name="idm46045105992160"> </a> <a class="indexterm" name="idm46045105990672"> </a> <div class="informaltable"> <table frame="box" rules="all" summary="Properties for version"> <colgroup> <col style="width: 30%"/> <col style="width: 70%"/> </colgroup> <tbody> <tr> <th> Command-Line Format </th> <td> <code class="literal"> --version </code> </td> </tr> </tbody> </table> </div> <p> Display version information and exit. </p> </li> </ul> </div> <p> Additional information about using <a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client"> <span class="command"> <strong> ndb_mgm </strong> </span> </a> can be found in <a class="xref" href="mysql-cluster-mgm-client-commands.html" title="25.6.1 Commands in the NDB Cluster Management Client"> Section 25.6.1, “Commands in the NDB Cluster Management Client” </a> . </p> </div> <br/> </div>

Dataset Card for "mysql_manual_8_4_en"

More Information needed

Downloads last month
33