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

Where is the yii database configuration?

Release: 2020-01-13 15:55:29
Original
2515 people have browsed it

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',
]
Copy after login

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!

Related labels:
yii
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template