Cdbconnection Failed To Open The Db Connection: Sqlstate[Hy000] [2054] The Server Requested Authentication Method Unknown To The Client

Hi,

I have problem and the error is "CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client"

Can anyone tell me how to solve this problem?

here is my main.php

<?php

// uncomment the following to define a path alias

// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..', //where is your root project


//'name1'=&gt;'Welcome',


'name'=&gt;'Big Sale Perfume',


'theme'=&gt;'purple',	//My Web Application


	'sourceLanguage'=&gt;'en_us',


	'language'=&gt;'en',





// preloading 'log' component


'preload'=&gt;array('log'),		





// autoloading model and component classes


'import'=&gt;array(										//what are the classics


	'application.models.*',


	'application.components.*',


),





'modules'=&gt;array(										


	// uncomment the following to enable the Gii tool





	/*'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'123',


		// If removed, Gii defaults to localhost only. Edit carefully to taste.


		'ipFilters'=&gt;array('127.0.0.1','::1'),


	),*/





),





// application components


'components'=&gt;array(									


	'user'=&gt;array(


		// enable cookie-based authentication


		'allowAutoLogin'=&gt;true,


	),


	// uncomment the following to enable URLs in path-format


	/*


	'urlManager'=&gt;array(


		'urlFormat'=&gt;'path',


		'rules'=&gt;array(


			'&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


		),


	),


	*/


//'db'=&gt;array(


//		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


//	),


	// uncomment the following to use a MySQL database


	


	'db'=&gt;array(


		'class'=&gt;'CDbConnection',


		'connectionString' =&gt; 'mysql:host=localhost;dbname=test1',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'username',


		'password' =&gt; 'password',


		'charset' =&gt; 'utf8',


	),





	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


		'errorAction'=&gt;'site/error',


	),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


),

);

Hope this gives you some idea.

http://forums.laravel.io/viewtopic.php?pid=49178

it cannot work i have tried to change the password.

the hosting provide

php verison : 5.4.24

mysql :5.5.34-cll - MySQL Community Server (GPL)

and below is my error log

2014/01/21 21:14:48 [error] [exception.CDbException] exception ‘CDbException’ with message ‘CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client’ in /home/vbetechc/public_html/testing4/framework/db/CDbConnection.php:382

Stack trace:

#0 /home/vbetechc/public_html/testing4/framework/db/CDbConnection.php(330): CDbConnection->open()

#1 /home/vbetechc/public_html/testing4/framework/db/CDbConnection.php(308): CDbConnection->setActive(true)

#2 /home/vbetechc/public_html/testing4/framework/base/CModule.php(387): CDbConnection->init()

#3 /home/vbetechc/public_html/testing4/framework/base/CApplication.php(450): CModule->getComponent(‘db’)

#4 /home/vbetechc/public_html/testing4/framework/db/ar/CActiveRecord.php(634): CApplication->getDb()

#5 /home/vbetechc/public_html/testing4/framework/db/ar/CActiveRecord.php(667): CActiveRecord->getDbConnection()

#6 /home/vbetechc/public_html/testing4/framework/db/ar/CActiveRecord.php(1455): CActiveRecord->getCommandBuilder()

#7 /home/vbetechc/public_html/testing4/protected/components/UserIdentity.php(20): CActiveRecord->find(‘username=:u’, Array)

#8 /home/vbetechc/public_html/testing4/protected/models/LoginForm.php(52): UserIdentity->authenticate()

#9 /home/vbetechc/public_html/testing4/framework/validators/CInlineValidator.php(42): LoginForm->authenticate(‘password’, Array)

#10 /home/vbetechc/public_html/testing4/framework/validators/CValidator.php(213): CInlineValidator->validateAttribute(Object(LoginForm), ‘password’)

#11 /home/vbetechc/public_html/testing4/framework/base/CModel.php(159): CValidator->validate(Object(LoginForm), NULL)

#12 /home/vbetechc/public_html/testing4/protected/controllers/SiteController.php(120): CModel->validate()

#13 /home/vbetechc/public_html/testing4/framework/web/actions/CInlineAction.php(49): SiteController->actionLogin()

#14 /home/vbetechc/public_html/testing4/framework/web/CController.php(308): CInlineAction->runWithParams(Array)

#15 /home/vbetechc/public_html/testing4/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))

#16 /home/vbetechc/public_html/testing4/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)

#17 /home/vbetechc/public_html/testing4/framework/web/CWebApplication.php(282): CController->run(‘login’)

#18 /home/vbetechc/public_html/testing4/framework/web/CWebApplication.php(141): CWebApplication->runController(‘site/login’)

#19 /home/vbetechc/public_html/testing4/framework/base/CApplication.php(180): CWebApplication->processRequest()

#20 /home/vbetechc/public_html/testing4/index.php(14): CApplication->run()

#21 {main}

Have you previously created and uploaded php program to this hosting site? Please check and try the following:

  • Try 127.0.0.1 instead of localhost. In some cases php cannot connect to localhost properly.

  • Check if PDO is enabled.

using the 127.0.0.1 also not wroking

for the PDO i check the yii-requirements, it show me that is passed

Problem is solved thank you for your reply :)