Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🔨 Ensure 'lisk' DB is always present on the MySQL read replica(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Apr 4, 2024
1 parent 0dd5340 commit 7b0901e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ services:
endpoint_mode: vip
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=lisk
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-hlocalhost', '-ppassword']

Expand Down
3 changes: 3 additions & 0 deletions docker/mysql/read/init/01-databases.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Create database(s).
CREATE DATABASE IF NOT EXISTS `lisk`;

-- Create `reader` user for read queries and grant read privilages.
CREATE USER 'reader'@'%' IDENTIFIED WITH caching_sha2_password BY 'password';
GRANT SELECT ON *.* TO 'reader'@'%';
Expand Down

0 comments on commit 7b0901e

Please sign in to comment.