I have a local version of php/yii connecting to an external MySQL server. All is well on the server, but hitting the application locally comes up with:
PDO::__construct(): Premature end of data (mysqlnd_wireprotocol.c:554)
From some reading this has to do with the external mysql server using old_password, I don’t want to play around with the settings on the server so I’m trying to get my local machine to play nice. Is there a yii or php setting that will enable me to connect to the server that uses old_password?
Line 389 is highlighted in the error:
377 * @since 1.0.4
378 */
379 protected function createPdoInstance()
380 {
381 $pdoClass='PDO';
382 if(($pos=strpos($this->connectionString,':'))!==false)
383 {
384 $driver=strtolower(substr($this->connectionString,0,$pos));
385 if($driver==='mssql' || $driver==='dblib')
386 $pdoClass='CMssqlPdoAdapter';
387 }
388 return new $pdoClass($this->connectionString,$this->username,
389 $this->password,$this->_attributes);
390 }
391
392 /**
393 * Initializes the open db connection.
394 * This method is invoked right after the db connection is established.
395 * The default implementation is to set the charset for MySQL and PostgreSQL database connections.
396 * @param PDO $pdo the PDO instance
397 */
398 protected function initConnection($pdo)
399 {
400 $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
401 if($this->emulatePrepare && constant('PDO::ATTR_EMULATE_PREPARES'))