Configure Waline with TiDB

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.

  1. Create a cluster in TiDB Database (any name is okay)

  2. Connect with the above cluster in your local editor (e.g., VS Code)

    To manage your database and initialize comment tables:

    1. 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 and CA.

    2. Set Up VS Code: See details in TiDB Developer Guide.

    3. Initialize the Waline Database Schema: Copy waline.tidb and execute the entire script in VS Code. The script will create a database named waline with wl_Comment, wl_Counter and wl_Users in it.

  3. Configure Environment Variables as listed in Waline Guidebook

When first connecting via VS Code, the default Database is test. After running waline.tidb, the actual database used by Waline is waline. So in Environment Variables, set DATABASE = waline.

This post is licensed under CC BY 4.0 by the author.