您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

thinkphp数据库的有关问题

2025/11/28 8:00:28发布31次查看
thinkphp数据库的问题
用thinkphp框架。new model()的时候会出错。
exception里的信息好像是
access denied for user 'root'@'localhost' (using password: no)
但是我已经在config.php里配置好信息了。
其中数据库名称为test,表为think_em。
php code
php code'配置值' 'db_type'=>'mysql', 'db_host'=>'localhost', 'db_name'=>'test', 'db_user'=>'root', 'db_pwd'=>'welcome', 'db_port'=>'3306', 'db_prefix'=>'think_', 'app_debug'=>true,);?>
------解决方案--------------------
1:上面的错误意思是密码不对,检查一下密码和端口。
2:new model('');改成:$test=m('em');
------解决方案--------------------
删除 runtime 中的所有内容后重试
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product