I tried to upgrade from Symfony 3.1.8 to 3.2.1 using composer. During the cache clear I received an error stating
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user '########'@'IpAddress' (using password: YES)
however my database user name should be #######_#, notice the underscore in the second to last character position. Looking in the parameter.yml file I found that my database_user had been changed to remove the _ from the username (the underscore was stripped). I then added back my underscore, deleted the dev cache, and tried the application again. I received the same error as before.
Since composer also updated doctrine and the FOSuser bundle at the same time I reverted the update and went back to my prior configuration by reverting my composer.lock file. I then ran my Symfony application again in the version 3.1.8 and it worked fine.
To isolate the problem further I used composer and upgraded ONLY symfony from 3.1.8 to 3.2.1. The upgrade produced errors at the cache clear with the above error message, and in my parameters.yml file my database_user again had the underscore removed from the username. I re-inserted the underscore, however I continue to get the error messages:
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user '########'@'IpAddress' (using password: YES)
If I add a letter to the end of my database_user so it is "#######_#a" the error message shows the _
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user '#######_#a'@'IpAddress' (using password: YES)
If I then delete the letter the error message reverts to no underscore
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user '########'@'IpAddress' (using password: YES)
This leads me to believe that some change in Symfony between 3.1.8 and 3.2.1 strip underscores from the database_user in the parameters.yml file. Unfortunately I am not skilled enough to figure out where that code may be.