ways to manage db in mysql cs346. six ways to create and insert into tables...

16
Ways to manage DB in MySQL cs346

Upload: magdalen-garrett

Post on 12-Jan-2016

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

Ways to manage DB in MySQL

cs346

Page 2: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

Six ways to CREATE and INSERT INTO tables

Mode local remote local remote window window

Where Mysql console

Putty; Mysql console

Mysql console

Putty; Mysql console

WAMP server icon

Link

command CREATE,INSERT

CREATE, INSERT

Source script; or redirection

Source script; or redirection

http://141.233.176.1/phpmyadmin/

Interactive Batch phpMyAdmin

Page 3: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

1. Local MySQL Console

• Select WAMPSERVER icon• Select MySQL >MySQL Console

Page 4: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql
Page 5: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

At the prompt for password, just press return (since I was never asked to enter a password on installation of WAMP on my laptop)

Page 6: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

Now you are at the MySQL Console and may enter MySQL commands/queries

Page 7: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql
Page 8: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

2. Remotely via putty to cs346 Linux server

login as: studentUbuntu [email protected]'s password: System information as of Thu Nov 18 16:00:01 CST 2010 System load: 0.0 Memory usage: 13% Processes: 98 Usage of /: 1.3% of 223.56GB Swap usage: 0% Users logged in: 0 Graph this data and manage this system at https://landscape.canonical.com/ 20 packages can be updated.16 updates are security updates. Last login: Wed Nov 17 19:05:07 2010 from h216-170-137-127.applwi.dedicated.stat ic.tds.net System information as of Thu Nov 18 16:00:01 CST 2010

Page 9: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

System load: 0.0 Memory usage: 13% Processes: 98 Usage of /: 1.3% of 223.56GB Swap usage: 0% Users logged in: 0 Graph this data and manage this system at https://landscape.canonical.com/ 20 packages can be updated.16 updates are security updates. student@CS346:~$ /* Now you are in Linux */

student@CS346:~$ mysql -u student -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 235Server version: 5.0.75-0ubuntu10.3 (Ubuntu) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. Mysql>

/* Now you are in MySQL Console remotely */

Page 10: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || student |+--------------------+2 rows in set (0.00 sec) mysql> use student;

Page 11: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

3. and 4. Batch

• See Lab10 instructions on the “source” command;

• See the slide “Upload_install_bookorama_tables_to_student_cs346_Linux.doc” on Linux redirection

Page 12: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

5. phpMyAdmin on localhost

• Click WAMPSERVER icon• Select phpMyAdmin• A browser window opens with the location:http://localhost/phpmyadmin/

Page 13: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql
Page 14: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

6. phpMyAdmin on cs346 WAMP 141.233.176.1

• On a browser window, type inhttp://141.233.176.1/phpmyadmin/• An authentication pop-up appears for

username and password at the cs346 WAMP server

Page 15: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql
Page 16: Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql

phpMyAdmin

• The GUI gives you a way to– SELECT * FROM tablename;– CREATE TABLE– DROP TABLE– etc.