According to Prisma docs the template for the connection string using sockets is:
mysql://USER:POST@localhost/database?socket=/var/run/mysql/
Based on this I've created the following, changing the USER to root
, database to my issue_tracker
database and the location of the socket query string for my Ubuntu 22.04 installation which is /var/run/mysqld/ so my string is:
mysql://root:POST@localhost/issue_tracker?socket=/var/run/mysqld/
What I'm unsure of is what I'm supposed to replace POST with. If I leave it as the above and try to run a migration I get the following error:
Error: P1001: Can't reach database server at `localhost`:`3306`
Please make sure your database server is running at `localhost`:`3306`.
What is POST field after user field in the Prisma example template supposed to represent?
I gave up on using the default mysql socket connection method that was configured automatically during the Ubuntu installation instructions and used the following command to change the mysql authentication plugin from
auth_socket
tocaching_sha2_password
. This is done using the following from the mysql command-line:I could then simply refer to Prisma docs to use the connection string pattern discussed under Base URL and path, specifically the string pattern:
Prisma migrations now work.
FYI. This is for MySQL version 8.0.35