CodeIgniter Forums
How to fix PHP database connection? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: How to fix PHP database connection? (/showthread.php?tid=88001)



How to fix PHP database connection? - WaryaUhayar - 07-05-2023

Hello everyone, I'm new here. Does anyone have any knowledge on how to resolve this error?

Error Message:
A PHP Warning was encountered.
Severity: Warning
Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'bi19110176'@localhost (using password: YES)
Filename: mysqli/mysqli_driver.php
Line Number: 201
Backtrace:
File: C:\xampp\xampp\htdocs\webtech2021_BI19110176\application\controllers\Welcome.php
Line: 25
Function: model
File: C:\xampp\xampp\htdocs\webtech2021_BI19110176\index.php
Line: 315
Function: require_once

Additionally, a Database Error has occurred.
Unable to establish a connection with the database server using the provided settings.
Filename: C:/xampp/xampp/htdocs/webtech2021_BI19110176/system/database/DB_driver.php
Line Number: 436

Here's my code:

public function index()
{
//$this->load->database();
//$this->load->view('welcome_message');
$this->load->model('Customer', '', TRUE);

kotlin
$this->Customer->getCustomers();
}


RE: How to fix PHP database connection? - JustJohnQ - 07-05-2023

Username or password for mysql is incorrect.


RE: How to fix PHP database connection? - InsiteFX - 07-05-2023

Code:
// Shell from Control Panel or CMD - change your_password to yours.
cd mysql\bin
mysqladmin --user=root password "your_password"