Rumah > pembangunan bahagian belakang > tutorial php > ci框架连接数据库问题

ci框架连接数据库问题

WBOY
Lepaskan: 2016-06-06 20:14:28
asal
2552 orang telah melayarinya

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试试看。

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan