Maison >développement back-end >tutoriel php >ci框架连接数据库问题

ci框架连接数据库问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBoriginal
2016-06-06 20:14:282588parcourir

ci教程里读取新闻的代码运行不了显示错误(database.php已经配置好了)
A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

Filename: mysqli/mysqli_driver.php

Line Number: 202

Backtrace:

File: D:\PHP\vc14\Apache24\htdocs\ci\application\models\News_model.php
Line: 5
Function: database

File: D:\PHP\vc14\Apache24\htdocs\ci\application\controllers\News.php
Line: 5
Function: model

File: D:\PHP\vc14\Apache24\htdocs\ci\index.php
Line: 292
Function: require_once

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 353

回复内容:

ci教程里读取新闻的代码运行不了显示错误(database.php已经配置好了)
A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

Filename: mysqli/mysqli_driver.php

Line Number: 202

Backtrace:

File: D:\PHP\vc14\Apache24\htdocs\ci\application\models\News_model.php
Line: 5
Function: database

File: D:\PHP\vc14\Apache24\htdocs\ci\application\controllers\News.php
Line: 5
Function: model

File: D:\PHP\vc14\Apache24\htdocs\ci\index.php
Line: 292
Function: require_once

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 353

密码或者账号错了吧

database.php配置里把localhost换成127.0.0.1试试看。

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn