Errors between dev and prod servers Print

  • 30

Mysql could have different behaviors regarding the case sensitivity depending on the OS. This can be an issue on the database structure if you dump data from your local computer to the remote server.
An example of this error could be:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
due the uppercase characters the foreign keys may have.

If you use Doctrine 2 and you define the tables structure on the entity it self, we recommend to create the schemas with the doctrine command on both sides(local and remote servers) and dump just the data, skipping the data structure.

Dump from local server:
$ mysqldump --no-create-info --user=USER -p DATABASE > myFile.sql

Dump into remote server:
$ mysql --user=USER -p DATABASE < myFile.sql


Was this answer helpful?

« Back