220.127.116.11. Setting up database connection in Yii
Warning!The connection will not work with localhost. The host address must be taken from the data to connect to the database.
Credentials for connection to the database in Yii are specified in the application's configuration file. Depending on the structure of the configuration files, changes must be made in the file that contains the database settings:
- In case of using a file
protected/config/main.phpyou need to change the lines:
'connectionString' => 'mysql:host=host;dbname=base_data', 'username' => 'login', 'password' => 'password',
- In case the file contains
protected/config/main.phpfor example, a similar line is indicated:
Then the changes must be made directly to the file specified in this line. In this example, this is
Changes can be made using filemanager or any FTPclient.