Инструменты пользователя

Инструменты сайта


fox-manager-2.0-bpa:1.-общая-информация:тонкие-настройки-подключения-к-базе-данных

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
fox-manager-2.0-bpa:1.-общая-информация:тонкие-настройки-подключения-к-базе-данных [2020/06/10 23:24] erazorfox-manager-2.0-bpa:1.-общая-информация:тонкие-настройки-подключения-к-базе-данных [2023/09/06 19:27] (текущий) – [Проблемы с кодировкой] Техподдержка
Строка 3: Строка 3:
 По умолчанию программа Fox Manager уже настроена таким образом, чтобы максимально облегчить подключение к базе данных. Типовые настройки подходят для 95% пользователей, однако бывают ситуации, когда специфические настройки сервера или языковые настройки системы приводят к тому, что пользователи начинают испытывать проблемы с подключением или работой с базой данных. По умолчанию программа Fox Manager уже настроена таким образом, чтобы максимально облегчить подключение к базе данных. Типовые настройки подходят для 95% пользователей, однако бывают ситуации, когда специфические настройки сервера или языковые настройки системы приводят к тому, что пользователи начинают испытывать проблемы с подключением или работой с базой данных.
  
 +===== Длина текстовых колонок в БД =====
 +
 +По умолчанию текстовые строки записываются в базу данных как **varchar(255)**, что обычно соответствует 255 символам текста (кроме таких баз данных, как Oracle, где используется длина в 255 байт, а при использовании Unicode один символ может занимать до 3 байт).
 +
 +Обычно такого количества символов хватает, чтобы уместить туда названия функций, процессов, документов и др. элементов справочников программы. Но, при необходимости, вы можете изменить это значение, задав свою длину строк.
 +
 +Для этого необходимо отредактировать файл **Settings.ini**, который находится в папке **C:\Users\<имя пользователя>\AppData\Roaming\Fox Manager\**
 +
 +Измените значение параметра **DefaultStringColWidth=255** в разделе **[Settings]**.
 +
 +Для корректной работы необходимо изменить это значение для всех пользователей программы (отредактировать файлы Settings.ini в их папках). Если значение было изменено уже после того, как база данных была создана, то изменять структуру таблиц в базе данных для текстовых полей необходимо будет вручную, для соответствия заданному параметру.
 +
 +Не рекомендуем без необходимости менять это значение, а особенно, уменьшать значение ниже 255, так как это может привести к проблемам с совместимостью с будущими версиями программы.
 ===== Проблемы с кодировкой ===== ===== Проблемы с кодировкой =====
  
-Среди таких проблем можно отдельно выделить несоответствие кодировки, используемой сервером и программой, что приводит к тому, что вместо букв отображаются специфические символы или знаки вопроса «???????».+Иногда несоответствие кодировки, используемой сервером БД и программой, приводит к тому, что вместо букв отображаются специфические символы или знаки вопроса «???????».
  
-В случае возникновения подобных проблем следует прибегнуть к тонкой настройке соединения программы с базой данных. Параметры этих настроек находятся в файле **Connection.ini**, который расположен в папке: **C:\Users\<имя пользователя>\AppData\Roaming\Fox Manager 2.x BPA\**+В случае возникновения подобных проблем следует прибегнуть к тонкой настройке соединения программы с базой данных. Параметры этих настроек находятся в файле **Connection.ini**, который расположен в папке: **C:\Users\<имя пользователя>\AppData\Roaming\Fox Manager\**
  
 Откройте данный файл, например, в блокноте и отредактируйте параметры настроек подключения. Обратите внимание, что для каждого типа базы данных в файле **Connection.ini** существует свой раздел. Чтобы решить проблемы с кодировкой в большинстве случае достаточно изменить значение параметра **UseUnicode** с **False** на **True**. Откройте данный файл, например, в блокноте и отредактируйте параметры настроек подключения. Обратите внимание, что для каждого типа базы данных в файле **Connection.ini** существует свой раздел. Чтобы решить проблемы с кодировкой в большинстве случае достаточно изменить значение параметра **UseUnicode** с **False** на **True**.
  
 {{  :fox-manager-2.0-bpa:1.-общая-информация:connection-ini.png?nolink&  }} {{  :fox-manager-2.0-bpa:1.-общая-информация:connection-ini.png?nolink&  }}
 +
 +===== Проблемы при одновременном доступе к базе SQLite =====
 +
 +База данных SQLite является файловой и рекомендуется для работы одного пользователя, если вы планируете активно пользовать программой одновременно с нескольких рабочих мест и держать активными сразу несколько соединений с базой данных, то рекомендуем использовать клиент-серверную базу, например, PostgreSQL, MySQL, MS SQL Server и пр. Тем не менее, база данных SQLite позволяет организовать одновременную работу нескольких пользователей, для этого достаточно выставить следующие параметры в файле **Connection.ini** для типа базы [SQLite]:
 +
 +  * BusyTimeout = 5000
 +  * LockingMode = lmNormal
 +  * Synchronous = smExtra
  
 ===== Проблемы при подключении к базе MySQL 8.x ===== ===== Проблемы при подключении к базе MySQL 8.x =====
