can not PDO nuodb - database

I want to connect nuonb with yii framework. After i configed from this guide (configuring database connection in Yii framework)
I cannot connect to database.
So I look at another page that config nuodb with php Framework.
http://www.nuodb.com/techblog/2013/06/20/using-nuodb-from-the-php-zend-framework/
I configed and test in command line I think it work case after i use this command
php -i | grep PDO
The Result is
----------------------------------------
PDO support => enabled
PDO drivers => mysql
PDO Driver for MySQL => enabled
But when I use function to test PDO in php with function phpInfo(), It can't find nuodb PDO ( PDO is no value).
Please help me fix this problem.
Remark. My server is Aws Ec2 Ubunto.

I wouldn't trust this "nuodb" at all. Looks like a bubble.
You didn't install nuodb anyway, but mysql.
So - just go on with mysql!

#Sarun Prasomsri
What version of NuoDB are you running?
What version of PHP? (supported versions are PHP 5.4 TS VC9 and PHP 5.3 TS VC9)
# Your Common Sense
NuoDB does install - it can run on a localmachine, datacenter, or AWS/Azure/Google Compute, like any other Database.
There are concrete details in the online doc: http://doc.nuodb.com/display/doc/NuoDB+Online+Documentation
techblog: http://dev.nuodb.com/techblog

Related

Try to install DB2 connector for requesting IBMi (AS400) on CentOS 8

I have to install DB2 PHP driver on Centos 8 for make requests to IBMi (AS400) with PHP 7 and nginx, I try to find a guide but unfortunately i can't find anything.
So I ask you, do you have a link or tips for this ?
Thanks.
You will most likely want to use the IBM i Access ODBC driver.
IBM i Access for Linux: Open Database Connectivity
There are a few options depending on how much you want to spend.
ODBC - This is likely going to be your least expensive option. You can get the drivers from the IBM i Access product mentioned by jamesallman. The IBM customer likely already has IBM i Access Client Solutions, and would already be licensed to use the driver. If you don't have the Linux drivers, here is a starting point.
IBM_DB2 / PDO_DB2 - both of these need a DB2 client. The client required by IBM i is provided with the DB2 Connect product. If you don't already have a license for that, it is also available from IBM, but it is in the "If you have to ask, it's too expensive" category.

Metasploit msfrpcd with database

I have a problem, I want to run Metasploit framework as a service, but it can not connect database if use "msfrpcd" tool. If I use msfconsole and "load msgrpc" is ok. So can you help me connect to the database when I use the "msfrpcd" tool. Thanks for your supports.
Try starting the postgres service.
Try running these commnands
service postgres start
msfdb init
msfconsole
This should do the trick.

Add SQL 2014 support to activerecord-sqlserver-adapter

