[PR #3024] [MERGED] feat: Add MySQL database support #5330

Closed
opened 2026-10-31 20:46:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3024
Author: @aliglzr
Created: 5/19/2025
Status: ✅ Merged
Merged: 5/21/2025
Merged by: @MHSanaei

Base: mysql ← Head: main


📝 Commits (2)

  • 4d50320 feat: Add MySQL database support
  • e78f20a refactor: prefix env variables of database with XUI_ to support direct environment usage without .env file

📊 Changes

10 files changed (+239 additions, -52 deletions)

View changed files

➕ .env.example (+8 -0)
📝 config/config.go (+49 -0)
📝 database/db.go (+29 -9)
📝 database/model/model.go (+1 -1)
📝 go.mod (+2 -0)
📝 go.sum (+5 -0)
📝 main.go (+1 -0)
📝 sub/subService.go (+58 -16)
📝 web/service/inbound.go (+84 -24)
📝 web/service/setting.go (+2 -2)

📄 Description

What is the pull request?

This pull request adds MySQL database support to the application while maintaining SQLite as the default database. The changes include:

  • Implementation of MySQL database connection support
  • Environment-based database configuration
  • Fix for MySQL compatibility issue with 'key' column name
  • Backward compatibility with existing SQLite database
  • Two x-ui services can run on same MySQL database without any problem

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/3024 **Author:** [@aliglzr](https://github.com/aliglzr) **Created:** 5/19/2025 **Status:** ✅ Merged **Merged:** 5/21/2025 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `mysql` ← **Head:** `main` --- ### 📝 Commits (2) - [`4d50320`](https://github.com/MHSanaei/3x-ui/commit/4d50320bc1c9d49a53e4c12b814cac0502da92a8) feat: Add MySQL database support - [`e78f20a`](https://github.com/MHSanaei/3x-ui/commit/e78f20a770fc3e8fcee88f8a3c202ad777f8f6bc) refactor: prefix env variables of database with XUI_ to support direct environment usage without .env file ### 📊 Changes **10 files changed** (+239 additions, -52 deletions) <details> <summary>View changed files</summary> ➕ `.env.example` (+8 -0) 📝 `config/config.go` (+49 -0) 📝 `database/db.go` (+29 -9) 📝 `database/model/model.go` (+1 -1) 📝 `go.mod` (+2 -0) 📝 `go.sum` (+5 -0) 📝 `main.go` (+1 -0) 📝 `sub/subService.go` (+58 -16) 📝 `web/service/inbound.go` (+84 -24) 📝 `web/service/setting.go` (+2 -2) </details> ### 📄 Description ## What is the pull request? This pull request adds MySQL database support to the application while maintaining SQLite as the default database. The changes include: - Implementation of MySQL database connection support - Environment-based database configuration - Fix for MySQL compatibility issue with 'key' column name - Backward compatibility with existing SQLite database - **Two x-ui services can run on same MySQL database without any problem** ## Which part of the application is affected by the change? - [ ] Frontend - [x] Backend ## Type of Changes - [ ] Bug fix - [x] New feature - [ ] Refactoring - [ ] Other --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:46:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5330
No description provided.