Prisma MySQL connection string issues

I installed MySQL on my Ubuntu 22.04 WSL distro using:

sudo apt install mysql

I then ran the following to configure things more securely:

sudo mysql_secure_installation

However, unlike every video on installing MySQL on Ubuntu that showed the secure installation script prompting you for a password for root, I never got such a prompt and it seems the mysql installation simply defaulted to configuring things to use socket connection, not password.

This caused all kinds of problems when tyring to set the connection string for DATABASE_URL as explained in the Prisma docs. After much head scratching I discovered the solution and posted about it on Stack Overflow so in the slim chance that anyone else has this issue. Here’s the URL to my Stack Overflow question.

Prisma URL string for MySQL connection via sockets - Stack Overflow