Get data from Amazon redshift in web2py - database-connection

How do I connect Amazon-redshift database with Web2Py. I tried connecting using Postgres connection strings as Amazon-redshift is based on Postgres.
postgres://username:password#examplecluster..us-west redshift.amazonaws.com/dbname
This is not working.

Related

The difference between MySQL Workbench and MySQL client

I have installed both MySQL Workbench and MySQL client console (Using Ubuntu WSL).
When I tried to connect to MySQL Server and query.
The MySQL Workbench returns typically but the MySQL client returns with errors:
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 56993
Current database: *** NONE ***
I don't know the difference between the 2 versions. How can I config MySQL client to Query regularly like MySQL Workbench?
NOTE: It's the same issue when I use mysql-connector-python.

Connect Cloud SQL MySQL From Local MySQL Workbench - Connection Success but cannot connect database server

I am using Cloud SQL for the last 2 months. I whitelisted my Office IP in Connection. I was using it fine for the last 2 months.
Yesterday I add another Node Pool in the GKE cluster. (I don't think it's relevant with cloud SQL but still informing) After that, I can't able to connect it from my office PC by MySQL Workbench. Test Connection is a success but after it shows a different message.
Our Application is fine because we were using Cloud SQL proxy.
I remove and add again Office IP in the Cloud SQL connection. But the same problem remains.
After restarting the Google Cloud SQL MySQL instance then my problem was solved.

Reading MS Access database in windows with ruby from mac

I have a rails application running on mac and an MS Access database located on windows server PC which data are changing daily.
Both may mac and windows PC are in the same network and also I have permission to connect to server remotely by telnet.
How may I just read data from my mac using ruby to publish it?
In database.yml, you should configure the db parameter, like adapter, host, port, username, password. I am not sure if there is Access DB adapter for Rails. And then, you can create your models corresponding to the DB tables. Please refer to this
I did the almost same thing, except I use Sqlite tables in local host and PSQL tables in remote server in development. Ater you finish the configure and models creation, you can use the model as normal, almost no any difference.

Deploy rails app on dotcloud

I'm trying to deploy a ruby on rails app to dotcloud. The app is deployed but when I try to access the url, I get this error:
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? (PG::Error)
I'm using a postgresql database. What all changes do I need to make in the database.yml file?
I've also followed the steps outlined here:
http://docs.dotcloud.com/services/postgresql/
Can anyone please help on this?
It looks like your app is configured to use a local PostgreSQL database (local as in "running on the same machine"). You should make sure that your dotcloud.yml file contains a section for a PosgreSQL database, e.g.:
db:
type: postgresql
Then use either dotcloud info to retrieve the host, port, and credentials of the database, or parse them from environment.json in your Ruby app.
This last step is explained in the dotCloud PostgreSQL service documentation.

Use Heroku DB into Engine Yard

I am using postgresql database for my Heroku Application.
I have very large database on AmazonAws as heroku not providing the Postgresql Database.
Now my client want to switch to EngineYard from Heroku.
Can i use same database (w/o taking backup and then reload) for my application on the EngineYard?
If YES
How can i use or steps for using the Existing AmazonAws Database with the new EngineYard Application.
You can, but only if you are using a dedicated database. From the Heroku database FAQ
Shared Database
No, connecting to your database from machines outside of Heroku is not
supported. We recommend that you encapsulate data access in an API to
manipulate it.
Dedicated Database
It's possible to connect to our dedicated databases using our
pg:ingress feature. Please see using the PG console for more
information.
The database connection string is available in the DATABASE_URL config. You can run
$ heroku config --long
to view it. However, it won't probably work if you use a shared database because it seems connection is restricted to the Heroku net.
Surely this is just a case of getting the correct connection credentials for the DB regardless of where it's hosted?
For instance, if the DB is on Heroku, then ENV['DATABASE_URL'] give you everything you need. All these details then go in your database.yml as normal (assuming you're using ActiveRecord)
For the record, Heroku do provide Postgres and it's part of their core business.

Resources