Welcome Guest, Not a member yet? Register   Sign In
Unable to connect to your database server using the provided settings.
#1

A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/CodeIgniter.php
Line Number: 517



i have this error on my website can anyone help me and it was working correctly before

thanks
Reply
#2

The reason is right there on the second line: Unable to connect to your database server using the provided settings.
Try connecting to your database with something like PhpMyAdmin, using the same user/password you have in your configuration.
The database may be unavailable at the moment (down), maybe the password has expired and you are required to change it. There may be several reasons for this to happen.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#3

(05-16-2021, 06:11 AM)includebeer Wrote: The reason is right there on the second line: Unable to connect to your database server using the provided settings.
Try connecting to your database with something like PhpMyAdmin, using the same user/password you have in your configuration.
The database may be unavailable at the moment (down), maybe the password has expired and you are required to change it. There may be several reasons for this to happen.



i check all what i need to do now to solve this problem
Reply
#4

What have you done so far? We don't have a crystal ball, you need to give some informations...
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#5

Here is some test code to see if your login is correct.

PHP Code:
<?php
// Code to create the database

// Add your own username and password
$serverName "localhost";
$userName   "username";
$password   "password";

// Create the Database Connection
$connId mysqli_connect($serverName$userName$password);

// Check the Database Connection
if ($connId === false)
{
    exit("ERROR: Could not connect. " mysqli_connect_error());


// Create the Database
// Add your datya
$sql "CREATE DATABASE yourDatabaseName";

// Check that the Database was created
if (mysqli_query($connId$sql))
{
    echo "Database created successfully";
}
else
{
    echo "ERROR: Creating Database. " mysqli_error($connId);
}

// Close the Connection
mysqli_close($connId);

?>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

Did you change anything in the codeigniter.php file in /system/core?
Because according to the message, if you are using version 3.1.1, line 517 has no relation to databases:

PHP Code:
/* <== line 510
 * ------------------------------------------------------
 *  Instantiate the requested controller
 * ------------------------------------------------------
 */
 // Mark a start point so we can benchmark the controller
 
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
// <== line 517
 
$CI = new $class(); // <== line 518

/* 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB