Describe the bug
[root@CentOS-73-64-minimal prisma]# prisma deploy
environment FetchError: request to http://localhost:4466/management failed, reason: connect ECONNREFUSED 127.0.0.1:4466
datamodel.prisma seems to be created correctly, does Prisma support existing MySQL databases yet ? I saw that this was a problem like 1 year ago, but I suppose you made it support importing from existing database since datamodel.prisma is generated and it seem that prisma init worked.
Seems that the docker image created with docker-compose up -d keeps restaring it-self.
I can never attach to it because it keeps restarting. Error in docker-compose logs is
prisma_1 | Exception in thread "main" java.lang.RuntimeException: Unable to load Prisma config: com.prisma.config.InvalidConfiguration: Only Postgres connectors specify a schema. If they do they also need to specify a database. Other connectors only specify a database.
prisma_1 | at scala.sys.package$.error(package.scala:26)
if I remove the schema from docker-compose.yml I get another error
prisma_1 | Exception in thread "main" java.lang.RuntimeException: There is not passive mysql deploy connector yet! | at scala.sys.package$.error(package.scala:26)
docker-compose.yml file with schema:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.32-alpha
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: mysql
host: 176.9.44.11
user: dbusername
schema: dbpassword
password: 'pass'
rawAccess: true
port: '3306'
migrations: false
Notice mysql server is on different server but when I run prisma init prisma the setup wizard connects to the mySQL server and retrives the correct databases and I choose an existing one.
[root@central ~]# mysql --version
mysql Ver 14.14 Distrib 5.5.45, for Linux (x86_64) using readline 5.1
Versions (please complete the following information):
@mrtornado
In MySQL schema is synonymous with the database, so schemas are only consumed by postgres.
So can you please change schema to database in your config
If I change schema to database the error there is no passive db connector, but connector is set to mysql.
prisma_1 | Exception in thread "main" java.lang.RuntimeException: There is not passive mysql deploy connector yet!
I can reproduce @mrtornado issue.
Looking at the documentation, it seems that MySQL is not supported.
But if so, why is it offered as an option?
I also got the same error and I'm using version v1.31 because I notice that in the last release note the introspection for MySQL databases was supported. (https://spectrum.chat/prisma/general/releasing-prisma-v1-31~0d4dcb59-a58f-4ecf-84e6-b8509bad4abf)
I can reproduce @mrtornado issue.
Looking at the documentation, it seems that MySQL is not supported.
But if so, why is it offered as an option?
It's supported on the last version (v1.31) and here is the documentation: https://www.prisma.io/docs/1.31/datamodel-and-migrations/introspection-MYSQL-soi2/
yea it should be supported but something seems to be wrong.
i have the same issue...
same issue here as well
Same issue here
I encountered 2 issues when using prisma with an existing MySQL DB:
(1) on introspection, prisma init correctly retrieves DB name
(2) after 'schema:
Access denied for user 'user_name'@'IP_addr' to database 'prisma'
My tags were omitted so I'll re-post:
I encountered 2 issues when using prisma with an existing MySQL DB:
(1) on introspection, prisma init correctly retrieves DB name as XXX, but creates docker-compose.yml with 'schema: XXX' rather than 'database: XXX'
(2) after 'schema: XXX' is substituted with 'databes: XXX' in docker-compose.yml, and 'docker-compose up -d' is run, prisma tries to connect to DB=prisma, not DB=XXX, and throws:
Access denied for user 'user_name'@'IP_addr' to database 'prisma'
I am not able to reproduce any of this now with 1.32. The CLI issue of writing schema instead of database property is still persistent but it is being tracked by another issue: https://github.com/prisma/prisma/issues/4434
@g1t1n Make sure that your MySQL user has full DB access. Prisma will need to create "prisma" database in your MySQL server in order to store metadata information about the migrations
Closing as duplicate of https://github.com/prisma/prisma/issues/4434
@pantharshit00 What if database creation is not allowed? Is it necessary, can it be circumvented?
Also, as docker-compose.yml created by prisma introspection has "migrations: false" why is migration enforced?
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.32
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
connector: mysql
host: 192.168.130.70
database: regus
user: regus_provisioning
password: .5(9QQ)uYuX+asGR
rawAccess: true
port: '3306'
migrations: false
I encountered 2 issues when using prisma with an existing MySQL DB:
(1) on introspection, prisma init correctly retrieves DB name , but creates docker-compose.yml with 'schema: ' rather than 'database: '(2) after 'schema: ' is substituted with 'databes: ' in docker-compose.yml, and 'docker-compose up -d' is run, prisma tries to connect to DB=prisma, not DB= and throws:
Access denied for user 'user_name'@'IP_addr' to database 'prisma'
this help
Most helpful comment
I encountered 2 issues when using prisma with an existing MySQL DB:, but creates docker-compose.yml with 'schema: ' rather than 'database: '
(1) on introspection, prisma init correctly retrieves DB name
(2) after 'schema:' is substituted with 'databes: ' in docker-compose.yml, and 'docker-compose up -d' is run, prisma tries to connect to DB=prisma, not DB= and throws:
Access denied for user 'user_name'@'IP_addr' to database 'prisma'