-
mrdan32 Newbie

-
Posts: 3
Threads: 2
Joined: Mar 2015
Reputation:
0
I'm using CI 3x to convert data from MySQL to SQLite to work on my mobile app.
My database config:
PHP Code: $db['sqlite'] = array( 'dsn' => '', 'hostname' => '', 'username' => '', 'password' => '', 'database' => '/Users/dudan/Documents/db_sqlite/db.jokes.sqlite', 'dbdriver' => 'sqlite3', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'autoinit' => TRUE, 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
The SQLite DB is SQLite 3. The message:
Code: A Database Error Occurred
Unable to connect to your database server using the provided settings.
-
ngangchill Junior Member
 
-
Posts: 21
Threads: 5
Joined: Feb 2015
Reputation:
0
try this:
$db['sqlite'] = array(
'dsn' => '/Users/dudan/Documents/db_sqlite/db.jokes.sqlite',
'hostname' => '',
'username' => '',
'password' => '',
'database' => ''
'dbdriver' => 'pdo'
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
it is.working fine in my projects...
-
mrdan32 Newbie

-
Posts: 3
Threads: 2
Joined: Mar 2015
Reputation:
0
Thank you, I've solved it. It seem to be the file permission!
(03-01-2015, 01:37 PM)ngangchill Wrote: try this:
$db['sqlite'] = array(
'dsn' => '/Users/dudan/Documents/db_sqlite/db.jokes.sqlite',
'hostname' => '',
'username' => '',
'password' => '',
'database' => ''
'dbdriver' => 'pdo'
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
it is.working fine in my projects...
|