# よくあるトラブル

## 1. MySQLデータベースを使用すると、500 Internal Server Errorというエラーメッセージが表示される

同様のエラーメッセージは次のとおりです。

* populate() isn't reentrant
* MySQLdb.\_exceptions.OperationalError: (2059, NULL)

### 解決方法：

Djangoは現在mysql8.0のcaching\_sha2\_password暗号化方式をサポートしていないため、mysql\_native\_password暗号化方式に変更する必要があります。

mysqlコマンドウィンドウを開き、コマンドを入力します

```
ALTER USER '<アカウント>'@'localhost' IDENTIFIED BY '<アカウント>' PASSWORD EXPIRE NEVER;
```

パスワードを更新します

```
ALTER USER '<アカウント>'@'localhost' IDENTIFIED WITH mysql_native_password BY '<パスワード>';
```

変更後にサービスを再起動します

<figure><img src="https://github.com/syscom-go/omflow-gitbook/blob/japan/.gitbook/assets/OMFLOW架構%20(2).png" alt=""><figcaption></figcaption></figure>

## 2. SQL Serverデータベースを使用すると、インストール中にerror.logというエラーメッセージが表示される

error.logを参照し、同様のエラーメッセージは次のとおりです。

* SQL Server v16 is not supported.
* raise FullResultSet

### 解決方法：

django4.2 と SQL Server 2022 では、もともとに使われているmssql関連のパッケージはサポートされなくなりましたため、以下のステップを実行してください。

#### パッケージのダウンロード

Pythonフォルダに移動し、必要なパッケージをインストールしてください：

Windows版の場合、パスは `C:\Program Files\OMFLOW Server\Python` です

Linux版の場合、パスは `/opt/omflow/server/omflow/settings.py` です

```
python.exe -m pip install mssql-django --path="Lib\site-packages"

```

#### settings.pyを修正

Windows版の場合、パスは `C:\Program Files\OMFLOW Server\omflow\omflow\settings.py` です

Linux版の場合、パスは `/opt/omflow/server/omflow/settings.py` です

```
#ENGINEパラメータの値をmssqlに変更する
DATABASES = {"default": {"ENGINE": "sql_server.pyodbc","NAME":...後略
#以下に変更
DATABASES = {"default": {"ENGINE": "mssql","NAME":......後略
```

#### 更新ファイルを再実行する


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.omflow.com.tw/ri-ben-yu/id-2/2-14-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
