I need to connect sybase with codegniter 4 and all searches lead to version 3, is there any solution to use sybase in codegniter 4?
Database
public $default = [
//'DSN' => 'odbc:Driver={Adaptive Server Enterprise};',
//'DSN' => 'pdo://root:qwe123#localhost:6100/root',
'DSN' => 'odbc:Driver={Adaptive Server Enterprise};Server=localhost;port=6100;Database=db_pm',
'hostname' => 'localhost',
'username' => 'root',
'password' => 'qwe123',
'database' => 'db_teste',
'DBDriver' => 'Sybase',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'development'),
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 6100,
];
Related
CodeIgniter\Database\Exceptions\DatabaseException #8
Unable to connect to the database. Main connection [MySQLi]: Access denied for user 'xxxx'#'localhost' (using password: YES)
I'm trying to access my program, but I can't connect the database. How do I do that? cause i'm still beginner
public $default = [
'DSN' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'starter',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'cacheOn' => false,
'cacheDir' => '',
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
// 'failover' => array(),
// 'save_queries'=> TRUE,
'port' => 3306,
];
public $tests = [
'DSN' => '',
'hostname' => '127.0.0.1',
'username' => 'root',
'password' => '',
'database' => ':memory:',
'DBDriver' => 'SQLite3',
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production ),
'cacheOn' => false,
'cacheDir' => '',
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
How can i connect sqlite3 with ci4?
my configurations are:
public $default = [
'DSN' => '',
'hostname' => '',
'username' => '',
'password' => '',
'database' => 'edmis.db',
'DBDriver' => 'SQLite3',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'cacheOn' => false,
'cacheDir' => '',
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
file edmis.db exist in folder 'writable'
Error i am receiving.
I have newly installed PHP 7.2.4 and Apache 2.4 on windows server 2008 r2. Everything done; i have set the paths, but problem is that when i configuring my PHP file for the connection, it gives me an error unable to connect with database. I am using codeIgniter 3.1.8.
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'database_name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => TRUE,
'db_debug' => TRUE,
'cache_on' => FALSE
)
define('ENVIRONMENT','development'); This is a Codeigniter 3, database.php (non SSPI) snippet example for MSSQL 2008R2:
define('ENVIRONMENT','development');
$db['test1'] = array( 'dsn' => '',
'hostname' => 'MY_MSSQL_DB_FQDN\i1,10001',
'username' => 'somemssqluser',
'password' => 'somemssqlpassword',
'database' => 'somedbname',
'dbdriver' => 'sqlsrv',
'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
);
So sorry if this exists, but I'm having trouble with codeigniter 3, php 5.6, sqlserver 2008 and win7 64x.
I followed the steps from various sites, such as Rob's Area, also read a couple of questions in this site but still can't find the answer.
With php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll from SQLSRV32.EXE the error I was getting was:
Unable to connect to your database server using the provided settings.
Filename: C:/xampp/htdocs/mycodeigniter/system/database/DB_driver.php
Line Number: 436
Then downloaded Rob's sqlsrv_unofficial_3.0.2.2.zip and got this error:
Message: Call to undefined function sqlsrv_connect()
Filename: sqlsrv/sqlsrv_driver.php Line Number: 144
The code I have in Codeigniter is:
$db['default'] = array(
'dsn' => '',
'port' => '1433',
'hostname' => '127.0.0.1',
'username' => 'myuser',
'password' => 'mypass',
'database' => 'mydb',
'dbdriver' => 'sqlsrv',
'dbprefix' => '',
'pconnect' => TRUE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'autoinit' => TRUE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
Then used this one, this one worked, but can't call the results when querying.
$db['default'] = array(
'dsn' => 'Driver={SQL Server Native Client 10.0};Server=127.0.0.1;Database=mydb;',
'hostname' => '',
'username' => 'myuser',
'password' => 'mypass',
'database' => 'mydb',
'dbdriver' => 'sqlsrv',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
Please ideas?
Take the php_pdo_sqlsrv_56_ts.dll (afaik the current sqlsrv build should be ok, otherwise you've to take robs build)
After that try the following in your db-config
$db['default'] = array
(
'dsn' => 'sqlsrv:server=127.0.0.1,1433;Database=mydb',
'username' => 'myuser',
'password' => 'mypass',
'dbdriver' => 'pdo',
...
);
1433 is the current port - change it to your defined port - but i'm not sure if you need that
I run wamp and try to connect to db but I got
Unable to connect to your database server using the provided settings.
Few faqs / what I've done:
I autoloaded the database library in config.php
my phpMyAdmin doesn't have any username and pass set
this is the setting in database.php
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => 'ciintro',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => TRUE,
'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
);
'username' => '',
should be
'username' => 'root',
check username.
I think you are newer to codeigniter.
'username' => 'root' ( root or whatever you set for PHPMYADMIN.)
'password' => 'password' ( password or whatever you set for PHPMYADMIN.)