virtualbox and mysql

14
>_ Things Lab VirtualBox ...and the standard installation for Things Lab meetings

Upload: luca-pescatore

Post on 08-May-2015

249 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Virtualbox and Mysql

>_ Things Lab

VirtualBox...and the standard installation for

Things Lab meetings

Page 2: Virtualbox and Mysql

Virtualization

● Running multiple operating systems simultaneously● Easier software installations● Testing and disaster recovery.● Easy to make Snapshot● Infrastructure consolidation

Page 3: Virtualbox and Mysql

Why Virtualbox?

● Multi-platform (binaries for Win, OSX and Linux)● Open Source (Base packages under GNU GPL V2)● Great hardware support● Guest multiprocessing (up to 32 virtual CPUs)● USB device support● Multiscreen resolutions● Built-in iSCSI support● PXE Network boot● Multigeneration branched snapshots● Virtual Machine groups● Remote machine display

Page 4: Virtualbox and Mysql

Virtualbox running a Guest OS

Page 5: Virtualbox and Mysql

Why Raspberry Pi image?

● Multi platform● Light (few resources needed)● Standard installation● Linux based● Open Source● Runs on SBC hardware like Raspberry Pi and Olimex Lime

Page 6: Virtualbox and Mysql

Download the image

http://www.ediy.com.my/Downloads/Raspberry%20Pi/RaspberryPi.VirtualBox.zip

Unzip and open with a torrent client

Page 7: Virtualbox and Mysql

Import the Appliance

Click on File>Import Appliance...

Page 8: Virtualbox and Mysql

Installation of the ApplianceChoose the RaspberryPi.ova image and click on import button.

Page 9: Virtualbox and Mysql

Run the installed ImageStart the image, use rpi as login and password as password (also for sudo command)

Page 10: Virtualbox and Mysql

First instructionsThe standard syntax is:sudo command [parameters] [| more]

Update the image to the last packagessudo apt-get update

Search for the MySQL Daemon (Server)sudo apt-cache search mysql-server | more

Install a Daemon (Server)sudo apt-get install package-name

Page 11: Virtualbox and Mysql

Install the MySQL DaemonInstall the MySQL Daemon (Server)sudo apt-get install mysql-server-5.1

You should choose a password for the db admin (the user is root), we used the default password of the image.

Page 12: Virtualbox and Mysql

Use MySQL from command lineConnect to the MySQL daemonmysql -u root -p (a password for the user will be requested)

Quit from MySQL command line interfacequit;

Show all the databases ● show databases; (from the command line of mysql)

Page 13: Virtualbox and Mysql

Create a databaseCreate a databasecreate database test;

Connect to a databaseuse test;

Create a table with two fieldsCREATE TABLE pets (name VARCHAR(20), owner VARCHAR(20) );

Display the tables in the database (we created only test)show tables;

Remove a tabledrop table pets;

Page 14: Virtualbox and Mysql

Populate a tableInsert two records in a tableinsert into pets (name, owner) values ('pluto', 'this is a test');insert into pets (name, owner) values ('nacho', 'abc');

Display records from a tableselect name, owner from pets where owner = 'abc';select * from pets; (really bad for performance!!)

Delete a single record or all the records from the tabledelete owner from pets where name = 'nacho';delete from pets; (pay attention, you delete all the records!!)