Skip to content

Instantly share code, notes, and snippets.

@tacitphoenix
Last active April 23, 2020 04:50
Show Gist options
  • Save tacitphoenix/a237cb60448d76ba0d2770c91c16626b to your computer and use it in GitHub Desktop.
Save tacitphoenix/a237cb60448d76ba0d2770c91c16626b to your computer and use it in GitHub Desktop.
Seed database containers
# PostgreSQL
```
create role postgres with password 'postgres';
alter role postgres with login;
create database db_one owner=postgres;
grant all privileges on database testdb to postgres;
\connect db_one
create table person (name varchar, age int);
insert into person (name, age) values ("John Doe");
grant all privileges on all tables in schema public to postgres;
```
# MySQL
```
create user 'mysql'@'localhost' identified by 'mysql';
grant all privileges on *.* to 'mysql'@'localhost' with grant option;
create database db_two;
use db_two;
create table person (name varchar, age int);
insert into person (name, age) values ("John Doe");
```
@tacitphoenix
Copy link
Author

seed a mysql database container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment