Relational Databases

From Gridkaschool
Revision as of 20:09, 1 September 2014 by Mlassnig (talk | contribs) (→‎Session 1)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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