Yii Framework Forum: Problem In Connecting Wiht Mysql - Yii Framework Forum

Jump to content

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

Problem In Connecting Wiht Mysql Rate Topic: -----

#1 User is offline   channasmcs 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 06-March 13
  • Location:Srilanka

Posted 11 September 2013 - 02:17 PM

i create database in host & when i try to connect app with DB
i have to face this Error


CDbConnection failed to open the DB connection: SQLSTATE[28000] [1045] Access denied for user ' b7_13723931'@'192.168.0.53' (using password: YES)

/home/vol14_1/byethost7.com/b7_13723931/channasmcs-blog-master.byethost7.com/htdocs/framework/db/CDbConnection.php(382)

370 throw new CDbException('CDbConnection.connectionString cannot be empty.');
371 try
372 {
373 Yii::trace('Opening DB connection','system.db.CDbConnection');
374 $this->_pdo=$this->createPdoInstance();
375 $this->initConnection($this->_pdo);
376 $this->_active=true;
377 }
378 catch(PDOException $e)
379 {
380 if(YII_DEBUG)
381 {
382 throw new CDbException('CDbConnection failed to open the DB connection: '.
383 $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
384 }
385 else
386 {
387 Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
388 throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
389 }
390 }
391 }
392 }
393
394 /**




this my mail.php DB part


// uncomment the following to use a MySQL database

'db'=>array(
'connectionString' =>'mysql:host=sql107.byetcluster.com;dbname=b7_13723931_channa_blog',
'emulatePrepare' => true,
'username' => ' b7_13723931',
'password' => 'Solution4u',
//'charset' => 'utf8',
'tablePrefix' => 'tbl_',
),


this Mysql host detail

MySQL Settings

MySQL user name b7_13723931
MySQL password Solution4u
MySQL host name sql107.byetcluster.com
MySQL port 3306


How Fix this problem :-[

thank you....
0

#2 User is offline   nineinchnick 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 622
  • Joined: 12-September 11
  • Location:Bialystok, Poland

Posted 12 September 2013 - 01:34 AM

After creating the database and user in MySQL you did not assign any privileges to it. See the part of the MySQL manual about adding user accounts.
If it is a shared hosting, you should get some options in the control panel. If not, you probably are using phpMyAdmin and can issue GRANT queries from there.
Don't be a dick.
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