I can not connect my database in my Hosting

1

This is my connection:

Using CodeIgniter

$db['mysql'] = array(   
'dsn' => 'mysql:host=mysql.hostinger.co;dbname=u201535648_regis',
'hostname' => 'mysql.hostinger.co',
'username' => 'u201535648_germa',
'password' => 'password',
'database' => 'u201535648_regis',
'dbdriver' => 'pdo',

);

This is the connection of my local, I do not know very well how to configure the dsn

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

);

This is the connection I have to make:

My log pulls this:

  

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

Please help, it's urgent.

    
asked by German Mendieta 23.07.2018 в 22:47
source

2 answers

0

According to the documentation , if you are using PDO most likely you have to also provide the DSN (Data Source Name) . Try doing it this way:

// PDO
'dsn' => 'mysql:host=mysql.hostinger.co;dbname=u201535648_regis';
    
answered by 23.07.2018 в 22:58
0

I have had many problems similar to yours sometimes was for other things and almost always I have solved in these areas.

Config

$config['base_url'] = 'http://hostinger.co/';

Database

'dsn'   => '',
'hostname' => 'mysql.hostinger.co',
'username' => 'u201535648_germa',
'password' => 'password',
'database' => 'u201535648_regis',
'dbdriver' => 'mysqli',
'dbprefix' => '',

htaccess

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.html index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
    
answered by 24.07.2018 в 20:00