my.cnf_MySQL

Jun 01, 2016 pm 01:54 PM

 

The server maintains many system variables that indicate how it is configured. All of them have default values. They can be set at server startup using options on the command line or in option files. Most of them can be set at runtime using the SET statement.

Beginning with MySQL 4.0.3, the mysqld server maintains two kinds of variables. Global variables affect the overall operation of the server. Session variables affect its operation for inpidual client connections.

When the server starts, it initializes all global variables to their default values. These defaults can be changed by options specified in option files or on the command line. After the server starts, those global variables that are dynamic can be changed by connecting to the server and issuing a SET GLOBAL <em class="replaceable"><code>var_name statement. To change a global variable, you must have the SUPER privilege.

The server also maintains a set of session variables for each client that connects. The client's session variables are initialized at connect time using the current values of the corresponding global variables. For those session variables that are dynamic, the client can change them by issuing a SET SESSION <em class="replaceable"><code>var_name statement. Setting a session variable requires no special privilege, but a client can change only its own session variables, not those of any other client.

A change to a global variable is visible to any client that accesses that global variable. However, it affects the corresponding session variable that is initialized from the global variable only for clients that connect after the change. It does not affect the session variable for any client that is currently connected (not even that of the client that issues the SET GLOBAL statement).

When setting a variable using a startup option, variable values can be given with a suffix of K, M, or G to indicate kilobytes, megabytes, or gigabytes, respectively. For example, the following command starts the server with a key buffer size of 16 megabytes:

mysqld --key_buffer_size=16M<BR>
ログイン後にコピー

Before MySQL 4.0, use this syntax instead:

mysqld --set-variable=key_buffer_size=16M<BR>
ログイン後にコピー

The lettercase of suffix letters does not matter; 16M and 16m are equivalent.

At runtime, use the SET statement to set system variables. In this context, suffix letters cannot be used, but the value can take the form of an expression:

mysql> SET sort_buffer_size = 10 * 1024 * 1024;<BR>
ログイン後にコピー

To specify explicitly whether to set the global or session variable, use the GLOBAL or SESSION options:

mysql> SET GLOBAL sort_buffer_size = 10 * 1024 * 1024;<BR>mysql> SET SESSION sort_buffer_size = 10 * 1024 * 1024;<BR>
ログイン後にコピー

Without either option, the statement sets the session variable.

The variables that can be set at runtime are listed in Section 5.3.3.1, “Dynamic System Variables”.

If you want to restrict the maximum value to which a system variable can be set with the SET statement, you can specify this maximum by using an option of the form --maximum-<EM class=replaceable><CODE>var_name at server startup. For example, to prevent the value of query_cache_size from being increased to more than 32MB at runtime, use the option --maximum-query_cache_size=32M. This feature is available as of MySQL 4.0.2.

You can view system variables and their values by using the SHOW VARIABLES statement. See Section 9.4, “System Variables” for more information.

