2

I am using symfony 6.2.1.0, am new to symfony.I have successfully created doctrine and ORM packages and .env file was created automatically. I also created an entity, but when i tried to create migration am getting the following error.

[critical] Error thrown while running command "make:migration". Message: "Malformed parameter "url"."

In DriverManager.php line 268:
                              
  Malformed parameter "url".  
                              

In MalformedDsnException.php line 12:
                                     
  Malformed database connection URL

I tried to create migration using the following command

php bin/console make:migration

My codes in .env file is as follows

DATABASE_URL="mysql://root:Lisieux#10@127.0.0.1:3306/symfony?serverVersion=5.7"

My database username is root and DB Name is symfony.

What is the error here?

Xavier Issac
  • 414
  • 1
  • 4
  • 25

1 Answers1

2

By docs, if the username, password, host or database name contain any character considered special in a URI (such as +, @, $, #, /, :, *, !, %), you must encode them. So:

character urlencode
+ %2B
@ %40
$ %24
# %23
/ %2F
: %3A
* %2A
! %21
% %25
francisco
  • 1,387
  • 2
  • 12
  • 23