QuestionQuestion

1) Install the correct version (Windows vs. Mac vs. Linux) of MySQL

2) Make sure it works. Here is an example of commands to try. Mac users: Use Terminal under Applications/Utilities. Windows users: Use the command prompt.

Unix commands to find and start using MySQL:

cd /usr/local/mysql/bin
./mysql -u root -p

• When it asks for a password, just press Return. For older installations, by default, there is no password.
• The newest installation 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 that you are 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, and then 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 proof that you got it working.

After you have made sure it works, upload to a .txt or .pdf file something that shows you got it to work. Below is an example of showing this. You can grab screenshots, 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 databses[K[K[Kases ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+

3 rows in set (0.00 sec)

mysql> crdate[K[K[K[Keae[Kte databae[Kse 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$ x[Kexit exit

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

mysql> create database test;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql             |
| performance_schema |
| sakila             |
| sys                |
| test               |
| world             |
+--------------------+
7 rows in set (0.00 sec)...

By purchasing this solution you'll be able to access the following files:
Solution.docx.

50% discount

Hours
Minutes
Seconds
$28.00 $14.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Computer Science - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats