What tools do you use to connect to AWS Athena via JDBC - mysql

I am trying to connect to AWS Athena via my Windows as well as Mac system. My goal is to have a SQL Editor that I can use to perform quick research about the data. I was trying to find tools and tutorials for connecting to Athena. So far I have only found some tutorials around SQL Workbench. What are some other tools that you guys leverage and is there something particular that you like about that tool and how easy was it to setup either on Windows/Mac.

I use SQuirreL SQL for connecting to Athena. It has served the purpose so far. Once you import the JDBC drivers(you can download them from AWS's site) the tool itself is pretty straight forward to setup. The URL that you can use to connect can be seen here -
jdbc:awsathena://AwsRegion=<AWS Region>;User=<AWS Access Key>;Password=<AWS Secret Key>;S3OutputLocation=<S3 folder>
I'm pasting the "Overview" of SQuirreL below:
SQuirreL SQL Client is a graphical Java program that will allow you to
view the structure of a JDBC compliant database, browse the data in
tables, issue SQL commands etc, see Introduction. The minimum version
of Java supported is 1.6.x as of SQuirreL version 3.0. See the Old
Versions page for versions of SQuirreL that will work with older
versions of Java.
SQuirreL's functionality can be extended through the use of plugins.
A short introduction can be found here. To see the change history
(including changes not yet released) click here.
For a more detailed introduction see the English or German of our
paper on SQuirreL.
Susan Cline graciously took the time to document the steps she
followed to setup an Apache Derby database from scratch and use the
SQuirreL SQL Client to explore it.
Quite some time ago Kulvir Singh Bhogal wrote a great tutorial on
SQuirreL and published it at the IBM developerWorks site. He has
kindly allowed us to mirror it locally. The tutorial is not really up
to date but especially for doing the first steps it is still of help.
SQuirrel was originally released under the GNU General Public License.
Since version 1.1beta2 it has been released under the GNU Lesser
General Public License.
Another tool that I have used pretty extensively is SQL Workbench. This is also sort of recommended on the AWS site. The is good, but I found that it would hang up sometimes and I would loose my work.
Both of these can be easily downloaded from the links provided or if you like to use CLI then Homebrew can be used on MacBook or Chocolatey on windows
Some other tools that you can use are DataGrip by JetBrains. Guide to setup the tool can be seen here. The functionality of DataGrip is also built into IntelliJ Ultimate Edition.
DB Visualizer is another tool that can be used to connect to AWS Athena the guide to connect can be found here
TeamSQL and Razor SQL are some other tools that you can leverage.

One of the strengths of JDBC drivers is that as long as a tool supports JDBC, you can use it for any data source which has a JDBC driver. First, get the JAR file for the JDBC driver for Athena here: Amazon Athena Connect with JDBC. Java works across platforms, so as long as you have Java in your Windows/Mac environment, you should have no problem using any of these tools.
The tool SQL Workbench/J is fairly popular, but I find it frustrating to work with when switching between multiple databases.
Another tool is Squirrel SQL, which also supports JDBC drivers. I prefer it, but it looks a little less pretty than SQL Workbench/J. Once you've downloaded the JDBC driver, configure it in SquirrelSQL by going to Drivers and then adding a new one. Label it "Amazon Athena" and specify the Example URL as jdbc:awsathena://AwsRegion=[Region];User=
[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];
[Property1]=[Value1];[Property2]=[Value2];...
Leave the Website URL Blank, but specify the Class Name as com.simba.athena.jdbc.Driver. Add the .jar file of the JDBC driver to the "Extra Class Path" page.
Once you've set up the driver, you can set up connections by going to the Alias tab and hitting the plus sign. Simply fill in the values in the example URL to point to your data source. Once you're connected, you're good to start writing queries.
SquirrelSQL saves the connection information for you, allowing you to quickly jump between data sources, and makes it easy to write multiple queries in one input window, with their outputs going to separate tabs in the output pane. I've used it for database, exploration, DDL, and regular day-to-day tasks with data. It's been good for most anything I've connected it to. It is definitely not perfect, but it's getting better all the time.

I guess you need a Docker SQL Editor that you can use to perform quick research about the data.
But I suggest two ways.
One is Offline/Online and with installation methods, which you can use with a fixed connection.
The first solution is to select a system as a server and connect to it from other operating systems. This is the traditional / old solution.
In the second solution you just need to be trained to work with Docker. This is a newer and more popular solution.
if you want use MySQL in MAC read this article :
Installing MySQL in a Mac OS X environment
If you want use MySQL in windows read this article :
How to Install MySQL on Windows
But you need a synchronous space for use MySQL or other DBMS you can use docker.
Docker is very Flexible . But you need connect to internet.
If you want use Docker read this article and view docker site :
Docker : SITE
Docker Doc : Start a Remote MySQL Server with Docker quickly

Related

Why SQL Fiddle doesn't work during "Building schema" and "Run SQL" functions?

I'm practicing learning MySQL code with SQL Fiddle, it worked sometimes but now I get errors all the time when I use the "Build schema" or "Run SQL" functions.
After a while, the error printed is "Unable to get host connection: Connections could not be acquired from the underlying database!"
Anyone know how to solve the problem? Is there another tool I can use to do practice with queries to my schema?
Install your MariaDB or MySQL database server on your local machine. Install a decent native SQL client program. HeidiSQL is great on Windows. There are plenty for Mac. Any modern laptop computer (since about 2014) can handle a student- or developer- scale database server and client without breaking a sweat.
You can install phpmyadmin. But that's a php web app, so you also have to install a web server and php to get it working. Hence the suggestions for XAMPP or LAMP stack packages. I prefer the native clients; less to go wrong; less stuff in your laptop.
It's best to reserve the database fiddles for sharing SQL demos with other people. Like for Stack Overflow posts.

Connect to MySQL database from 4Dv12 or later version?

Can anybody help me in connecting my MySQL database from my 4D database application. I have tried but still could not find any help. Please note that i want it without ODBC and want to directly connect to my MYSQL db.
I have integrated MySQL with 4D without ODBC using this C compiled library
https://www.pluggers.nl/product-category/4d-plugins/
The price is WORTH EVERY PENNY. I used both their MySQL and PostgreSQL wrappers.
I talked to the developers, they have done just what you want. Provided a 4D component C library wrapper to target functionality of other databases.
It is VERY FAST.
If you decide to use the ODBC connector use this command to target a pre established ODBC connection on the machine.
http://doc.4d.com/4Dv15/4D/15/SQL-LOGIN.301-2007437.en.html
Also. ignore the connectivity API is for version 2004 and is not relevant to your question.
-James
What I read is that 4D doesn't do this without the API (additional price of $59), API details seen here.
Another option I found, be out date, is to write something yourself in the C compiler which can talk to MySQL directly.
You may connect via web service such as SOAPand REST.
You may also retrieve both data in and out via JASON.
Also, Since 4D now support PHP, you may build an APPLICATION in php that will do the migration or Synchronization.
But if you are looking for Direct Query, I don't know about the latest version of 4D, but as for 4Dv12 that would be bloody if you tried to build your own, since the simplest way is to do it is via ODBC.
Before, I tried to connect it via EXTERNAL PROCESS and SERIAL COM using .Net but it's just to risky, so i just Give up.

LAMP Server, MYSQL, PuTTy

I am connection to a LAMP Server trough PuTTY.
I have no idea if there is a GUI available so I'm doing this trough the CLI. The problem now is that I need certain fields from the database and I have no idea how the database looks since the lack of documentation.
How should I approach this. In the database there are 148 tables. Should I just go trough every table one at a time? Is there a smart way?
Thanks.
You could always install PHPMyAdmin, but if you don't have access to do so, you can try MySQL Workbench. This installs on your computer, and you just put in your server info and connect
There's plenty of GUI tools available for MySQL, some that you normally install on the server and others that you run on your desktop, here's a short list:
MySQL Workbench - Official mysql gui tool with really nice features (especially coming to db design)
PHPMyAdmin - web based interface, can be installed on the server and reached through a web interface.
HeidiSQL (free, windows) - desktop app
SQLYog (lot's of features, costs money) - desktop app
Sequel Pro (free, slim and good for macosx) - desktop app
You can also use the mysql-query browser for connect database.
Download link for window use : ->
http://downloads.mysql.com/archives/query/

Flash Application with local database (not sqlite, not air)

I would like to have a Flash Application (not air) to connect to a local database.
Air is not only getting unsupported by Adobe in LINUX but besides, it has serious problems and miss implementation with SQLite.
So we want to connect to a local MySQL database.
This application should be simple, so we do not want to also have an unnecessary web server (also local) to make a middle communication between the flash app and the MySQL server.
There is this driver that allow to communicate Flash with MySQL
http://code.google.com/p/assql/
Question is:
Is this the best approach?
Would it be any problem using this approach when installing the whole application to each client? (because we also in the installation should install a MySQL server).
A MySQL SERVER is called a SERVER for a reason: It is meant to be installed on servers, not on clients. So the answer to your question is:
1) No, this is not the best approach. Not even close. You would be better off using a SQLite database (however shitty you may think it is)
2) Yes. Nobody would like installing a MySQL server on their computers just for the sake of running your application. Think of casual (non-expert) users who would need to install and configure the server just for running your app. That is the very REASON why they developed SQLite and so many languages support it.
You should check out http://code.google.com/p/air-sqlite/ for sqlite access in AIR (I don't know if this is the same as the inbuilt code or not, so just check that out)

COCOA Objective-c : How can connect to mysql database?

I am creating application for MAC using cocoa framework, I would like to know how and what are the ways i can connect to MySql database using cocoa framework.
You might want to look into http://www.sequelpro.com/docs/Source_Code. They seem to have resurrected the original MySQL-Cocoa code and it seems to be under active development. The other option is the commercial MacSQL Framework.
Edit: You might also want to look at the following tutorial. It is a great introduction in using the libmysqlclient and even provides a sample Xcode project.
Short answer: You can't, at least not directly.
The Cocoa Framework doesn't have a database driver, generic or otherwise (CoreData notwithstanding). In order to connect to a mysql database you need to use the aptly named libmysqlclient. This library is not included with Xcode, and as such will have to be downloaded (and probably built) separately: You can get it from here.
You'll probably have to distribute the library with your application, license issues might result.
Edit: It seems as if a library for connecting to the mysql database should be installed together with a MySQL server install. If the application will only need to run on machines where MySQL is installed, you might get away with linking to this.