-3

A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: YES)

Filename: mysqli/mysqli_driver.php

Line Number: 203

Backtrace:

File: E:\xampp\htdocs\website_ci\application\controllers\Welcome.php
Line: 8
Function: __construct

File: E:\xampp\htdocs\website_ci\index.php
Line: 315
Function: require_once

I have tried to reinstall xampp but still error

before I tried to set phpmyadmin on online hosting and when I tried to access localhost I got an error like this

mchawre
  • 10,744
  • 4
  • 35
  • 57
Risky. A
  • 1
  • 1
  • 4
    Did you notice that the user name is empty? – RalfFriedl Jun 26 '19 at 17:48
  • 1
    Error message is itself self-explanatory. https://stackoverflow.com/questions/35852956/codeigniter-error-when-trying-to-connect-to-database-using-mysqli . – jones Jun 27 '19 at 04:43

1 Answers1

0

config/database.php

$db['default']=array(
'dsn'=>'',
'hostname'=>'localhost',
'username'=>'root',
'password'=>'',
'database'=>'database_name',
'dbdriver'=>'mysqli',
'dbprefix'=>'',
'pconnect'=>FALSE,
'db_debug'=>(ENVIRONMENT !== 'production'),
'cache_on'=>FALSE,
'cachedir'=>'',
'char_set'=>'utf8',
'dbcollat'=>'utf8_general_ci',
'swap_pre'=>'',
'encrypt'=>FALSE,
'compress'=>FALSE,
'stricton'=>FALSE,
'failover'=>array(),
'save_queries'=>TRUE

);