I am trying set up prisma with a remote MySQL data...
# orm-help
m
I am trying set up prisma with a remote MySQL database, connection and credentials are verified through mysql-client. Nevertheless, I get the error message: _java.sql.SQLSyntaxErrorException: (conn=1446758) Access denied for user 'maraxaic_graphql'@'87.187.51.%' to database 'prisma'_. I assigned all available permissions to this user through my host provider. I notice that the error message mentions the database 'prisma' but my database name is maraxaic_graphql. 'prisma' does not exist on my host. Any help is greatly appreciated, thanks in advance.
r
Hey @Mike Dietz seems that you are using Prisma 1. How are you connecting to the DB? Via docker-compose?
m
Hi Ryan, thanks for helping me! Yes, I am using prisma 1 (v 1.34.10). I got a little bit further. I was able to initialize prisma with the setting 'create a new database'. I received the success message and can access the GraphiQL on localhost:4466. Nevertheless, my database is empty, no table exists. If I run a mutation no data is stored in there. What am I missing? The success message states: Creating stage default for service default √ Deploying service
default
to stage
default
to server
local
. Do you have an idea how to solve this problem?
r
Could you share your
docker-compose.yml
?
m
version: '3' services:   prisma:     image: prismagraphql/prisma:1.34     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: my-host             user: my-user             password: my-password             rawAccess: true             port: 3306             migrations: true   mysql:     image: mysql:5.7     restart: always     # Uncomment the next two lines to connect to your your database from outside the Docker environment, e.g. using a database GUI like Workbench     # ports:     # - "3306:3306"     environment:       MYSQL_ROOT_PASSWORD: prisma     volumes:       - mysql:/var/lib/mysql volumes:   mysql:
r
Pass a
database
value under the
default
block. Something like:
Copy code
default:
  database: maraxaic_graphql
This will connect to your DB
m
I already tried this before, it did not work. I think it might have to do with my host providers settings. I get an access denied error, i.e. my user might not have the permissions necessary to access the db (although I assigned all rights).
I just got the information from my host provider that Docker and Prisma is not supported with the managed server I have. What a bummer. Thank you Ryan for your help!
👍 1
r
Will you be trying this with Prisma 2?
m
I would like to. Can I use Prisma without Docker?
r
I would strongly suggest using Prisma 2 as it it being actively developed and has a lot of features.
m
Great, I will give this a try. I hope it works with my hosting package I have.
💯 1
I installed prisma2 and it works fine so far, thanks! But how do I access GraphiQL?
r
@Mike Dietz Prisma 2 is just an ORM for database access. It doesn’t come bundled with an admin GraphQL endpoint anymore as it is been made independent to use in REST and GraphQL. Creating a GraphQL endpoint will be the same now, i.e. creating a Node app with
apollo-server
and exposing your
schema.graphql
.
m
...and GraphQL will the be available through the module
apollo-server
, correct?
r
Yeah.
m
Thanks Ryan, also for your support on GH!!!
🙌 1
r
Do let me know if that works 😄