Files
Sdf1_login/sql.md
T
2026-10-09 17:11:20 +08:00

47 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
```json
[
{"text":"配置区开始"},
{
"运行模式": true,
"数据库存储位置": ""
},
{
"归属": "",
"数据库地址": "localhost",
"端口": "3306",
"数据库名": "",
"数据库账号": "",
"数据库密码": ""
},
{
"归属": "",
"数据库地址": "localhost",
"端口": "3306",
"数据库名": "",
"数据库账号": "",
"数据库密码": ""
},
{"text":"配置区域结束"}
]
```
| 配置值 | 意义 | 示例 |
| :---: | :---: | :---: |
| 运行模式 | 选择db/mysql运行。不区分大小写,`true和db`表示使用db,`false和mysql`表示mysql | true |
| 数据库位置 | db模式专用,用来配置存放db的位置。`/xxx`表示绝对值,从根目录开始`./`表示相对值,从当前目录开始。`../`表示相对目录,从上层目录开始 | ./db/ |
| 数据库地址 | mysql专用,表示数据库连接地址。一般情况下填127.0.0.1或localhost | localhost |
| 端口 | MySQL专用,表示连接数据库的端口,默认情况下用3306即可 | 3306
| 数据库名 | mysql专用,表示连接mysql数据库的库名 | sqlname |
| 数据库账号 | mysql专用,表示连接mysql的账号信息 | mysqluser |
| 数据库密码 | mysql专用,表示连接mysql的密码信息,需要和账号是一对 | mysqlpassword |
## 常见问题
问:db不可用<br>
答: 检查php扩展-sqllite是否安装<br>
问: mysql连不上<br>
答: 检查mysql服务是否启动、账密端口是否正确<br>
问: 解析配置失败<br>
答: 把整个json配置区丢入json校验器校验一次json格式