fix: MySQL Database not support DDL init and upgrade. (#1133)

Co-authored-by: csunny <cfqsunny@163.com>
This commit is contained in:
Aries-ckt
2024-01-30 12:09:26 +08:00
committed by GitHub
parent a75f42c35e
commit 208d91dea0
6 changed files with 68 additions and 9 deletions

View File

@@ -354,7 +354,50 @@ Modify the `.env` file to use llama.cpp, and then you can start the service by r
| `llama_cpp_cache_capacity` | None | Maximum model cache size. For example: 2000MiB, 2GiB |
| `llama_cpp_prefer_cpu` | False | If a GPU is available, the GPU will be used first by default unless prefer_cpu=False is configured. |
## Install DB-GPT Application Database
<Tabs
defaultValue="sqlite"
values={[
{label: 'SQLite', value: 'sqlite'},
{label: 'MySQL', value: 'mysql'},
]}>
<TabItem value="sqlite" label="sqlite">
:::tip NOTE
You do not need to separately create the database tables related to the DB-GPT application in SQLite;
they will be created automatically for you by default.
:::
</TabItem>
<TabItem value="mysql" label="MySQL">
:::warning NOTE
After version 0.4.7, we removed the automatic generation of MySQL database Schema for safety.
:::
1. Frist, execute MySQL script to create database and tables.
```python
$ mysql -h127.0.0.1 -uroot -p{your_password} < ./assets/schema/dbgpt.sql
```
2. Second, set DB-GPT MySQL database settings in `.env` file.
```python
LOCAL_DB_TYPE=mysql
LOCAL_DB_USER= {your username}
LOCAL_DB_PASSWORD={your_password}
LOCAL_DB_HOST=127.0.0.1
LOCAL_DB_PORT=3306
```
</TabItem>
</Tabs>
## Test data (optional)