Строка 18: Строка 39:
  
   * Установите в настройках сервера MySQL 8 опцию «Use Legacy Authentication Method». Иногда для этого нужно запустить установку сервера заново и выбрать «Reconfigure» на странице установки/конфигурации.   * Установите в настройках сервера MySQL 8 опцию «Use Legacy Authentication Method». Иногда для этого нужно запустить установку сервера заново и выбрать «Reconfigure» на странице установки/конфигурации.
-  * Попробуйте выбрать прямой метод подключения к базу данных. Для этого отредактируйте файл Connection.ini и поставьте значение параметра Direct=True в разделе [MySQL]+  * Попробуйте выбрать прямой метод подключения к базе данных. Для этого отредактируйте файл Connection.ini и поставьте значение параметра Direct=True в разделе [MySQL]
   * Если подключится к базе прямым методом не удаётся, установите значение параметра Direct=False в разделе [MySQL] и обновите библиотеку доступа (libmysql.dll) до той же версии, которая используется на сервере. Не забывайте, что нужно учитывать разрядность (x86 или x64).   * Если подключится к базе прямым методом не удаётся, установите значение параметра Direct=False в разделе [MySQL] и обновите библиотеку доступа (libmysql.dll) до той же версии, которая используется на сервере. Не забывайте, что нужно учитывать разрядность (x86 или x64).
  
Строка 189: Строка 210:
 |ASCIIDataBase|Enables or disables ASCII support. The default value is False. Note:For this option usage set the UseUnicode option to false.| |ASCIIDataBase|Enables or disables ASCII support. The default value is False. Note:For this option usage set the UseUnicode option to false.|
 |BusyTimeout|Use the ClientLibrary option to set or get the timeout of waiting for locked resource (database or table). If resource is not unlocked during the time specified in BusyTimeout, then SQlite returns the SQLITE_BUSY error. Default value of this option is 0.  | |BusyTimeout|Use the ClientLibrary option to set or get the timeout of waiting for locked resource (database or table). If resource is not unlocked during the time specified in BusyTimeout, then SQlite returns the SQLITE_BUSY error. Default value of this option is 0.  |
 +|CipherLicense|Holds a license key for SQLCipher Commercial Edition. Note that SQLCipher is not supported in the Direct mode.|
 +|ConnectMode|The connection mode. **cmDefault** - The default value. The database is opened for reading and writing. Corresponds to the SQLite default behavior. **cmReadWrite** - The database is opened for reading and writing. **cmReadOnly** - The database is opened in read-only mode.|
 |ClientLibrary|Use the ClientLibrary option to set or get the client library location.| |ClientLibrary|Use the ClientLibrary option to set or get the client library location.|
 |DateFormat|Defines the format for storing dates in the database. If it is not specified, the default yyyy-mm-dd format will be used.  | |DateFormat|Defines the format for storing dates in the database. If it is not specified, the default yyyy-mm-dd format will be used.  |
