First, I would like to introduce the problem.
I have a Informix database that is currently used by 300 staffs (average is around 100,000 records/query) that make this server work slowly. Current architecture is:
Informix DB ⟷ Web Application
Now I want to implement the new system by adding new MySQL server with the following architecture
Informix DB ⟷ MySQL Server ⟷ Web Application
In MySQL Server I would like to copy the database from Informix to MySQL server by using PHP + Cronjob.
The questions are:
Is there has any ODBC / JDBC driver (must be FREE!!) in LINUX for connecting to Informix?
How to use it?
PHP has an extension for connecting to Informix. See the manual pages here: http://php.net/manual/en/book.ifx.php
You can also use the PDO extension with its Informix driver: http://php.net/manual/en/ref.pdo-informix.php
In both cases, you need to ensure that your copy of PHP has been built with those extensions. You can check what extensions are in your copy of PHP by seeing the output of the php_info() function. If it doesn't include the relevant extensions, then you'll need to rebuild your copy of PHP to include them.
The IBM Informix ClientSDK (CSDK) includes both ODBC and JDBC drivers, and can be obtained free of charge. If you want support for the software, there is a charge, of course.
If you go to http://www.informix.com/ (the www is crucial; omit it and you get to the IBM home page), you get directed to http://www.ibm.com/software/data/informix/. The free database editions include CSDK in the download. It is possible to get CSDK standalone, without the server, too. And IBM Informix Connect (I-Connect) is the runtime part of CSDK.
You can connect to Informix from PHP with PDO Informix or PDO IBM modules.
Related
I have php program that requires MS Access, so I had to use odbc. Locally, using DSN it was working fine:
$db = new PDO("odbc:MyDSN");
I also have no problem when I put the php and odbc at the server and access it remotely:
$db = new PDO("odbc:DRIVER=MDBTools; DBQ=Data.mdb;");
But I can't afford to use it for some reason. I want to put php on the server together with the database but I want to place odbc (or the odbc driver) on the client, something like this:
$db = new PDO("odbc:{127.0.0.1\foo\bar\odbc.ini}; DBQ=Data.mdb;");
I can't seems to work with it for a while. I'm using Ubuntu 64bit as server, and Windows 7 as client
UPDATE 1: I found a way to do it, but it needs to modify the PHP itself (Classes,structure,etc.) I hope someone can help me to get alternative solutions
UPDATE 2: Another solution, but requires third party software.
But I can't afford to use it for some reason. I want to put php on the
server together with the database but I want to place odbc (or the
odbc driver) on the client, something like this:
The driver must be loaded by PHP, which is the "client" in this scenario. Means, you'll have to find an appropriate MSAccess ODBC driver for Ubuntu.
Check this SO thread:
ODBC connection to MS-Access on Ubuntu
I am really confused about that
There is a phpinfo() output:
MySQL Support enabled
Client API version 5.5.40
MYSQL_MODULE_TYPE external
And the phpMyAdmin shows:
Server type: MariaDB
MariaDB is a fork of MySQL, but does that mean that MDB IS a MySQL database? Why phpinfo does not provide any information about MariaDB?
I am not sure if php is correctly configured on my hosting server, either not sure how to check it.
There is not necessarily a 1:1 correspondence between web servers running php and database servers running MySQL (or a different kind of database). The two things, even if running on the same system, are not connected or aware of each other, unless your php code specifically connects to the MySQL Server, and it isn't unheard of for a web app to connect to more than one MySQL Server.
So to expect the php info script to know anything about the MySQL Server is to expect the wrong thing.
Client API version 5.5.40
This means php has the MySQL client module that shipped with MySQL Server 5.5.40 and so is fully compatible with any MySQL Server up to and including version 5.5.40, and for the most part should also work with newer versions.
MariaDB is, for most purposes, fully compatible with MySQL Server, and the MySQL client library used by php.
Oracle owns MySQL. MariaDB is based on MySQL, and includes performance improvements of its own as well as some that were integrated from a third product, Percona Server, which is also MySQL compatible. MariaDB and Percona both are essentially drop-in replacements for MySQL. They look and act and communicate just like MySQL (with exceptions not relevant to the average user) and php doesn't know the difference, or care. A fourth variant is Amazon Aurora, also MySQL compatible, but some legacy capabilities are removed and others enhanced, in the interest of very high performance. Aurora is only available as a cloud service; the others can all be installed locally.
But php is only showing you its capability of connecting to MySQL -- not info about the MySQL server itself.
My old server:
- Windows 2003 Server
- IBM DB2 UDB Version 8.1
- ODBC: User DSN:
There is a .NET webapps connect to MYDB using ODBC, it is good now.
But Windows 2003 is end of support from Microsoft on this month. So, I want to move from it.
The problem: I don't know .NET at all. The current .NET webapps was closed source and I cannot contact to provider company (it was defunct).
I want to get all tables from DB2 from PHP (running in my Ubuntu 14.04 desktop). I like to use PDO ODBC to connect. But it seems to be over my skills. My desktop is on the same subnet LAN with Windows 2003 server (ping to and from is OK), telnet server2003 ip port 5000 is OK.
I am stuck after install ODBC, config something in my desktop... Nothing works.
Who helps me? Every help is appreciated. There are no words to show my appreciation!
In addition to configuring and troubleshooting PHP access to DB2 via PDO ODBC, you will also need to migrate your DB2 8.1 server and clients, if any, to a newer DB2 release level (IBM ended support for DB2 UDB 8.1 back in May 2009). Fortunately, IBM now offers a no-cost version of DB2 called Express-C, which is authorized for production use. The current release, DB2 Express-C 10.5 Fix Pack 5, can accommodate databases up to 15 terabytes in size.
If it turns out that your company has an active DB2 license available for your application, then forget about Express-C and install whatever DB2 server edition is covered by your license.
To move your data out of DB2 UDB 8.1, you'll need to export the contents of each table to a separate file and import them into the new database. The db2move utility can assist with this process by iterating through all the tables in your database, saving you from typing all those EXPORT statements yourself.
Once your DB2 data is migrated to a new database, you can install a DB2 client on your Linux PHP server and test your connectivity. To keep the file size down, IBM offers a variety of DB2 client downloads, which can add some confusion as to which one you need. For ODBC and PHP applications, you should download the IBM Data Server Driver Package or, to be safe, the larger IBM Data Server Client which contains all the drivers and client libraries. Be sure that the client you download is the same version and Fix Pack level as your DB2 server (e.g. 10.5 Fix Pack 5).
IBM's online documentation and the PHP manual have a bit of information about connecting PHP applications to DB2.
Ubuntu 12.04 LTS Precise
I'm trying to use PHP to connect to a remote Windows Sybase database. Let us assume Windows 7 Enterprise SP1. I'm currently doing this in PHP:
$db = sybase_connect("10.1.208.111", "$user", "$pass");
And I'm getting an error of:
Warning: sybase_connect(): Unable to connect to server: 10.1.208.111
I understand that the server I'm connecting to (10.1.208.111), needs to be in the interfaces file. I'm trying to figure out where that is, or even if I have one on the Ubuntu server (I'm still new to linux itself). I read that the path for the file is located in the SYBASE environmental variable. I don't know where that is either. Can anyone shed some light? I can offer more information if you need it, I just don't know what you need right off the bat.
PS: The windows machine has Micros RES installed on it. That's the database I'm trying to pull data from. Not sure if that matters.
The default installation directory for Sybase ASE in windows is C:\sybase, so your interfaces (interfaces.ini) should be located there.
For SQL Anywhere, the interfaces file is called SQL.ini, and it's location varies, but you should be able to do a search of your system drive to find it.
For SQL Anywhere you probably want to use the PHP apis that are provide by SAP Sybase. The SQL Anywhere documentation is a pretty good place to start, as it covers all the pieces that need to be installed to get SQL Anywhere to talk to PHP.
SQL Anywhere 11: SQL Anwhere PHP API
You may also be able to find good information over at the SAP Community Network site for SQL Anywhere.
I'm interested in quering a Pervasive DB server running on a Windows platform from Linux.
Would anyone happen to know if this is possible, what's required and what resources there are for me to read up on it?
Thanks!
What version of Pervasive are you using? All versions since v8 (including v9 and v10) support a Linux client which is included with the Pervasive.SQL server engine. V9 and V10 clients are also available for download from the Pervasive website (http://www.pervasivedb.com/Database/Products/PSQLv10/Pages/PSQLOverview.aspx). Once you've got a client installed on the Linux machine, you can create an ODBC DSN or use the Btrieve API to access the data.
Most database have at least a command line client to connect to database. check your brand of database to see if you have such tools. For example, Mysql has mysql command line client for making query to MySql database. Otherwise, another way is you might want to try setting up ODBC with Perl.