how to install pdo sqlite drivers to enable onserver support
Assuming I understand the question, you want to know how to enable PDO SQLite access. Depending on the version of your PHP configuration, you may need to select different options, but assuming PHP 5.3.x, you should edit the php.ini to include the following libraries (for Windows - similar libs with different extension on *nix) in the extension=lib.dll (or extension=lib.so):
php_pdo.dll
php_pdo_sqlite.dll
php_sqlite.dll
This assumes they are available on your server and you can edit the PHP.ini config. If you cannot then you may have to ask your host provider to do this for you (which they may...).
SQLite Functions (PDO_SQLITE)
Introduction
PDO_SQLITE is a driver that implements the PHP Data Objects (PDO) interface to enable access to SQLite 3 databases.
http://www.php.net/manual/en/ref.pdo-sqlite.php
Related
HI we are using Adminer 4.3.1.
We choose system sqlite3 + localhost + location to DB file.
The error is not clear. I understood SQlite is supported. And I am directed to hardcoding functions to login. Don't I just need to use the form?
In short: how does one connect to a SQlite3 file using Admin?
Helpt appreciated ;)
I have the same issue, it does look like SQLite is broken in 4.3.1 because it is fixed in 4.3.2-dev, interestingly the login form has fewer options when SQLite is selected.
You can get the latest version by cloning the github repo and running adminer/sqlite.php
Is it possible to add Presto interpreter to Zeppelin on AWS EMR 4.3 and if so, could someone please post the instructions? I have Presto-Sandbox and Zeppelin-Sandbox running on EMR.
There's no official Presto interpreter for Zeppelin, and the conclusion of the Jira ticket raised is that it's not necessary because you can just use the jdbc interpreter
https://issues.apache.org/jira/browse/ZEPPELIN-27
I'm running a later EMR with presto & zeppelin, and the default set of interpreters doesn't include jdbc, but it can be installed using a ssh to the master node and running
sudo /usr/lib/zeppelin/bin/install-interpreter.sh --name jdbc
Even better is to use that as a bootstrap script.
Then you can add a new interpreter in Zeppelin.
Click the login-name drop down in the top right of Zeppelin
Click Interpreter
Click +Create
Give it a name like presto, meaning you need to use %presto as a directive on the first line of a paragraph in zeppelin, or set it as the default interpreter.
The settings you need here are:
default.driver com.facebook.presto.jdbc.PrestoDriver
default.url jdbc:presto://<YOUR EMR CLUSTER MASTER DNS>:8889
default.user hadoop
Note there's no password provided because the EMR environment should be using IAM roles, and ppk keys etc for authentication.
You will also need a Dependency for the presto JDBC driver jar. There's multiple ways to add dependencies in Zeppelin, but one easy way is via a maven groupid:artifactid:version reference in the interpreter settings under Dependencies
e.g.
under artifact
com.facebook.presto:presto-jdbc:0.170
Note the version 0.170 corresponds to the version of Presto currently deployed on EMR, which will change in the future. You can see in the AWS EMR settings which version is being deployed to your cluster.
You can also get Zeppelin to connect directly to a catalog, or a catalog & schema by appending them to the default.url setting
As per the Presto docs for the JDBC driver
https://prestodb.io/docs/current/installation/jdbc.html
e.g. As an example, using Presto with a hive metastore with a database called datakeep
jdbc:presto://<YOUR EMR CLUSTER MASTER DNS>:8889/hive
OR
jdbc:presto://<YOUR EMR CLUSTER MASTER DNS>:8889/hive/datakeep
UPDATE Feb 2018
EMR 5.11.1 is using presto 0.187 and there is an issue in the way Zeppelin interpreter provides properties to the Presto Driver, causing an error something like Unrecognized connection property 'url'
Currently the only solutions appear to be using an older version in the artifact, or manually uploading a patched presto driver
See https://github.com/prestodb/presto/issues/9254 and https://issues.apache.org/jira/browse/ZEPPELIN-2891
In my case using an old reference to a driver (apparently must be older than 0.180) e.g. com.facebook.presto:presto-jdbc:0.179 did not work, and zeppelin gave me an error about can't download dependencies. Funny error but probably something to do with Zeppelin's local maven repo not containing this, not sure I gave up on that.
I can confirm that patching the driver works.
(Assuming you have java & maven installed)
Clone the presto github repo
Checkout the release tag e.g. git checkout 0.187
Make the edits as per that patch https://groups.google.com/group/presto-users/attach/1231343dbdd09/presto-jdbc.diff?part=0.1&authuser=0
Build the jar using mvn clean package
Copy the jar to the zeppelin machine somewhere zeppelin user has permission to read.
In the interpreter, under the Dependencies - Artifacts section, instead of a maven reference use the absolute path to that jar file.
There appears to be an issue passing the user to the presto driver, so just add it to the "default.url" jdbc connection string as a url parameter, e.g.
jdbc:presto://<YOUR EMR CLUSTER MASTER DNS>:8889?user=hadoop
Up and running. Meanwhile, it might be worth considering Athena as an alternative to Presto give it's serverless & is effectively just a fork of Presto. It does have limitation to External hive tables only, and they must be created in Athena's own catalog (or now in AWS Glue catalog, also restricted to External tables).
Chris Kang has a good post on doing that in spark-shell, http://theckang.com/2016/spark-with-presto/. I don't see you wouldn't be able to do that in Zeppelin. Another helpful post is making sure you have the right Java version in EMR, http://queirozf.com/entries/update-java-to-jdk-8-on-amazon-elastic-mapreduce. The current Presto version as of writing only runs on Java 8. I hope it sets you in the right direction.
I have one problem with Doctrine (or with my server configuration, I don't know where is the problem) in my Symfony2 web. I have been looking for an answer since several days but I haven't found it yet.
I need to connect my symfony web to a remote Microsoft SQL database through Doctrine. For this reason, I have added the "database_driver: pdo_sqlsrv" param in app/config/parameters.yml, but when I try to execute (in my Mac) a command like:
php bin/console doctrine:database:create
or
php bin/console doctrine:generate:entities AppBundle/Entity/Product
I get the following error:
[Doctrine\DBAL\Driver\PDOException] could not find driver
[PDOException] could not find driver
I have checked the phpinfo and the driver doesn't appear (only mysql, sqlite). I don't know if it's possible to add MSSQL, because in Microsoft SQL Server Functions (PDO_SQLSRV) appears that it needs to be running on a Windows.
Is not possible to access a mssql database without Windows? (If yes, how can I do it).
Would I need a Windows hosting?
Thanks in advance.
I'm using sql server on my last project.
here is what i've done to make it work on my dev environment
install pdo-dblib
composer require leaseweb/doctrine-pdo-dblib
configure doctrine to use the driver_class from the lib above instead of refering the sql_serv driver
driver_class: Lsw\DoctrinePdoDblib\Doctrine\DBAL\Driver\PDODblib\Driver
I was installing the symfony2 CMF using composer and I noticed that the default PDO handler for it is set to sqlite. I'm just curious if there's any reason behind it that related to performance or the symfony team just don't feel like using mysql for CMF.
the cmf sandbox is using sqlite only because this is the most simple thing to setup. for a production system with jackalope-doctrine-dbal, i would rather use mysql or postgres.
if you want optimal performance, your best option is jackalope-jackrabbit and installing the jackrabbit java server. for a production environment, you should install jackrabbit with tomcat. there is a tutorial in the jackalope wiki: https://github.com/jackalope/jackalope/wiki/Running-jackrabbit-in-tomcat-with-mysql
And if you still prefer MySql, use the defaults but change
database_driver: pdo_mysql
database_path: null
I use Netbeans IDE (6.5) and I have a SQLite 2.x database. I installed a JDBC SQLite driver from zentus.com and added a new driver in Nebeans services panel. Then tried to connect to my database file from Services > Databases using this URL for my database:
jdbc:sqlite:/home/farzad/netbeans/myproject/mydb.sqlite
but it fails to connect. I get this exception:
org.netbeans.modules.db.dataview.meta.DBException: Unable to Connect to database : DatabaseConnection[name='jdbc:sqlite://home/farzad/netbeans/myproject/mydb.sqlite [ on session]']
at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.initialDataLoad(SQLExecutionHelper.java:103)
at org.netbeans.modules.db.dataview.output.DataView.create(DataView.java:101)
at org.netbeans.modules.db.dataview.api.DataView.create(DataView.java:71)
at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:105)
at org.netbeans.modules.db.sql.loader.SQLEditorSupport$SQLExecutor.run(SQLEditorSupport.java:480)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
What should I do? :(
The current version of Zentus SQLiteJDBC is v053, based on SQLite 3.6.1. It will not open a 2.x SQLite database. Perhaps you can use SQLite 2.x command line tool to .dump your database, and the Sqlite3 command line tool to .load it. The use Zentus SQLiteJDBC to access the new SQLite 3.x database.
Alternatively, use a JDBC driver that supports SQLite 2 such as this one.
It's againg me...
I have made two mistakes during my first attempt. After setting CLASSPATH as a system variable (hope I didn’t broke smth else :)), putting sqlite_jni.dll to the system32 folder and correcting JDBC url I have got a success :)
I also have downloaded their SQLite ODBC wrapper. Installed it and made a connection to my SQLite2 database via ordinary and UTF8 based ODBC driver. I also used built in NetBeans JDBC-ODBC Bridge driver to be able to set up this connection.
All three connections have been created but:
ordinary ODBC driver: I see text data in a wrong encoding. All other columns are displayed correctly
UTF8 ODBC driver: I don’t see text data at all. All other columns are displayed correctly
JDBC driver: I don’t see any column at all. "Select * from my_any_table" always returns an empty single column
I have Russian based data in my database.
So...currently I have returned to sqlite command line interface :))