The Ultimate Connection Guide

Database systems course - Tel Aviv University

Important Stuff

TAU's MySQL name/port:                             mysqlsrv.cs.tau.ac.il

Sakila schema username/password:              sakila/sakila

 

Database connecting in general

In order to connect to a database you have mainly two options:

  1. Connecting to a MySQL Database you have installed on your home computer
  2. Connect to the MySQL Database already installed in TAU Computer Sciences Labs.

 

 

You can connect to both databases using various database clients, such as MySQL (command line) and MySQL Workbench, that can be installed on your home computer as well.

 

In the next sections we will describe some of the connection options with the various tools. For these descriptions we will be using the following details:

 

Connection option

User

Password

Host

Port

Comments (don’t forget to…)

From home client to home database

Your user

Your password

Localhost (default)

3306 (default)

1.     Install MySQL database

2.     Install MySQL workbench

Connect from home client to TAU database

Your TAU user

Your TAU password

Localhost

3305

(defined by ssh)

1.      Download Putty

2.      Create TAU database account

3.      Build SSH tunnel

Connect from TAU lab to TAU database

Your TAU user

Your TAU password

mysqlsrv.cs.tau.ac.il

3306 (default)

1.      Create TAU database account

 

Creating TAU database account

Each user can open her own account (schema). Just follow the instructions in the following link:

http://www.cs.tau.ac.il/system/faq/development/databases/mysql1

 

Note that the initial password will be sent to you by mail. To change it:

-        Run the MySQL app:
http://www.cs.tau.ac.il/system/faq/development/databases/mysql2
(the database name is the username…)

-        Change the password:
http://www.cs.tau.ac.il/system/faq/development/databases/mysql3

 

 

Download links

Download MySQL:

http://www.mysql.com/downloads/mysql/

 

Download MySQL Workbench:

http://www.mysql.com/downloads/workbench/

 

Download Putty:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

 

 

Setting up an SSH Tunnel

 

The idea behind creating a tunnel is that your client would ‘think’ that the server is at localhost:3305, but the tunnel established from your machine (localhost) to nova.cs.tau.ac.il would redirect the requests to mysqlsrv.cs.tau.ac.il:3306

 

How to do that?

Run the latest version of Putty (note that old versions might not connect, so download the latest - this was done with 0.60) .

 

Set it to point to Nova (nova.cs.tau.ac.il on port 22) by ssh

 

 

 

We now define the tunnel:

Select “Connection à SSH à Tunnels” from the category tree.

Enter the following:
Source port: 3305 (or something else you want..)
Destination: mysqlsrv.cs.tau.ac.il:3306

 

 

Now hit the “Add” button. Your screen should look something like this:

 

 

 

Now let’s just save the settings.. Go back to “Session” category, and your preferred name (in the picture “TAU - MySQL Tunneling”) and click save.

 

 

That’s it! Don’t forget to actual connect to nova by entering your unix username and password..

 

 

 

The following image is for using MySQL Workbench with the tunnel: