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