DUE 10AM, January 12 20 Points Do the following and then upload a .pdf file in Canvas. See the "Content" area on this course's Canvas page for where to upload. 1) Install the correct version (windows vs mac vs linux) of mysql: http://dev.mysql.com/downloads/mysql/ 2) Make sure it works. Here is an example of commands to try: -> unix commands to find and start using mysql -> Mac users: use "terminal" under Applications/Utilities -> windows users: use the command prompt cd /usr/local/mysql/bin ./mysql -u root -p -> when it asks for a password just hit return, for older installations by default there is no password, for -> the newest installation it sets a root password, you should see a prompt during the installation, note/record this password. -> You may want to change the root password like this (which changes the root password to "ilovesql": ALTER USER 'root'@'localhost' IDENTIFIED BY 'ilovesql' ; -> Now inside of mysql see what databases exist, create one, then connect to it -> with the "use" command: show databases ; create database test ; show databases ; use test ; -> now that we are connected to "test", see what tables exist (none), create -> a table, use the "describe" command to see its properties, insert some data, -> select some data show tables ; create table students (id int primary key, name varchar(20) not null, age int) ; show tables ; describe students ; insert into students values( "1", "Bob", "18") ; insert into students values("2", "Bob", "19") ; insert into students values("3", "Bob",NULL) ; select * from students ; insert into students values("3", "Sue", 20) ; insert into students values("4", NULL, 21) ; 3) Upload to Canvas proof that you got it working: Once you have made sure it works, upload to Canvas a .txt or .pdf file that shows you got it to work. Below is an example of me showing the above. You can grab screen shots, cut-and-paste, or use the unix command "script" which creates a file called "typescript" that shows a log of what you typed in and the responses you received. Note, to exit "script" just type "exit". ---------- Example typescript file from the above commands Script started on Sun Jan 12 09:50:17 2014 [?1034hbash-3.2$ tcsh [61] cd /usr/local/mysql/bin [62] ./mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 126299 Server version: 5.6.15 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databsesases ; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec) mysql> crdateeaete databaese test ; Query OK, 1 row affected (0.01 sec) mysql> show databases ; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec) mysql> use test ; Database changed mysql> show tables ; Empty set (0.00 sec) mysql> create table students (id int primary key, name varchar(20) not null, age int) ; Query OK, 0 rows affected (0.02 sec) mysql> show tables ; +----------------+ | Tables_in_test | +----------------+ | students | +----------------+ 1 row in set (0.00 sec) mysql> describe students ; +-------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+-------+ | id | int(11) | NO | PRI | NULL | | | name | varchar(20) | NO | | NULL | | | age | int(11) | YES | | NULL | | +-------+-------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) mysql> insert into students values( "1", "Bob", "18") ; Query OK, 1 row affected (0.01 sec) mysql> insert into students values("2", "Bob", "19") ; Query OK, 1 row affected (0.00 sec) mysql> insert into students values("3", "Bob",NULL) ; Query OK, 1 row affected (0.00 sec) mysql> select * from students ; +----+------+------+ | id | name | age | +----+------+------+ | 1 | Bob | 18 | | 2 | Bob | 19 | | 3 | Bob | NULL | +----+------+------+ 3 rows in set (0.00 sec) mysql> insert into students values("3", "Sue", 20) ; ERROR 1062 (23000): Duplicate entry '3' for key 'PRIMARY' mysql> insert into students values("4", NULL, 21) ; ERROR 1048 (23000): Column 'name' cannot be null mysql> quit ; Bye [63] exit exit bash-3.2$ xexit exit Script done on Sun Jan 12 09:52:49 2014