1

The following command results in the above error;

symfony console doctrine:migrations:execute --up 'DoctrineMigrations\Version20220513151605'

Lot's of questions on it but I cant find any that match my scenario (localhost apache vhost, mysql, symfony).

All searches appear to point to a faulty DSN string. What I've tried thus far...

.env.local

DATABASE_URL="mysql://root:[email protected]:3306/mi_db?serverVersion=5.7.22-log"
DATABASE_URL="mysql://root:password@localhost:3306/mi_db?serverVersion=5.7.22-log"

with no joy?

help

cookie
  • 222
  • 3
  • 8
  • 18

1 Answers1

-1

The "DATABASE_URL" you shown is not a DSN string. That is a connection string from some application. Probably web-based.

To learn the proper way to define DSN you need to read documentation on the MySQL itself. https://dev.mysql.com/doc/refman/8.0/en/connectors-apis.html

For cheat sheet you can look here: https://www.connectionstrings.com/mysql/

W3Schools have nice tutorial on PHP: https://www.w3schools.com/php/php_mysql_connect.asp

White Owl
  • 4,511
  • 1
  • 4
  • 15
  • `DATABASE_URL` is an environment variable to be precise and the web-based application you mention is Symfony which I thought was clear from my description. Ideally Im looking for answers which are based around Symfony without appearing to sound too ungrateful. Thanks – cookie May 14 '22 at 07:41