Relational Databases: Difference between revisions

From Gridkaschool
Jump to navigationJump to search
Line 3: Line 3:
ssh reldb@gks-virt(050-061).scc.kit.edu -p24
ssh reldb@gks-virt(050-061).scc.kit.edu -p24


== Session 1 ==
== Session 1 - Setup ==

$ mysql -u root
mysql> show databases;
mysql> create database playground;
mysql> show databases;
CTRL-D
$ sudo ls -la /var/lib/mysql/
$ sudo ls -la /var/lib/mysql/playground
$ sudo ls -la /var/lib/mysql/mysql
$ mysql -u root
mysql> use mysql;
mysql> show tables;
mysql> select * from user;
mysql> create user 'joffrey' identified by 'kings_landing';
mysql> create user 'joffrey'@'localhost' identified by 'kings_landing';
mysql> create user 'hodor' identified by 'hodor';
mysql> create user 'hodor'@'localhost' identified by 'hodor';
mysql> select * from user;
mysql> drop user 'joffrey';
mysql> drop user 'hodor';
mysql> select * from user;
CTRL-D
$ mysql -u hodor -p
mysql> use playground;
CTRL-D
$ mysql -u root
mysql> show grants;
mysql> grant all privileges on playground.* to 'joffrey'@'localhost';
CTRL-D
$ mysql -u joffrey
mysql> show grants;
CTRL-D

== Session 2 ==
== Session 2 ==
== Session 3 ==
== Session 3 ==

Revision as of 20:09, 1 September 2014

General information

ssh reldb@gks-virt(050-061).scc.kit.edu -p24

Session 1 - Setup

$ mysql -u root

mysql> show databases;

mysql> create database playground;

mysql> show databases;

CTRL-D

$ sudo ls -la /var/lib/mysql/

$ sudo ls -la /var/lib/mysql/playground

$ sudo ls -la /var/lib/mysql/mysql

$ mysql -u root

mysql> use mysql;

mysql> show tables;

mysql> select * from user;

mysql> create user 'joffrey' identified by 'kings_landing';

mysql> create user 'joffrey'@'localhost' identified by 'kings_landing';

mysql> create user 'hodor' identified by 'hodor';

mysql> create user 'hodor'@'localhost' identified by 'hodor';

mysql> select * from user;

mysql> drop user 'joffrey';

mysql> drop user 'hodor';

mysql> select * from user;

CTRL-D

$ mysql -u hodor -p

mysql> use playground;

CTRL-D

$ mysql -u root

mysql> show grants;

mysql> grant all privileges on playground.* to 'joffrey'@'localhost';

CTRL-D

$ mysql -u joffrey

mysql> show grants;

CTRL-D

Session 2

Session 3

Session 4

Session 5

Session 6