Configure Waline with TiDB
Why Waline + TiDB?
Waline is a lightweight, open-source, privacy-focused, and self-hosted comment system with backend UI and rich features, and TiDB Cloud offers a scalable, MySQL-compatible database with a generous 5GB free tier – making them a powerful pair for efficient and reliable comment system.
How to Set Up Waline with TiDB Cloud?
Follow these steps to deploy and configure Waline using TiDB Cloud as the database backend.
Create a cluster in TiDB Database (any name is okay)
Connect with the above cluster in your local editor (e.g., VS Code)
To manage your database and initialize comment tables:
Get Connection Details: In the TiDB Cloud console (Overview of the cluster), click the Connect button (top-right corner). You’ll see the connection parameters
HOST
,PORT
,USERNAME
,PASSWORD
(generate and copy it),DATABASE
andCA
.Set Up VS Code: See details in TiDB Developer Guide.
Initialize the Waline Database Schema: Copy waline.tidb and execute the entire script in VS Code. The script will create a database named
waline
withwl_Comment
,wl_Counter
andwl_Users
in it.
Configure
Environment Variables
as listed in Waline Guidebook
When first connecting via VS Code, the default
Database
istest
. After runningwaline.tidb
, the actual database used by Waline iswaline
. So inEnvironment Variables
, setDATABASE = waline
.