meandor/

stirling-mysql

为sterling-microservice提供的MySQL包装器

0.2.2 2022-10-29 06:44 UTC

This package is auto-updated.

Last update: 2024-09-29 04:48:44 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock Build Status

stirling-microservice提供的MySQL数据库包装器

此库使用mysqli进行数据库访问。请确保您已启用mysqli并在服务器上准备好使用。

使用方法

此库仅与stirling-microservice配合使用。

如果您未为Config类指定以下json格式的配置文件(default.json)

{
    "dbHost": "<ip address>",
    "dbUser": "<my username>",
    "dbPassword": "<my password>",
    "dbName": "<my database name>",
    "dbPort": <port>
}

将使用默认配置尝试建立数据库连接。

默认配置为

{
    "dbHost": "127.0.0.1",
    "dbUser": "root",
    "dbPassword": "",
    "dbName": "database",
    "dbPort": 3306
}