Yii Framework Forum: Configure Database - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Configure Database How to configure database Rate Topic: -----

#1 User is offline   paruliano 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-January 14

Posted 23 January 2014 - 11:29 PM

I'm newbe, hava a know How to configure database? Please give me how to know.
0

#2 User is offline   bevalorous 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 05-January 12

Posted 23 January 2014 - 11:42 PM

Please read Yii Definitive Guide, sections Creating Your First Yii Application: Connecting to database and Working with Databases: Establishing Database Connection
0

#3 User is offline   Matthew Torres 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 12-February 14

Posted 24 February 2014 - 08:41 PM

In your main.php file of your webapp, you will se
'db'=>array(...)
code snippet.

Just add the file directory of your database there. If you are using MySQL, uncomment the snippet below

Quote

// uncomment the following to use a MySQL database
.

It would likely look like this:

'db'=>array(
			// 'connectionString' => 'mysql:host=172.16.8.74;dbname=meditab',
			'connectionString' => 'mysql:host=localhost;dbname=meditab',
			'emulatePrepare' => true,
			'username' => 'dharma',
			'password' => 'HRsystem',
			'charset' => 'utf8',
		),

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users