Access denied.是整个网站提示的,提供下截图:
但是排查了下,数据库好像没问题额。
配置过程
mongodb是使用oneinstack一键脚本安装的,默认用户root,密码设置的:rootpasswd.
由于第一次接触mongodb,我就在/etc/mongond.conf
中把
#security:
# authorization: enabled
给注释掉了,在common/config/main-local.php
中mongodb部分设置为
# 无账户的配置
'dsn' => 'mongodb://127.0.0.1:27017/fecshop',
当时就执行./yii mongodb-migrate --interactive=0 --migrationPath=@fecshop/migrations/mongodb
成功,没有报错。导入数据也没有报错。
失败的解决方法
在common/config/main-local.php
中mongodb部分设置为
# 有账户的配置
'dsn' => 'mongodb://user:userpasswd@localhost:27017/fecshop',
同时在在/etc/mongond.conf
中还原
security:
authorization: enabled
结果网站还是不行,数据库因该没问题,那可能是什么的原因呢?