Can't connect my database on Hosting

This is my connection:

Using CodeIgniter

$db['mysql'] = array(  
'dsn' => 'mysql:host=mysql.{redacted};dbname={redacted}',
'hostname' => 'mysql.{redacted}',
'username' => '{redacted}',
'password' => '{redacted}',
'database' => '{redacted}',
'dbdriver' => 'pdo',

);

This is my localhost connection

$db['mysql'] = array(
'dsn'   => 'mysql:hostname=localhost; dbname=1410inventory',
'hostname' => '',
'username' => 'root',
'password' => '',
'database' => '',
'dbdriver' => 'pdo',

My log pulls this:

ERROR - 2018-07-23 19:36:18 → PDO: Invalid or non-existent subdriver

Please Help

Hi @gmartinezmendieta and a warm welcome to the Sitepoint Forums.

First check that both CodeIgniter versions are the same, try echo CI_VERSION;

Also try to see if Mysqli will connect.

CodeIgniter has an active and friendly forum with many knowledgeable users who may also be able to offer suggestions.

Edit:
I also use CodeIgniter and cannot connect using PDO but only using the CI4 Pre-release version. Previous stable versions all work as expected.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.