Welcome Guest, Not a member yet? Register   Sign In
SQLite connect
#1

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.
Reply
#2

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...
Reply
#3

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...
Reply




Theme © iAndrew 2016 - Forum software by © MyBB