mysql> SHOW VARIABLES;<BR>+---------------------------------+-------------------------------------------------------------+<BR>| Variable_name                   | Value                                                       |<BR>+---------------------------------+-------------------------------------------------------------+<BR>| auto_increment_increment        | 1                                                           |<BR>| auto_increment_offset           | 1                                                           |<BR>| back_log                        | 50                                                          |<BR>| basedir                         | /usr/local/mysql                                            |<BR>| bdb_cache_size                  | 8388600                                                     |<BR>| bdb_home                        | /usr/local/mysql                                            |<BR>| bdb_log_buffer_size             | 131072                                                      |<BR>| bdb_logdir                      |                                                             |<BR>| bdb_max_lock                    | 10000                                                       |<BR>| bdb_shared_data                 | OFF                                                         |<BR>| bdb_tmpdir                      | /tmp/                                              |<BR>| binlog_cache_size               | 32768                                                       |<BR>| bulk_insert_buffer_size         | 8388608                                                     |<BR>| character_set_client            | latin1                                                      |<BR>| character_set_connection        | latin1                                                      |<BR>| character_set_database          | latin1                                                      |<BR>| character_set_results           | latin1                                                      |<BR>| character_set_server            | latin1                                                      |<BR>| character_set_system            | utf8                                                        |<BR>| character_sets_dir              | /usr/local/mysql/share/charsets/                            |<BR>| collation_connection            | latin1_swedish_ci                                           |<BR>| collation_database              | latin1_swedish_ci                                           |<BR>| collation_server                | latin1_swedish_ci                                           |<BR>| concurrent_insert               | 1                                                           |<BR>| connect_timeout                 | 5                                                           |<BR>| datadir                         | /usr/local/mysql/data/                                      |<BR>| date_format                     | %Y-%m-%d                                                    |<BR>| datetime_format                 | %Y-%m-%d %H:%i:%s                                           |<BR>| default_week_format             | 0                                                           |<BR>| delay_key_write                 | ON                                                          |<BR>| delayed_insert_limit            | 100                                                         |<BR>| delayed_insert_timeout          | 300                                                         |<BR>| delayed_queue_size              | 1000                                                        |<BR>| expire_logs_days                | 0                                                           |<BR>| flush                           | OFF                                                         |<BR>| flush_time                      | 1800                                                        |<BR>| ft_boolean_syntax               | + -><()~*:""&|                                              |<BR>| ft_max_word_len                 | 84                                                          |<BR>| ft_min_word_len                 | 4                                                           |<BR>| ft_query_expansion_limit        | 20                                                          |<BR>| ft_stopword_file                | (built-in)                                                  |<BR>| group_concat_max_len            | 1024                                                        |<BR>| have_archive                    | NO                                                          |<BR>| have_bdb                        | YES                                                         |<BR>| have_compress                   | YES                                                         |<BR>| have_crypt                      | NO                                                          |<BR>| have_csv                        | NO                                                          |<BR>| have_example_engine             | NO                                                          |<BR>| have_geometry                   | YES                                                         |<BR>| have_innodb                     | YES                                                         |<BR>| have_isam                       | NO                                                          |<BR>| have_ndbcluster                 | NO                                                          |<BR>| have_openssl                    | YES                                                         |<BR>| have_query_cache                | YES                                                         |<BR>| have_raid                       | NO                                                          |<BR>| have_rtree_keys                 | YES                                                         |<BR>| have_symlink                    | YES                                                         |<BR>| init_connect                    |                                                             |<BR>| init_file                       |                                                             |<BR>| init_slave                      |                                                             |<BR>| innodb_additional_mem_pool_size | 2097152                                                     |<BR>| innodb_autoextend_increment     | 8                                                           |<BR>| innodb_buffer_pool_awe_mem_mb   | 0                                                           |<BR>| innodb_buffer_pool_size         | 8388608                                                     |<BR>| innodb_data_file_path           | ibdata1:10M:autoextend                                      |<BR>| innodb_data_home_dir            |                                                             |<BR>| innodb_fast_shutdown            | 1                                                           |<BR>| innodb_file_io_threads          | 4                                                           |<BR>| innodb_file_per_table           | OFF                                                         |<BR>| innodb_locks_unsafe_for_binlog  | OFF                                                         |<BR>| innodb_flush_log_at_trx_commit  | 1                                                           |<BR>| innodb_flush_method             |                                                             |<BR>| innodb_force_recovery           | 0                                                           |<BR>| innodb_lock_wait_timeout        | 50                                                          |<BR>| innodb_log_arch_dir             |                                                             |<BR>| innodb_log_archive              | OFF                                                         |<BR>| innodb_log_buffer_size          | 1048576                                                     |<BR>| innodb_log_file_size            | 10485760                                                    |<BR>| innodb_log_files_in_group       | 2                                                           |<BR>| innodb_log_group_home_dir       | ./                                                          |<BR>| innodb_max_dirty_pages_pct      | 90                                                          |<BR>| innodb_max_purge_lag            | 0                                                           |<BR>| innodb_mirrored_log_groups      | 1                                                           |<BR>| innodb_open_files               | 300                                                         |<BR>| innodb_table_locks              | ON                                                          |<BR>| innodb_thread_concurrency       | 8                                                           |<BR>| interactive_timeout             | 28800                                                       |<BR>| join_buffer_size                | 131072                                                      |<BR>| key_buffer_size                 | 4194304                                                     |<BR>| key_cache_age_threshold         | 300                                                         |<BR>| key_cache_block_size            | 1024                                                        |<BR>| key_cache_pision_limit        | 100                                                         |<BR>| language                        | /usr/local/mysql/share/english/                             |<BR>| large_files_support             | ON                                                          |<BR>| license                         | GPL                                                         |<BR>| local_infile                    | ON                                                          |<BR>| log                             | OFF                                                         |<BR>| log_bin                         | OFF                                                         |<BR>| log_error                       | ./gigan.err                                                 |<BR>| log_slave_updates               | OFF                                                         |<BR>| log_slow_queries                | OFF                                                         |<BR>| log_update                      | OFF                                                         |<BR>| log_warnings                    | 1                                                           |<BR>| long_query_time                 | 10                                                          |<BR>| low_priority_updates            | OFF                                                         |<BR>| lower_case_file_system          | OFF                                                         |<BR>| lower_case_table_names          | 1                                                           |<BR>| max_allowed_packet              | 1048576                                                     |<BR>| max_binlog_cache_size           | 4294967295                                                  |<BR>| max_binlog_size                 | 1073741824                                                  |<BR>| max_connect_errors              | 10                                                          |<BR>| max_connections                 | 100                                                         |<BR>| max_delayed_threads             | 20                                                          |<BR>| max_error_count                 | 64                                                          |<BR>| max_heap_table_size             | 16777216                                                    |<BR>| max_insert_delayed_threads      | 20                                                          |<BR>| max_join_size                   | 4294967295                                                  |<BR>| max_length_for_sort_data        | 1024                                                        |<BR>| max_relay_log_size              | 0                                                           |<BR>| max_seeks_for_key               | 4294967295                                                  |<BR>| max_sort_length                 | 1024                                                        |<BR>| max_tmp_tables                  | 32                                                          |<BR>| max_user_connections            | 0                                                           |<BR>| max_write_lock_count            | 4294967295                                                  |<BR>| myisam_data_pointer_size        | 4                                                           |<BR>| myisam_max_sort_file_size       | 107374182400                                                |<BR>| myisam_recover_options          | OFF                                                         |<BR>| myisam_repair_threads           | 1                                                           |<BR>| myisam_sort_buffer_size         | 8388608                                                     |<BR>| named_pipe                      | OFF                                                         |<BR>| net_buffer_length               | 16384                                                       |<BR>| net_read_timeout                | 30                                                          |<BR>| net_retry_count                 | 10                                                          |<BR>| net_write_timeout               | 60                                                          |<BR>| new                             | OFF                                                         |<BR>| old_passwords                   | OFF                                                         |<BR>| open_files_limit                | 622                                                         |<BR>| optimizer_prune_level           | 1                                                           |<BR>| optimizer_search_depth          | 62                                                          |<BR>| pid_file                        | /usr/local/mysql/gigan.pid                                  |<BR>| port                            | 3306                                                        |<BR>| preload_buffer_size             | 32768                                                       |<BR>| protocol_version                | 10                                                          |<BR>| query_alloc_block_size          | 8192                                                        |<BR>| query_cache_limit               | 1048576                                                     |<BR>| query_cache_min_res_unit        | 4096                                                        |<BR>| query_cache_size                | 0                                                           |<BR>| query_cache_type                | ON                                                          |<BR>| query_cache_wlock_invalidate    | OFF                                                         |<BR>| query_prealloc_size             | 8192                                                        |<BR>| range_alloc_block_size          | 2048                                                        |<BR>| read_buffer_size                | 61440                                                       |<BR>| read_only                       | OFF                                                         |<BR>| read_rnd_buffer_size            | 258048                                                      |<BR>| relay_log_purge                 | ON                                                          |<BR>| rpl_recovery_rank               | 0                                                           |<BR>| secure_auth                     | OFF                                                         |<BR>| shared_memory                   | OFF                                                         |<BR>| shared_memory_base_name         | MYSQL                                                       |<BR>| server_id                       | 0                                                           |<BR>| skip_external_locking           | ON                                                          |<BR>| skip_networking                 | OFF                                                         |<BR>| skip_show_database              | OFF                                                         |<BR>| slave_net_timeout               | 3600                                                        |<BR>| slow_launch_time                | 2                                                           |<BR>| socket                          | /tmp/mysql.sock                                             |<BR>| sort_buffer_size                | 217080                                                      |<BR>| sql_mode                        |                                                             |<BR>| storage_engine                  | MyISAM                                                      |<BR>| sync_binlog                     | 0                                                           |<BR>| sync_frm                        | ON                                                          |<BR>| system_time_zone                | E. Australia Standard Time                                  |<BR>| table_cache                     | 256                                                         |<BR>| table_type                      | MyISAM                                                      |<BR>| thread_cache_size               | 0                                                           |<BR>| thread_stack                    | 196608                                                      |<BR>| time_format                     | %H:%i:%s                                                    |<BR>| time_zone                       | SYSTEM                                                      |<BR>| tmp_table_size                  | 5242880                                                     |<BR>| tmpdir                          | /tmp/                                                       |<BR>| transaction_alloc_block_size    | 8192                                                        |<BR>| transaction_prealloc_size       | 4096                                                        |<BR>| tx_isolation                    | REPEATABLE-READ                                             |<BR>| updatable_views_with_limit      | YES                                                         |<BR>| version                         | 5.0.2-alpha-max                                             |<BR>| version_bdb                     | Sleepycat Software: Berkeley DB 4.1.24: (December  1, 2004) |<BR>| version_comment                 | Source distribution                                         |<BR>| wait_timeout                    | 28800                                                       |<BR>+---------------------------------+-------------------------------------------------------------+
ログイン後にコピー
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

MySQLでインデックスを使用するよりも、フルテーブルスキャンがいつ速くなるのでしょうか? MySQLでインデックスを使用するよりも、フルテーブルスキャンがいつ速くなるのでしょうか? Apr 09, 2025 am 12:05 AM

完全なテーブルスキャンは、MySQLでインデックスを使用するよりも速い場合があります。特定のケースには以下が含まれます。1)データボリュームは小さい。 2)クエリが大量のデータを返すとき。 3)インデックス列が高度に選択的でない場合。 4)複雑なクエリの場合。クエリプランを分析し、インデックスを最適化し、オーバーインデックスを回避し、テーブルを定期的にメンテナンスすることにより、実際のアプリケーションで最良の選択をすることができます。

INNODBフルテキスト検索機能を説明します。 INNODBフルテキスト検索機能を説明します。 Apr 02, 2025 pm 06:09 PM

INNODBのフルテキスト検索機能は非常に強力であり、データベースクエリの効率と大量のテキストデータを処理する能力を大幅に改善できます。 1)INNODBは、倒立インデックスを介してフルテキスト検索を実装し、基本的および高度な検索クエリをサポートします。 2)一致を使用してキーワードを使用して、ブールモードとフレーズ検索を検索、サポートします。 3)最適化方法には、単語セグメンテーションテクノロジーの使用、インデックスの定期的な再構築、およびパフォーマンスと精度を改善するためのキャッシュサイズの調整が含まれます。

Windows 7にMySQLをインストールできますか? Windows 7にMySQLをインストールできますか? Apr 08, 2025 pm 03:21 PM

はい、MySQLはWindows 7にインストールできます。MicrosoftはWindows 7のサポートを停止しましたが、MySQLは引き続き互換性があります。ただし、インストールプロセス中に次のポイントに注意する必要があります。WindowsのMySQLインストーラーをダウンロードしてください。 MySQL(コミュニティまたはエンタープライズ)の適切なバージョンを選択します。インストールプロセス中に適切なインストールディレクトリと文字セットを選択します。ルートユーザーパスワードを設定し、適切に保ちます。テストのためにデータベースに接続します。 Windows 7の互換性とセキュリティの問題に注意してください。サポートされているオペレーティングシステムにアップグレードすることをお勧めします。

INNODBのクラスターインデックスと非クラスターインデックス(セカンダリインデックス)の違い。 INNODBのクラスターインデックスと非クラスターインデックス(セカンダリインデックス)の違い。 Apr 02, 2025 pm 06:25 PM

クラスター化されたインデックスと非クラスター化されたインデックスの違いは次のとおりです。1。クラスター化されたインデックスは、インデックス構造にデータを保存します。これは、プライマリキーと範囲でクエリするのに適しています。 2.非クラスター化されたインデックスストアは、インデックスキー値とデータの行へのポインターであり、非プリマリーキー列クエリに適しています。

人気のあるMySQL GUIツール(MySQL Workbench、PhpMyAdminなど)は何ですか? 人気のあるMySQL GUIツール(MySQL Workbench、PhpMyAdminなど)は何ですか? Mar 21, 2025 pm 06:28 PM

記事では、MySQLワークベンチやPHPMyAdminなどの人気のあるMySQL GUIツールについて説明し、初心者と上級ユーザーの機能と適合性を比較します。[159文字]

MySQLの大きなデータセットをどのように処理しますか? MySQLの大きなデータセットをどのように処理しますか? Mar 21, 2025 pm 12:15 PM

記事では、MySQLで大規模なデータセットを処理するための戦略について説明します。これには、パーティション化、シャード、インデックス作成、クエリ最適化などがあります。

MySQL:簡単な学習のためのシンプルな概念 MySQL:簡単な学習のためのシンプルな概念 Apr 10, 2025 am 09:29 AM

MySQLは、オープンソースのリレーショナルデータベース管理システムです。 1)データベースとテーブルの作成:createdatabaseおよびcreateTableコマンドを使用します。 2)基本操作:挿入、更新、削除、選択。 3)高度な操作:参加、サブクエリ、トランザクション処理。 4)デバッグスキル:構文、データ型、およびアクセス許可を確認します。 5)最適化の提案:インデックスを使用し、選択*を避け、トランザクションを使用します。

MySQLユーザーとデータベースの関係 MySQLユーザーとデータベースの関係 Apr 08, 2025 pm 07:15 PM

MySQLデータベースでは、ユーザーとデータベースの関係は、アクセス許可と表によって定義されます。ユーザーには、データベースにアクセスするためのユーザー名とパスワードがあります。許可は助成金コマンドを通じて付与され、テーブルはCreate Tableコマンドによって作成されます。ユーザーとデータベースの関係を確立するには、データベースを作成し、ユーザーを作成してから許可を付与する必要があります。

See all articles