Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback on error "The mysql database is a system database" #4682

Open
jasonkuhrt opened this issue Jun 30, 2020 · 3 comments
Open

Feedback on error "The mysql database is a system database" #4682

jasonkuhrt opened this issue Jun 30, 2020 · 3 comments
Labels
domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/improvement An improvement to existing feature and code. topic: error

Comments

@jasonkuhrt
Copy link
Contributor

Problem

Today we were migrating to Prisma 2.1.x from Prisma 2.0.x. Part of that involves e2e tests that we run. Our mysql test hit an issue:

image

Eventually the problem was understood, but here's some feedback from a db newb:

  • This is a pretty special case so it could have a fairly specialized error message?
  • The fact that mysql database server has multiple databases inside it and that one of those databases can be called "mysql" makes talking about this really hard, especially for newcomers 🙈 .
  • For example "connect to another database" was unclear to me if it meant I couldn't use mysql or just this version of mysql or somehow my mysql running in docker was corrupted––of course what it meant was just "please use another database in the mysql server"

Suggested solution

  • Maybe error sooner?
  • Just an example: "You have setup your Prisma schema to use a database called "mysql" in your mysql database server. But the "mysql" database is reserved for use by mysql server itself. You should not be trying to connect to it or migrate it. Please pick another database name."

Alternatives

Additional context

I realize its quite an edgecase to pick a database name of mysql, and silly. So probably this feedback is low priority! But hope it helps a bit at least :)

@tomhoule
Copy link
Contributor

tomhoule commented Jul 6, 2020

We already error as soon as we can in the migration engine, and we don't want to forbid it at the schema parser level because it could be nice to query the mysql system schema with prisma client. But we can for sure improve the error message. Thanks for the feedback!

@tomhoule tomhoule transferred this issue from prisma/migrate Dec 17, 2020
@tomhoule tomhoule added kind/improvement An improvement to existing feature and code. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. labels Dec 17, 2020
@francisco-neto-fit
Copy link

I had the same error while using docker. To fix it i just changed the docker name, instead the 'mysql' i named 'mysql-db'.
ex:
sudo docker run -e MYSQL_ROOT_PASSWORD=my-secret-password --name mysql -d -p 3306:3306 mysql -> Error
sudo docker run -e MYSQL_ROOT_PASSWORD=my-secret-password --name mysql-db -d -p 3306:3306 mysql -> Correct

@Tapha
Copy link

Tapha commented Jun 4, 2022

In case anyone is here because they can't figure out the correct format (like me :)). The answer is here: https://www.prisma.io/docs/concepts/database-connectors/mysql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/improvement An improvement to existing feature and code. topic: error
Projects
None yet
Development

No branches or pull requests

5 participants