'Prisma migration to MySQL on localhost Fails
I am new to Prisma & MySQL. I am trying to migrate some sample tables to MySQL. Please, I need your help...
File - schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
...
File - .env
DATABASE_URL=mysql://admin:admin@localhost:3306/nss
...
MySQL Shell
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select user();
+-----------------+
| user() |
+-----------------+
| admin@localhost |
+-----------------+
1 row in set (0.00 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.25 sec)
mysql>
package.json
{
"name": "node-graphql",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"dev": "nodemon src/server.js"
},
"prettier": {
"semi": false,
"singleQuote": true,
"trailingComma": "all"
},
"dependencies": {
"apollo-server": "3.6.3",
"graphql": "15.8.0",
"graphql-scalars": "1.14.1",
"nexus": "1.2.0"
},
"devDependencies": {
"@prisma/client": "^3.12.0",
"nodemon": "2.0.15",
"prisma": "^3.12.0"
},
"prisma": {
"seed": "node prisma/seed.js"
}
}
In VS-Code Terminal, I issued the command
npx prisma migrate dev
Got the message: Error: Migration engine error:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
