Ci framework Connection database Problems

Source: Internet
Author: User
Tags php error
The code for reading news in the ci tutorial cannot run, and an error is displayed (database. php has been configured) APHPErrorwasencounteredSeverity: WarningMessage: mysqli: real_connect () :( HY0001045): Accessdeniedforuser & #039; root & #039; @ & #039; localho... the code for reading news in the ci tutorial cannot run, and an error is displayed (database. php has been configured)
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

Reply content:

The code for reading news in the ci tutorial cannot run. An error is displayed (database. php has been configured)
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

Wrong Password or account

In the database. php configuration, replace localhost with 127.0.0.1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.