拒绝访问用户“root”@“localhost”(使用密码:否)YII
进入安装数据库配置后接收错误 误差500 mysql_connect[function.mysql connect]:拒绝使用密码对用户“root”@“localhost”进行访问:否 数据库配置文件默认值 请帮帮我 这是安装控制器代码拒绝访问用户“root”@“localhost”(使用密码:否)YII,yii,Yii,进入安装数据库配置后接收错误 误差500 mysql_connect[function.mysql connect]:拒绝使用密码对用户“root”@“localhost”进行访问:否 数据库配置文件默认值 请帮帮我 这是安装控制器代码 <?php }像这样试试 'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=sarish',
<?php
}像这样试试
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=sarish',
'class'=>'CDbConnection',
'emulatePrepare' => true,
'username' => 'sarish',
'password' => 's@r15h',
'charset' => 'utf8',
'tablePrefix' => '',
),
尝试将localhost更改为您的IP地址127.0.0.1,并添加端口号,看看会发生什么
'connectionString' => 'mysql:host=127.0.0.1;port=3306;dbname=sarish',
我也遇到了这个问题,这是我的解决方案,我猜你的双配置数据库连接,mysql错误:使用密码:不意味着你的密码是空的。。。。看看/Common/config/main-local.php,这里有一个db连接的预配置,所以你不需要在任何其他配置文件中配置db连接……我的英语很差,但我希望你能理解我……你的数据库连接是错误的,所以这会引发错误。这是一件非常基本的事情,在问这么简单的问题之前,请先去谷歌。而且你不应该给出你的密码!选中protected/config/inside main.php文件以配置数据库
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=sarish',
'class'=>'CDbConnection',
'emulatePrepare' => true,
'username' => 'sarish',
'password' => 's@r15h',
'charset' => 'utf8',
'tablePrefix' => '',
),
'connectionString' => 'mysql:host=127.0.0.1;port=3306;dbname=sarish',