Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Database Error Occured

$
0
0
We have a project which initially made in xampp (windows) but should be ran on Linux. I installed CentOS  7 ( 7.3.1611) and used MariaDB as it is default DB. PHP version is 5.4.16. I dumped exact sql script generated from xampp to the server (CentOS) and added same username and pw and gave permission to access project's database. I got plenty of errors such as errors related with .htaccess and i fixed them. Now, I stuck with this database error: 

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/CodeIgniter.php

Line Number: 515.

I checked settings on database.php and seemed right. Settings are the following:

$db['default'] = array(
        'dsn'   => '',
        'hostname' => 'localhost',
        'username' => '*****',
        'password' => '******,
        'database' => '******',
        '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
);

If I changed hostname to its IP address I got HTTP ERROR 500 and also same error if I connect to xampp's mysql using it's IP address. Can someone help me to fix this problem? Is my dbdriver setting correct since the database in my CentOS is MariaDB? Is there a way I could see the exact error instead of giving me HTTP ERROR 500?

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>