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

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.

Related

Uploading Databases

How does one go about uploading a database like Apache Cassandra after creating one? Furthermore, is there a way to upload/share only its skeleton structure, without the data gathered in it? I'm on MacOS and would like to use Python to do all of this. Thank you!
Based on your second comment, I guessed it to mean you want the database to be remotely accessible to clients/apps not installed locally.
Clients/apps connect to Cassandra on the IP address set for rpc_address and the CQL port set for native_transport_port (default is 9042) set in cassandra.yaml.
You mentioned that your Cassandra instance is running on your laptop so only clients/apps running on your local network can access it if you configure rpc_address to an IP address accessible on the network (default is localhost).
If you're just trying out Cassandra and want to collaborate with other developer friends, try Astra and launch Cassandra instance on the free-tier (no credit card required). With it you can share the database credentials with your friends and they can connect to it over the internet.
You can connect to Astra from your Python app using the Python driver. Otherwise, Astra includes Stargate.io pre-configured and ready to use. Stargate is a data access gateway that lets you connect to Cassandra from your app using REST API, GraphQL API or JSON/Doc API without having to learn CQL. For more info, see Connecting to your Astra database. Cheers!

OCIServerAttach() hangs forever

I have observed quite some time that the connection attempt to an Oracle server using OCI library hangs forever and I am not able to find a way out to cancel the hung session. Even Ctrl+C doesn't work.
Do we have an option to call OCIServerAttach API in non-blocking mode or is there is an option that can be used to timeout the OCIServerAttach call?
Please note that the OCI version I am using is 11.2.0
Oracle Net can be configured to limit the connection establishment time. The available options have been enhanced in various versions. Oracle 11.2 is 10 years old!!
For recent versions (check the manual for your version), you could create a sqlnet.ora file with options like SQLNET.OUTBOUND_CONNECT_TIMEOUT or TCP.CONNECT_TIMEOUT, or use CONNECT_TIMEOUT in a tnsnames.ora file. Search for 'connect_timeout' in that manual for other choices.
If you use 19c client libraries (that, by the way, will connect to Oracle DB 11.2 or later) then you can even use a timeout option in an Easy Connect connection string like "mydbmachine.example.com/orclpdb1?connect_timeout=15"

Connecting Apache Superset to an external database

I am running apache superset on docker, and I have been trying to connect to an external database(Postgres) using the example link on SQLAlchemy Docs for connecting to a Postgres database (postgresql://scott:tiger#localhost/mydatabase // postgresql://username:password#localhost:5433/postgres). However, I have been getting the following error: Connection failed, please check your connection settings. Could someone please help me with this.
Are you sure that your postgres is on the same network (localhost)? It seems for external database, that it would likely be on another network (and therefore you would use IP address)?
If these are the docs you are looking at --> https://docs.sqlalchemy.org/en/12/core/engines.html#database-urls
Then you might want to think in terms of 'host', meaning then an IP(v4) address and/or DNS.
As it was recommended you may need to whitelist your Superset IP address in pg_hba.conf.
You may also need to check if you have the right driver installed in the docker instance that you are running superset.

java.sql.SQLException: [tibcosoftwareinc][Oracle JDBC Driver][Oracle]ORA-28040: No matching authentication protocol

I get above error while trying to connect oracle 12c. I try using ojdbc6 and ojdbc7 jar files. I found below comment
------------------->
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION parameter has been updated to 11. This means that database clients using pre-11g JDBC thin drivers cannot authenticate to 12.1 database servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to fail with the ORA-28040: No matching authentication protocol error in 12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file.
<-------------------
I have one dought to implement above workaround as we have shared database.
If I set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file will it affect other users ?
Will it affect shared applications and its functionality ?
Setting SQLNET.ALLOWED_LOGON_VERSION=8 in sqlnet.ora affects all connections to the server. You're allowing user authentication with older versions of the password verifier and it affects all users. You can't allow it for just one user. But this isn't going to break other applications that can already connect successfully. It will allow older applications (that use old drivers) to connect too. The best solution is to upgrade all clients if possible but this setting is the workaround and it was made available for this exact purpose.

How to access remotely MS SQL Server on linux ubuntu 14.04

How would I access MS SQL Server with ubuntu 14.04. I tried using freetds I failed to understand the process and It was my first time learning sqlmap. I have tried to read for several hours but in vain. Just give me a clue a way to proceed. I have the IP address of the database but I don't know how I can read it.
DbVisualizer (https://www.dbvis.com) should work for you. Its cross platform, fairly easy to use and can connect to almost any kind of database. You'll need the IP address, port, username and password, just create a new connection and provide the connection details. You then can see the tables and run SQL against them (you're gonnna need to learn SQL if you don't know it).
It would help to know what you are trying to migrate. Im assuming the Ubuntu server is where the data is, but you haven't said what platform you are using or what format you are trying to get the data in. Are you just trying to clone the entire database to your local MySQL process?

Resources