diff --git a/docker/images/n8n/README.md b/docker/images/n8n/README.md index 16d12e226d..984a024848 100644 --- a/docker/images/n8n/README.md +++ b/docker/images/n8n/README.md @@ -175,6 +175,31 @@ docker run -it --rm \ A full working setup with docker-compose can be found [here](https://github.com/n8n-io/n8n/blob/master/docker/compose/withPostgres/README.md) +#### Use with MySQL + +Replace the following placeholders with the actual data: + - MYSQLDB_DATABASE + - MYSQLDB_HOST + - MYSQLDB_PASSWORD + - MYSQLDB_PORT + - MYSQLDB_USER + +``` +docker run -it --rm \ + --name n8n \ + -p 5678:5678 \ + -e DB_TYPE=mysqldb \ + -e DB_MYSQLDB_DATABASE= \ + -e DB_MYSQLDB_HOST= \ + -e DB_MYSQLDB_PORT= \ + -e DB_MYSQLDB_USER= \ + -e DB_MYSQLDB_PASSWORD= \ + -v ~/.n8n:/root/.n8n \ + n8nio/n8n \ + n8n start +``` + + ## Passing Sensitive Data via File To avoid passing sensitive information via environment variables "_FILE" may be diff --git a/docs/database.md b/docs/database.md index 4603f7f2aa..1410374a26 100644 --- a/docs/database.md +++ b/docs/database.md @@ -65,7 +65,7 @@ To use MySQL as database you can provide the following environment variables: ```bash -export DB_TYPE=postgresdb +export DB_TYPE=mysqldb export DB_MYSQLDB_DATABASE=n8n export DB_MYSQLDB_HOST=mysqldb export DB_MYSQLDB_PORT=3306 diff --git a/packages/cli/package.json b/packages/cli/package.json index f14916a275..06a0d7fbbf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -93,6 +93,7 @@ "localtunnel": "^2.0.0", "lodash.get": "^4.4.2", "mongodb": "^3.2.3", + "mysql2": "^2.0.1", "n8n-core": "~0.24.0", "n8n-editor-ui": "~0.35.0", "n8n-nodes-base": "~0.47.0",