Avoid double semicolon in the generated DSN, which could cause MySql connection error. #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a Magento 2 website which was migrated from Magento 1, and it has the following DB connection settings.
As can be seen from the code snippet below, it has a 'initStatements' field there and its value is a SQL statement with semicolon at the end.
This would cause an extra semicolon generated in the middle of DSN, so two semicolons in the string. Originally it works fine with my local MySql DB on that server, while it stops working when I migrate to DigitalOcean database service recently.
Just googled around, somebody else suffer the same problem too, and reported a Magento 2 bug at magento/magento2#6526
I'm feeling this is not a special case only for me, more over it does take time to figure it out. So I'd like to suggest a code change here to get rid of this issue smoothly.