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.
Related
We have real old server running DTS packages and SSMS 2008 or older. We need to transfer our DB to new server that can also run PHP applications.
What do I need to do to set it up?
Thank you,
If you are using an old Win server that is vulnerable to hacking and wish to replace it with a new one (capable of running PHP), broadly you have two choices:
Windows Server
a) You may stick to using Win server OS and upgrade the db version and server OS to the latest version (SQL Server 2022 and Win Server: 2022) , then if you wish to run PHP on the machine, you may install it thru Microsoft Web Platform Installer so that the machine will be one with IIS capable of running PHP. For details, please refer to MS site:
https://learn.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
Linux Server
b) you may choose to set up a linux server which is capable of running PHP/MySQL, and migrate the existing MSSQL database (as you have specifically mentioned) to MySQL thru some sort of migration tools
For setting up a linux server capable of running PHP (aka LAMP), you may refer to the following link (and others)
https://superuser.com/questions/993316/how-do-i-set-up-a-lamp-server-from-scratch-using-centos-6-7
For migrating the MSSQL to MySQL, you may refer to this SO post for some reference / information:
How to migrate SQL Server database to MySQL?
I prefer Ubuntu for a long time, so I would install the latest Ubuntu version on a server.
I would use apt install to install mysql and php8.
Dump the old database to file and copy it to new server.
Import the new database.
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
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.
I've got a problem and there doesn't seem to be a strait forward solution.
I'm running a Linux server with PHP and need to connect to a MSSQL database on a remote server (I don't have control over this server). Speaking to my host, they say that it's not possible eto install the MSSQL extensions on a linux box as they are only available on Windows Servers. So, I'm looking to see what other options i have.
Any ideas how I can do this on a linux box?!
it's not possible eto install the MSSQL extensions on a linux box
They lied. It is possible, but it requires FreeTDS to compile.
Other solution is to use other host (with windows) to act as proxy to MSSQL server, and communicate with it by SOAP/REST
you have to do it via an ODBC connection.. odbc_connect() etc etc.. Microsoft has drivers for this http://www.microsoft.com/en-gb/download/details.aspx?id=28160.. (edit) I have done this without any of the issues posted... the php.net website for odbc_connect even gives mSSQL examples in the manual http://php.net/manual/en/function.odbc-connect.php
Maybe this helps, send it to your server host:
http://pointbeing.net/weblog/2010/05/successful-microsoft-sql-server-support-for-php-on-linux.html
Commonly a database module is installed but in your case you could try to use a REST-API to talk with the MSSQL database. But that must be installed on a second server e.g. the database server itself.
If I replace a MySQL 5.1 server with a MariaDB Server (Maria & XtraDB storages) instead of MySQL (MyISAM & InnoDB), will most of MySQL client software (incl. applications made with PHP 5.2 and Java SE 1.6) ...
just remain working without any changes (with minor regressions maybe)?
Or will I have to replace/reconfigure client drivers (like use another JDBC driver class and connection string)?
Or will I have even to change application code?
http://kb.askmonty.org/v/mariadb-versus-mysql
All MySQL connectors (PHP, Perl, Python, Java, MyODBC, Ruby, MySQL C connector etc) works unchanged with MariaDB.
I have used Mariadb as replacement for Oracle's MySQL for years. It is faster and very reliable. Needs just little attention in apt, but nothing severe. Also, there is one small detail with Mariadb; it is seeing [error] "PHP Warning: mysql_connect(): Headers and client library minor version mismatch" in the logs. I haven't found any other solution to that other than to start manually compiling: askMonty.
$php -i | grep 'Client API'
Client API version => 5.3.7-MariaDB
Client API library version => 5.3.7-MariaDB
Client API header version => 5.1.61
Client API version => 5.3.7-MariaDB
just remain working without any changes (with minor regressions
maybe)?
You shouldn't have any issues as long as you replace with the same version. If you're currently are using MySQL 5.1, you can replace with MariaDB 5.1. If you are using 5.5, use the corresponding one. MariaDB v5.2 and v5.3 and enhanced versions of 5.1.
Or will I have to replace/reconfigure client drivers (like use another
JDBC driver class and connection string)?
You shouldn't. MySQL and MariaDB both use the same protocol and overall syntax, but there could be a few exceptions in some cases. The URL quoted in another answer is a great resource: http://kb.askmonty.org/v/mariadb-versus-mysql
Regarding the drivers' licenses, there are differences if you plan to distribute your project commercially. In that case I recommend you to double check the license terms and if you have any concerns, use the MariaDB/SkySQL versions of the connectors as suggested in another answer. Check http://www.skysql.com/downloads/java-cc-connectors-mariadb for details.
Or will I have even to change application code?
The application code should be unchanged.
Just a little feedback requarding the compatibility with mysql driver/CodeIgniter. I ran into the problems on BIT attributes types few minutes ago.
Value was not retrived from the server. It was always empty.
I was using standard CI database configuration which is using "mysql" driver.
After changing driver in the database.php to "mysqli" problem was solved.
Just the heads up that there can be some differences if you are using old mysql driver.
$db['default']['dbdriver'] = 'mysqli';
MariaDB client API version 5.5.40
MariaDB is MySQL evolved.
It is also the same developer who is behind MySQL and MariaDB. It is almost the same (if it is not, i can only say MariaDB is MySQL improved, dot).
You don't have to change nothing in your PHP.
Contrary to popular belief, the default Connector/J JDBC driver for connecting to and interacting with MySQL in Java does not play nicely with MariaDB. To work with MariaDB, you need to have your application use the Drizzle or SkySQL driver.
http://kb.askmonty.org/en/mariadb-faq-is-there-any-java-connector-for-mariadb-than-the-one-from-mysql