We've be using the activerecord-sqlserver-adapter gem with sqlserver 2008 and everything works great. We just tried to deploy our Rails 3 app against a new sqlserver 2014 db and I get an error that says:
Currently, only 2005, 2008, 2010, 2011, and 2012 are supported. We got back Microsoft SQL Server 2014 - 12.0.2000.8 (X64)
A quick look at github shows that a small update was recently made to the sqlserver_adapter.rd to resolve this issue. I tried to update the gem and it turned into a bit of dependency hell and eventually looked as though I'd have to upgrade to rails 4 (which I don't particularly want to do right now) in order to get this fix.
So I thought I make my first attempt at a monkey patch and created an .rd in my initializers folder that incorporates the the changes to add sqlserver 2014 support:
module ConnectionAdapters
class SqlServerAdapter < AbstractAdapter
SUPPORTED_VERSIONS = [2005,2008,2010,2011,2012,2014]
# === SQLServer Specific (DB Reflection) ======================== #
def sqlserver_2014?
#database_year == 2014
end
end
end
My intention was to simply override the several lines of code in sqlserver_adapter.rd with change in the fix on github. However when I try to deploy, I now get an UnitializedConstant Error referring to AbstractAdapter.
How can make this patch work? Or this there a better way to accomplish this task?
I found a much better solution than a monkey patch. Turns out the guys over at activerecord-sqlserver-adapter updated the various releases so I just had to specify the version 3.2 branch with the SQLServer 2014 support fix. The following line in my gem file resolved the entire issue and we are now connecting to SqlServer '14
gem 'activerecord-sqlserver-adapter', :git => "git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git", :branch => "3-2-stable"
I have also addressed this problem with the Ruby 1.8.6 setup that I inherited.
The solution is not really as high-tech as proposed here.
The adapter interface is located at C:\ruby\lib\ruby\gems\1.8\gems\activerecord-sqlserver-adapter-2.3.4\lib\active_record\connection_adapters and is called sqlserver_adapter.rb.
I modified the following code to appear as such:
class SQLServerAdapter < AbstractAdapter
ADAPTER_NAME = 'SQLServer'.freeze
VERSION = '2.3.4'.freeze
DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+(\d{4})/
SUPPORTED_VERSIONS = [2000,2005,2008,2012,2016].freeze
LIMITABLE_TYPES = ['string','integer','float','char','nchar','varchar','nvarchar'].freeze
LOST_CONNECTION_EXCEPTIONS = {
:odbc => ['ODBC::Error'],
:ado => []
}
LOST_CONNECTION_MESSAGES = {
:odbc => [/link failure/, /server failed/, /connection was already closed/, /invalid handle/i],
:ado => []
}
The only thing I did to modify the adapter code was change [2000,2005,2008] to [2000,2005,2008,2012,2016].
I then used the ODBC Datasource Administrator (32-bit) to configure to use the "SQL Server Native Client 11.0" for the Sql Server 2016 instance.
This last step is the really important one in the ODBC adapter setup.
The "SQL Server" adapter may default to a 64-bit connection which gives the following error when trying to connect to the database:
#<ODBC::Error: S1090 (0) [Microsoft][ODBC Driver Manager] Invalid string or buffer length>.
I am retrofitting an obsolete 2008R2 server set of legacy Ruby programs running on Apache to a new Windows Server 2016 setup, and don't have the luxury of debugging the legacy Ruby code to make it work with a newer version of Ruby and Ruby on Rails.
This low-tech solution fully meets our operational needs, budget and time constraints.
I did the following with v 4.1.8:
module ActiveRecord
module ConnectionAdapters
class SQLServerAdapter < AbstractAdapter
SUPPORTED_VERSIONS << 2014
# === SQLServer Specific (DB Reflection) ======================== #
def sqlserver_2014?
#database_year = 2014
end
end
end
end

codeception with ms sql? Behat support for mssql?

Has anyone got this working?
I know the docs say that ms sql support is not tested, so I wonder if anyone had it working?
I have enabled the Db module in acceptance.suite.yml
And my credentials in codeception.yml look like this:
modules:
config:
Db:
dsn: 'mssql:host=******.db.8876686.hostedresource.com;dbname=*******'
user: '*******'
password: '******'
dump: app/tests/_data/dump.sql
In my cest file, I have the following function:
public function testUserDb(WebGuy $I)
{
$I->seeInDatabase('Users',['Email' => 'someguy#email.com']);
}
But I get the following error when running:
[Codeception\Exception\Module]
(Exception in Db) could not find driver while creating PDO connection
So I'm guessing ms sql doesn't work..
It looks like I'm not going to have any joy - anyone know if Behat has ms sql / sql server support?
Thanks
Jon.
Behat itself doesn't have anything to do with databases. If you need connecting to one from a Behat context file, you just use whatever is used in your application.
I've successfully used Doctrine with Behat for example, also with mssql.
For mssql integration you will need the doctrine-pdo-dblib package.

How to connect to a SQLite DB with Agile Toolkit 4?

I'd like to use SQLite3 with Agile Toolkit. I found it in the documentation that the SQLite driver is included with atk4, but I couldn't find any examples of how to connect to a SQLite DB.
I tried to change the DB connection of the example applications shipped with atk4 from MySql to SQLite using the format found in the Pear:DB DSN documentation:
$config['dsn']='sqlite:////var/www/webdev/atk4_example.db';
but I keep getting the could not find driver PDO error:
Application Error: Database Connection Failed
BaseException, code: 0
Additional information:
* PDO error: could not find driver
* DSN: :host=;dbname=;charset=utf8
/var/www/webdev/atk4/lib/DB.php:94
The SQLite PDO driver seems to be installed correctly on the server. Both the phpinfo() and an PHP/PDO/SQLite3 example page confirms that it works.
I'm learning Agile Toolkit, PHP and general web development, so I might be missing something trivial.
Can you try following syntax in your config.php?
$config['dsn']='sqlite://username:password#hostname/dbname';
Also please check if you have MySQL (yes, MySQL not SQLite) extension enabled in your php.ini. If not, then try to enable it and test again. If SQLite works with enabled MySQL extension then I guess I have found small bug in DB.php and could fix that.
Also it looks that you can pass DSN parameters in following format as array and maybe that's even better:
$config['dsn'] = array(
'sqlite:host=hostname;dbname=dbname;charset=utf8',
'username',
'password'
);
Please try 2 solutions described above and let me know if they work.
I can't test that myself now because I'm not at my developing computer.

Resources