0

I'm working with Symfony2 and Mysql 8 . while working on localhost wamp it workds perfectly but when working on a distant server using a server IIS the problem accure.

While trying to insert in mysql database, i'm getting the following error

  An exception occurred while executing 'INSERT INTO users (name,familyName) values (?,?) with 
  params["\xe9","name"]:
  SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'name' at row 1

The problem is that i'm inserting a special charachter é . i'm setting my table as UTF8_mb4. and all characters get excepted expect é

patron
  • 59
  • 3
  • 10

1 Answers1

0

Finally found a solution to the problem , it resides in the IIS, it reads my data as ASCII not UTF. Fixed with the command :

   reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v 
   FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO
patron
  • 59
  • 3
  • 10