Yii Framework Forum

MySQL problem with Yii 1.1


(Mikeklon) #1

Hi and good morning.

Quite a while ago, I made a small web site for my high school, which contains an alumnus roster. the site is deployed on GoDaddy. The site was working before an unfortunate mishap.

The issue started when the site directory was accidentally deleted by GoDaddy. I restored the site directory, however now, all the database functions fail. (You can see the error at: ahs74.klonecki.com , then choose the Roster tab. The Stack Trace should display for you ).

I did have to rebuild the MySQL database and table, along with modifying the username and password for db and table access. I updated the site “.db” files, but the connection seems to still fail.

Anyone able to point me in the right direction?

Thank you so much for any help.

Mike K.


(BANOTHU RAMESH NAIK) #2

HI
It seems your “db” component is incorrect

Usually “db” component will look like as below in main.php/Environment.php

        // Application components
        'components' => array(
            // Database
            'db' => array(
                'connectionString' => 'mysql:host=mysql;dbname=testDatabase',
                'emulatePrepare' => true,
                'username' => 'root',
                'password' => 'root',
                'charset' => 'utf8',
                'schemaCachingDuration' => 1,
            ),
            ....
     ),

Can you check/send you db component value?

Thanks


(Mikeklon) #3

rameshnaik – thank you for the input.

I had checked and modified the ‘db’ component previously with no luck.

However, your example helped quite a bit. I modified the ‘db’ array and the functionality is back. Thank you so much for the example.

Best regards,
Mike K.


(BANOTHU RAMESH NAIK) #4

Hi

Good to hear that

All the best

Thanks