i have been using xampp as localserver . when i try to run my code that time it will give a error -> " Unable to connect to your database server using the provided settings.
Filename: core/CodeIgniter.php
Line Number: 518 "
also give one more error " A PHP Error was encountered Severity: Warning
Message: mysqli::real_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'stud'
Filename: mysqli/mysqli_driver.php
Line Number: 203
Backtrace:
File: /opt/lampp/htdocs/CodeIgniter/index.php Line: 315 Function: require_once "
code -->
` $db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => 'stud',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE /*(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
);
`
Step #1. Change the username to 'root' or what ever you configured and run the code.
Step #2. If you are still facing the issue, changes the password from '' to the one which you entered at the time of MySQL installation and run the code.
Step #3. If you are still facing the issue double check the database username and run the code.
Step #4. If you are still facing the issue, please find the port number on which MySQL is running and configure.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.