When using bin/console make:entity on Mysql and then later you switch your application to Postgres and you have a table called user, which you most likely have when using security component of Symfony. Then you will receive an error because user is a reserved word in Postgres!
An exception occurred while executing 'INSERT INTO user (id, email, roles, password, is_verified) VALUES (?, ?, ?, ?, ?)' with params [3, "firstname.lastname@example.org", "", "your-encrypted-password", 0]: SQLSTATE: Syntax error: 7 ERROR: syntax error at or near "user" LINE 1: INSERT INTO user (id, email, roles, password, is_verified) V...
In case you encounter this error with mysql and your docker-compose setup:
Unknown MySQL server host <mysql-service-name>Code language:HTML, XML(xml)
… and you dont know why because everything seems to be correct.
Then you might have an upgrade problem with mysql because you are reusing an old volume that was created for another mysql version. This can happen when you use a unspecified tag as mysql:latest (not recommended anyway) and there was a version bump in the official mysql image. Or you upgraded the mysql container yourself, f.e. from mysql:5.6 to mysql:5.7 and you are reusing the data volume with the mysql files.
Ich mag schnoddrig-nerdige Blogposts mit (s/f)uck im Titel, daher heute mal der hier: 10 Tips For Optimizing MySQL Queries That Don’t Suck. Sicher nicht brandaktuell, doch Leiderprobte (“Warum dauert der §()!”% das so lange?”) möchten sicher hin und wieder daran erinnert werden.
Manage Cookie Consent
We use technologies like cookies to store and/or access device information. We do this to improve browsing experience and to show personalized ads. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.