Home > Backend Development > PHP Tutorial > ci框架连接数据库问题

ci框架连接数据库问题

WBOY
Release: 2016-06-06 20:14:28
Original
2553 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template