Skip to content

使用mysql/redis

DANGER

项目默认使用的数据库是Sqlite3,缓存是Memory。程序本身是支持mysqlredis的,但是作者并未测试,请谨慎使用。

如果英雄你继续选择使用,还希望你可以将使用结果反馈给作者,最后请英雄提前备份好数据。

找到项目的配置文件

修改下面重点部分

ini
# ======================
# Basic configuration
# ======================
[base]
# Web run port. Default:3002
http_port=3002
# Database driver [mysql/sqlite(Default)]
database_drive=mysql
# Cache driver [redis/memory(Default)]
cache_drive=redis
# Queue driver [redis/memory(Default)]
queue_drive=redis
# File cache path (Please start with the current path './')
# Warning: The files that have been uploaded after the modification cannot be accessed
source_path=./uploads
# File cache path.
source_temp_path=./runtime/temp

# ======================
# Mysql database driver
# ======================
[mysql]
host=127.0.0.1
port=3306
username=root
password=root
db_name=sun_panel
wait_timeout=100

# ======================
# sqlite database driver
# ======================
[sqlite]
file_path=./database/database.db

# ======================
# redis database driver
# ======================
[redis]
address=127.0.0.1:6379
password=
prefix=sun_panel:
db=0

Released under the MIT License.