本篇內(nèi)容介紹了“怎么理解TiDB兼容MySQL參數(shù)優(yōu)化”的有關(guān)知識(shí),在實(shí)際案例的操作過程中,不少人都會(huì)遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站制作、成都網(wǎng)站建設(shè)與策劃設(shè)計(jì),蓬溪網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:蓬溪等地區(qū)。蓬溪做網(wǎng)站價(jià)格咨詢:13518219792
默認(rèn) SQL mode 與 MySQL 已相同
TiDB 和 MySQL 5.7 中均為 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
當(dāng)前:
mysql> SELECT @@sql_mode
-> ;
+--------------------------------------------+
| @@sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
mysql>
SET [ SESSION | GLOBAL ] sql_mode='modes'`;
SET GLOBAL sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
tidb
設(shè)置最大連接:
set global max_user_connections=200;
mysql> show variables like '%conn%';
+-----------------------------------------------+-----------------+
| Variable_name | Value |
+-----------------------------------------------+-----------------+
| performance_schema_session_connect_attrs_size | 512 |
| disconnect_on_expired_password | 1 |
| collation_connection | utf8_general_ci |
| character_set_connection | utf8 |
| connect_timeout | 10 |
| max_user_connections | 0 |
| max_connections | 151 |
| init_connect | |
| max_connect_errors | 100 |
+-----------------------------------------------+-----------------+
9 rows in set (0.01 sec)
mysql>
mysql> show variables like '%log%';
+------------------------------------------+------------------------------------------+
| Variable_name | Value |
+------------------------------------------+------------------------------------------+
| relay_log_space_limit | 0 |
| ndb_table_no_logging | |
| relay_log_recovery | 0 |
| log_bin | 0 |
| innodb_mirrored_log_groups | 1 |
| innodb_log_buffer_size | 8388608 |
| log_slave_updates | 0 |
| log_error | /usr/local/mysql/data/localhost.err |
| log_bin_use_v1_row_events | 0 |
| innodb_log_files_in_group | 2 |
| tidb_slow_log_threshold | 300 |
| binlog_gtid_simple_recovery | 1 |
| relay_log_info_file | relay-log.info |
| back_log | 80 |
| tidb_general_log | 0 |
| innodb_log_file_size | 50331648 |
| innodb_api_enable_binlog | 0 |
| innodb_log_group_home_dir | ./ |
| tidb_query_log_max_len | 2048 |
| log_output | FILE |
| innodb_locks_unsafe_for_binlog | 0 |
| relay_log_info_repository | FILE |
| innodb_undo_logs | 128 |
| binlog_checksum | CRC32 |
| innodb_flush_log_at_timeout | 1 |
| slow_query_log_file | /usr/local/mysql/data/localhost-slow.log |
| binlog_direct_non_transactional_updates | OFF |
| innodb_online_alter_log_max_size | 134217728 |
| log_timestamps | |
| max_binlog_stmt_cache_size | 18446744073709547520 |
| innodb_log_compressed_pages | ON |
| binlog_format | STATEMENT |
| innodb_max_undo_log_size | |
| log_queries_not_using_indexes | OFF |
| relay_log_purge | ON |
| binlog_cache_size | 32768 |
| innodb_log_checksum_algorithm | |
| ndb_log_binlog_index | |
| max_binlog_cache_size | 18446744073709547520 |
| binlog_max_flush_queue_time | 0 |
| binlog_rows_query_log_events | OFF |
| slow_query_log | OFF |
| general_log | 0 |
| max_binlog_size | 1073741824 |
| binlog_stmt_cache_size | 32768 |
| sql_log_bin | 1 |
| general_log_file | /usr/local/mysql/data/localhost.log |
| log_slow_slave_statements | OFF |
| sql_log_off | OFF |
| innodb_log_write_ahead_size | |
| log_backward_compatible_user_definitions | |
| log_syslog | |
| sync_binlog | 0 |
| binlog_group_commit_sync_delay | |
| log_syslog_include_pid | |
| binlog_order_commits | ON |
| innodb_undo_log_truncate | |
| sync_relay_log_info | 10000 |
| log_error_verbosity | |
| log_warnings | 1 |
| log_syslog_facility | |
| binlogging_impossible_mode | IGNORE_ERROR |
| ndb_log_updated_only | |
| ndb_log_empty_epochs | |
| binlog_group_commit_sync_no_delay_count | |
| innodb_flush_log_at_trx_commit | 1 |
| log_bin_trust_function_creators | OFF |
| binlog_error_action | IGNORE_ERROR |
| log_throttle_queries_not_using_indexes | 0 |
| max_relay_log_size | 0 |
| binlog_row_image | FULL |
| sync_relay_log | 10000 |
| log_slow_admin_statements | OFF |
| log_syslog_tag | |
| expire_logs_days | 0 |
+------------------------------------------+------------------------------------------+
75 rows in set (0.01 sec)
mysql>
set global max_connections=1000; #這個(gè)參數(shù)需要重啟db
設(shè)置后需要重啟
SET GLOBAL binlog_format = 'ROW'; #這個(gè)參數(shù)動(dòng)態(tài)修改
重啟服務(wù):
停止tidb服務(wù):
ansible-playbook stop.yml --tags=tidb
啟動(dòng)tidb服務(wù):
ansible-playbook start.yml --tags=tidb
“怎么理解TiDB兼容MySQL參數(shù)優(yōu)化”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
本文標(biāo)題:怎么理解TiDB兼容MySQL參數(shù)優(yōu)化
網(wǎng)站網(wǎng)址:http://aaarwkj.com/article14/jeigde.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、網(wǎng)站收錄、電子商務(wù)、標(biāo)簽優(yōu)化、服務(wù)器托管、移動(dòng)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)