Configuring a database connection in a Yii structure

There are some configuration options in the main.php file of the Yii structure. This is how it installs mysql

'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=testdrive', 'emulatePrepare' => true, 'username' => 'root', 'password' => 'root', 'charset' => 'utf8', ), 

On my MAMP system, I have to specify the port as 8889. How would I add it to this?

thanks

+7
source share
2 answers

I added a port like this and it works

 'db'=>array( 'connectionString' => 'mysql:host=localhost;port=8889;dbname=testdrive', 'emulatePrepare' => true, 'username' => 'root', 'password' => 'root', 'charset' => 'utf8', ), 
+12
source

Can you add it here to your connectionString

'connectionString' => 'mysql:host=localhost;dbname=testdrive;port=8889',

+4
source

All Articles