Строка 199: Строка 222:
 |ForegnKeys|Enables or disables the enforcement of foreign key constraints. Foreign key constraints are disabled by default in SQLite, so this option can be used to force enabling or disabling them by the application. Default value of this option is True.| |ForegnKeys|Enables or disables the enforcement of foreign key constraints. Foreign key constraints are disabled by default in SQLite, so this option can be used to force enabling or disabling them by the application. Default value of this option is True.|
 |ForceCreateDatabase|Used to force TLiteConnection to create a new database before opening a connection, if the database does not exist.| |ForceCreateDatabase|Used to force TLiteConnection to create a new database before opening a connection, if the database does not exist.|
 +|JournalMode|The journal mode. **jmDelete** - The rollback journal is deleted at the conclusion of each transaction. **jmTruncate** - The rollback journal is stored in volatile RAM. It reduces disk I/O, but decreases database safety and integrity. If the application using SQLite crashes in the middle of a transaction, the database file may become corrupt. **jmPersist** - The rollback journal file is not deleted when the transaction is commited. The header of the journal is filled with zeroes to prevent other connections rolling back from the journal. This mode optimizes performance on platforms where deleting or truncating a file is much more expensive than overwriting the first block of a file with zeros. **jmMemory** - The rollback journal is stored in volatile RAM. This reduces the disk I/O, but decreases database safety and integrity. If the application using SQLite crashes in the middle of a transaction in this mode, the database file is likely to become corrupt. **jmWAL** - A write-ahead log is used instead of a rollback journal to implement transactions. When data database is updated, the original content is preserved in the database file and the changes are appended in a separate WAL file. All the transactions that are appended in the WAL file are eventually transferred back into the original database. **jmOff** - The rollback journal is completely disabled. No rollback journal is created, thus there is no rollback journal to delete. The ROLLBACK command does not work – it behaves in an undefined way. Avoid using the ROLLBACK command when the journal mode is disabled. **jmDefault** - The default value. If the database was previously opened in the WAL mode, then Default will open the database in the WAL mode; otherwise, the database will be opened in the Delete mode.|
 +|LockingMode|The database locking mode. **lmExclusive** - The database connection never releases file locks. The first time the database is read or written in this mode, a shared lock is obtained and held. Use this mode if you want to prevent other processes from accessing the database file, reduce the number of filesystem operations, or access WAL databases without using the shared memory. **lmNormal** - The database connection unlocks the database file at the conclusion of each read or write transaction.|
 +|NativeDate|If the option is set to True, the date and time values will be stored in the database in the native SQLite format, and when retrieved, they will be converted to the TDateTime type. If set to False, no conversion to the TDateTime type will be made. The default value is True.|
 |ReadUncommitted|Enables or disables Read-Uncommitted isolation mode. A database connection in read-uncommitted mode does not attempt to obtain read-locks before reading from database tables as described above. This can lead to inconsistent query results if another database connection modifies a table while it is being read, but it also means that a read-transaction opened by a connection in read-uncommitted mode can neither block nor be blocked by any other connection. Default value of this option is False.  | |ReadUncommitted|Enables or disables Read-Uncommitted isolation mode. A database connection in read-uncommitted mode does not attempt to obtain read-locks before reading from database tables as described above. This can lead to inconsistent query results if another database connection modifies a table while it is being read, but it also means that a read-transaction opened by a connection in read-uncommitted mode can neither block nor be blocked by any other connection. Default value of this option is False.  |
 +|Synchronous|The database synchronization mode when writing to disk. **smOff** - The database engine continues without syncing after handing data off to the operating system. If the application running SQLite crashes, the data will safe, unless the operating system crashes or the computer loses power before data has been written to disk, in which case the database might become corrupted. This is the fastest mode. **smNormal** - The database engine still syncs at the most critical moments, but less often than in the FULL mode. The Normal mode is faster than the Full mode. When using the WAL mode (and probably the DELETE mode) with synchronous=NORMAL, data is safe from corruption. The synchronous=NORMAL setting is a reasonable choice for most applications running in the WAL mode. **smFull** - The database engine ensures that all content is safely written to disk before continuing. This preserves database integrity even in case of an operating system failure or power outage. It is a safe, but slower mode, and is most commonly used when not in the WAL mode. **smExtra** - This mode is similar to the FULL mode, but in the DELETE mode, the directory containing the rollback journal is synced after that journal is unlinked to commit a transaction. This provides additional durability if a power outage occurs right after the commit. Note: Keep the default Synchronous=smOff and LockingMode=lmExclusive for the best perfomance.|
 |TimeFormat|Defines the format for storing time in the database. If it is not specified, the default hh24:mi:ss format will be used.  | |TimeFormat|Defines the format for storing time in the database. If it is not specified, the default hh24:mi:ss format will be used.  |
-|UseUnicode|Enables or disables Unicode support. Affects character data fetched from the server. When set to True, all character data is stored as WideStrings, and TStringField is replaced by TWideStringFiled.|+|UseUnicode|Enables or disables Unicode support. When set to True, all character data is stored as WideString, and TStringField is used instead of TWideStringField. The default value is False.|
  
 \\ \\
  
  
fox-manager-2.0-bpa/1.-общая-информация/тонкие-настройки-подключения-к-базе-данных.1591820683.txt.gz · Последнее изменение: 2020/06/10 23:24 — erazor

Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki