Kaynak türleri için [Yerel dosya](#dicts-external_dicts_dict_sources-local_file), [Yürütülebilir dosya](#dicts-external_dicts_dict_sources-executable), [HTTP (s)](#dicts-external_dicts_dict_sources-http), [ClickHouse](#dicts-external_dicts_dict_sources-clickhouse)
Yürütülebilir dosyalarla çalışmak Aşağıdakilere bağlıdır [sözlük bellekte nasıl saklanır](external-dicts-dict-layout.md). Sözlük kullanılarak saklan theıyorsa `cache` ve `complex_key_cache` ClickHouse, yürütülebilir dosyanın STDIN'SİNE bir istek göndererek gerekli anahtarları ister. Aksi takdirde, clickhouse yürütülebilir dosyayı başlatır ve çıktısını sözlük verileri olarak değerlendirir.
Bir HTTP (s) sunucusuyla çalışmak Aşağıdakilere bağlıdır [sözlük bellekte nasıl saklanır](external-dicts-dict-layout.md). Sözlük kullanılarak saklan theıyorsa `cache` ve `complex_key_cache`, ClickHouse aracılığıyla bir istek göndererek gerekli anahtarları ister `POST` yöntem.
-`invalidate_query`– Query for checking the dictionary status. Optional parameter. Read more in the section [Sözlükleri güncelleme](external-dicts-dict-lifetime.md).
ClickHouse, ODBC sürücüsünden alıntı sembolleri alır ve sorgulardaki tüm ayarları sürücüye aktarır, bu nedenle tablo adını veritabanındaki tablo adı durumuna göre ayarlamak gerekir.
ODBC sürücüsü bağlantı parametresi aracılığıyla veritabanına bağlanırken `Servername` yerine. Bu durumda değerler `USERNAME` ve `PASSWORD` itibaren `odbc.ini` uzak sunucuya gönderilir ve tehlikeye girebilir.
### Mysql {#dicts-external_dicts_dict_sources-mysql}
Ayarlar örneği:
``` xml
<source>
<mysql>
<port>3306</port>
<user>clickhouse</user>
<password>qwerty</password>
<replica>
<host>example01-1</host>
<priority>1</priority>
</replica>
<replica>
<host>example01-2</host>
<priority>1</priority>
</replica>
<db>db_name</db>
<table>table_name</table>
<where>id=10</where>
<invalidate_query>SQL_QUERY</invalidate_query>
</mysql>
</source>
```
veya
``` sql
SOURCE(MYSQL(
port 3306
user 'clickhouse'
password 'qwerty'
replica(host 'example01-1' priority 1)
replica(host 'example01-2' priority 1)
db 'db_name'
table 'table_name'
where 'id=10'
invalidate_query 'SQL_QUERY'
))
```
Ayar alanları:
-`port`– The port on the MySQL server. You can specify it for all replicas, or for each one individually (inside `<replica>`).
-`user`– Name of the MySQL user. You can specify it for all replicas, or for each one individually (inside `<replica>`).
-`password`– Password of the MySQL user. You can specify it for all replicas, or for each one individually (inside `<replica>`).
-`replica`– Section of replica configurations. There can be multiple sections.
-`replica/host`– The MySQL host.
-`replica/priority`– The replica priority. When attempting to connect, ClickHouse traverses the replicas in order of priority. The lower the number, the higher the priority.
-`db`– Name of the database.
-`table`– Name of the table.
-`where`– The selection criteria. The syntax for conditions is the same as for `WHERE` MySQL, örneğin, `id > 10 AND id < 20`. İsteğe bağlı parametre.
-`invalidate_query`– Query for checking the dictionary status. Optional parameter. Read more in the section [Sözlükleri güncelleme](external-dicts-dict-lifetime.md).
-`host`– The ClickHouse host. If it is a local host, the query is processed without any network activity. To improve fault tolerance, you can create a [Dağılı](../../../engines/table-engines/special/distributed.md) tablo ve sonraki yapılandırmalarda girin.
-`invalidate_query`– Query for checking the dictionary status. Optional parameter. Read more in the section [Sözlükleri güncelleme](external-dicts-dict-lifetime.md).
-`storage_type`– The structure of internal Redis storage using for work with keys. `simple` basit kaynaklar ve karma tek anahtar kaynaklar içindir, `hash_map` iki anahtarlı karma kaynaklar içindir. Ranged kaynakları ve karmaşık anahtarlı önbellek kaynakları desteklenmez. İhmal edilebilir, varsayılan değer `simple`.
-`db_index`– The specific numeric index of Redis logical database. May be omitted, default value is 0.