Updated MySQL Installation

Download Report

Transcript Updated MySQL Installation

Updated MySQL
Installation
Tarik Booker
CS 122
NOTE: This is an UPDATED install given from the one included in the lecture!!
MySQL Install Requirements

You still need to bring a USB drive to class. Count on needing at least 2GB
(gigabytes) of space on your drive, so bring a drive that has AT LEAST THAT!!!

It’s permissible to use the older (MySQL 5.5) version, but the latest and greatest
MySQL Version (5.6.21) requires a 350MB download (remember, the ZIP Archive,
not the MSI Installer!)
Downloading MySQL

Go to http://www.mysql.com/

Click on the “Downloads” Tab

Click “Community” below that

Select the MySQL Community Server

Scroll to the bottom, and there will be some links to various installs.

Get the ZIP Archive!!!

Use 32 or 64-bit depending on your computer.

If you don’t know, choose 32-bit

Note: These are ~350MB files
Choose:
Installing MySQL

After downloading the file, it should be a zip file of one of the two versions.


mysql-5.6.21-winXX.zip (the XX’s either 32 or 64)
Extract using WinZIP (or some other program) and choose a place (on the USB
drive) to extract it. It should extract to the folder “mysql-5.6.21-winXX”
Using MySQL

Open the Windows Command Line Console (cmd.exe)

Use the cd command to navigate to the mysql-5.6.21-winXX folder


Type in the following to start the database server:


Then use cd to go to the mysql-5.6.21-winXX/bin directory
start mysqld
Then type in the following to start
the database client:

mysql –u root
Some MySQL Commands

Once MySQL has started and you see the mysql prompt:

At mysql>prompt type in: show databases;

At mysql>prompt type in: create database lyric;

At mysql>prompt type in: use lyric;

At mysql>prompt type in: show tables;

You shouldn’t see any yet!

Don’t forget the semicolons!
Adding Data to a Database

Now that the database is selected, let’s load a database script

At mysql>prompt type in: source [path] lyric.sql;

Where [path] stands for the path to the location where you saved lyric.sql

If you put lyric.sql in mysql’s bin directory, all you will have to type is source
lyric.sql;

You should see a bunch of messages like this:

Query OK, 1 rows affected (0.01 sec).
Verifying the Lyric Database

To check if everything is set up properly, type:
SELECT * FROM Salespeople;

The output should look like this:
Congratulations!!!!!!

If everything worked correctly, you should get the same results!

If you plan on using your own laptop during the lab, bring it in during the labs
(and the Tuesday meeting 9/30)


Keep in mind that you will need a USB drive during the midterm and final!
If you plan on using MySQL on a lab computer bring a USB flash drive (of at
least 2GB space) to the labs (as well as the Tuesday meeting 9/30)