Home >PHP Framework >YII >Where is the yii database configuration?

Where is the yii database configuration?

尚
Original
2020-01-13 15:55:292540browse

Where is the yii database configuration?

Configure database information in the common->config->main-local.php file. Directly open the main-local.php file to configure the information for connecting to the database.

We use mysql database:

'db'=> [
'class'=>'yii\db\Connection',
'dsn'=>'mysql:host=localhost;dbname=mydb',
'username'=>'root',
'password'=>'root',
'charset'=>'utf8',
]

Recommended learning: yii tutorial

The above is the detailed content of Where is the yii database configuration?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn