Skip to content

How to use Etherpad Lite with MySQL

SamTV12345 edited this page May 14, 2024 · 22 revisions
  1. Connect to mysql by opening a command prompt and typing the following: mysql -u root -p
  2. Once logged in, issue the following command to create the database: create database `etherpad_lite_db`;
  3. Create a new database user. Replace <etherpaduser> and <password> with your own values. CREATE USER '<etherpaduser>'@'localhost' identified by '<password>';
  4. Grant permissions to that new database account. Replace <etherpaduser> with your own value from above step. grant CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on `etherpad_lite_db`.* to '<etherpaduser>'@'localhost';
  5. Leave the mysql client exit
  6. Edit settings.json in your Etherpad Lite root folder and change the database settings (if you have a non-default port configured for MySQL you will have to add the "port" setting). It is strongly encouraged to set the option "charset" to "utf8mb4".
  7. Run etherpad lite

Example MySQL Socket Config.

"dbType" : "mysql",
"dbSettings" : {
    "user"    : "etherpaduser",
    "socketPath": "/var/run/mysqld/mysqld.sock",
    "password": "secret",
    "database": "etherpad_lite_db",
    "charset" : "utf8mb4"
}

Structure of table 'store'

CREATE TABLE `store` (
  `key` varchar(100) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `value` longtext COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

General

Resources

For Developers

How to's

Set up

Advanced steps

Integrating Etherpad in your web app

for Developers

Clone this wiki locally