4 Pages

MySQL

Course: CS 40, Fall 2009
School: Furman
Rating:
 
 
 
 
 

Word Count: 1206

Document Preview

MySQL Basic Tutorial We begin our study of Web-based, data-driven applications using MySQL and PHP by looking first at the MySQL utility. MySQL is a relational database management system with many of the same features that we have explored in Access and Oracle thus far. Like Oracle, MySQL uses the client/server model. The server that we will be using resides on the departmental Enterprise Web server. We will be...

Register Now

Unformatted Document Excerpt

Coursehero >> South Carolina >> Furman >> CS 40

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
MySQL Basic Tutorial We begin our study of Web-based, data-driven applications using MySQL and PHP by looking first at the MySQL utility. MySQL is a relational database management system with many of the same features that we have explored in Access and Oracle thus far. Like Oracle, MySQL uses the client/server model. The server that we will be using resides on the departmental Enterprise Web server. We will be using two different clients to communicate with the server: the standard command-line client, running on the Ultras and accessed using secure telnet (Putty), and a Web-based interface called phpMyAdmin. Unlike Oracle and Access, MySQL is an open-source DBMS. That means (among other things) that it is freely distributed, its source code is freely available, and you use it at your own risk. You will find, however, that the documentation is actually quite good, and the system itself very reliable. 1. The command line interface Getting started The first step to using the standard MySQL client, which features a command-line interface much like weve seen with Oracle, is to connect to one of the Ultras using a secure shell (SSH) client. (Putty is provided for this in the lab, and is freely downloadable for your own computer.) From there youll connect to the MySQL server on the Enterprise Web server and change your password. a. Use Putty to connect to ultrax1.furman.edu using your ID and default password. (A demonstration will be given in lab if needed.) If you dont know these, go see Ted to get them. b. At the command line, enter the following to change your MySQL password (which is different from the password that you just used to log in): mysqladmin -h enterprise P 3828 -u <username> -p password <new password> The word password is a keyword in this command. You will be prompted for your current password, which is .reset.. c. Next, use your new password to connect to the MySQL server on Enterprise: mysql -h enterprise P 3828 -u <username> -p With this command you are specifying the host computer (enterprise) and the fact that you are using a password to log in. Enter the password that you just created when prompted. CS40: Database Management Systems page 2 d. Now you are connected to the MySQL server. What you have here is an interface similar to the Oracle SQL Worksheet that weve used previously. An additional command that you should try now is: mysql> show databases; This will show all of the databases that currently exist on the server. Make a note of yours. It is one of only two databases that youll be able to work with. (The other one is the test database, which is accessible to everyone.) Then run the command mysql> use <your DB name>; This selects your DB as the one to which all following commands will apply. e. Next lets import some data. Use FTP to copy the file BigHitSampleMySQL.txt (in the OUT folder) to your home directory on the Ultra server. Then run the following command in MySQL: mysql> source BigHitSampleMySQL.txt; Make sure that youve run the use command first. You might want to use WordPad or another editor to take a look at this file to see what youve just done. As you can see, it simply consists of SQL commands to create and populate several tables for the video store enterprise weve used as a case study in class. Note: As you will soon see, you could also have manually all typed of the SQL commands necessary to build the database in at the command line. However, it is much more convenient to import an external file like we did. This may be useful to you in the future. f. Use the following command to display all of your tables: mysql> show tables; and this one to show the schemas of a particular table: mysql> show columns from <tablename>; Performing queries Now that weve learned how to connect to the server, and weve constructed a database, the next step is to try some SQL queries. We wont spend too long on this, because the activity is pretty similar to what weve done previously with Oracle. a. Experiment with some video store queries. Use the schema handout from class and some of the queries from the class PowerPoint notes. Note which queries dont seem to work and see if you can figure out why. In some cases the syntax for MySQL will be slightly different from the Access or Oracle syntax. Another difference is that the CS40: Database Management Systems page 3 version of MySQL that we have installed doesnt support nested SELECT statements. Make whatever adjustments are necessary. b. Make up a query or two to try. Try to incorporate several different capabilities of the SELECT command. c. To quit the MySQL client, enter quit or exit. 2. The Web interface As mentioned previously, MySQL is an open source system. One of the many utilities that has been written by a MySQL user is a Web interface to the server called phpMyAdmin. Well use that next. a. Point your browser to the following address: http://cs.furman.edu/phpMyAdmin/ b. You will be prompted for a login ID and password. Your login ID is the same as your Ultra ID. (It doesnt have to be, but it has been set up that way.) Your password is the same as it is when you use the command line interface. (So it is still .reset. if you havent changed it.) c. Im not going to take a lot of time explaining this interface to you. Most of it should make sense by now. Click once on your database to select i...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Furman - SCU - 07
South Carolina United Participants 2007 2008Taylor Beard, Columbia, SC Nora Collins, Greenville, SC Corban Doran, Columbia, SC Rick Furman, Greenville, SC Terrell Glenn, Pawleys Island, SC DJ Harris, Simpsonville, SC Anna Leff, Charleston, SC Jame
Taylor IN - COS - 104
COS104 Exam IOctober 10, 20001. The term digital convergence refers to A) the merger of several industries, technologically through various devices that exchange information in the format used by computers. B) presentation of information with tec
Taylor IN - COS - 421
1PurposeThe purpose of this assignment is to learn some details about how the Linux kernel stores information about its running state. Since we don't know anything about the kernel organization at this point, we will use the /proc file system to
Taylor IN - CSE - 121
While Waiting Text is linear; it is black and white; it doesn't zoom around the page in 3-D; it isn't intelligent by itself; in fact, in terms of immediate reaction it is quite boring. I can't imagine a single preliterate was ever wowed at the first
Taylor IN - CSE - 121
While Waiting The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, s
Taylor IN - CSE - 280
AI-ish quotes while waiting Unless there are slaves to do the ugly, horrible, uninteresting work, culture and contemplation become almost impossible. Human slavery is wrong, insecure, and demoralizing. On mechanical slavery, on the slavery of the ma
Taylor IN - CSE - 121
While Waiting Who dares to teach must never cease to learn. - J.C. Dana Every now and then go away, have a little relaxation, for when you come back to your work your judgment will be surer. Go some distance away because then the work appears small
Taylor IN - CSE - 121
While Waiting The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand. - D. Jones To teach is to learn twice. - J. Joubert Computers are to computing as instruments are to music. Software is the
Taylor IN - CSE - 280
Lisp-ish quotes while waiting Lisp has jokingly been called &quot;the most intelligent way to misuse a computer&quot;. I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gift
Taylor IN - CSE - 331
1DescriptionThis project is to familiarize you with basic socket programming. In this assignment, you will create a client for the echo protocol. This protocol is sufficiently simple as to let you focus on how to create and manage network connect
Taylor IN - CSE - 121
While Waiting Learning is never done without errors and defeat. - V. Lenin If the only tool you have is a hammer, you tend to see every problem as a nail. Maslow Formal methods will never have a significant impact until they can be used by people
Taylor IN - COS - 342
Access Control Theory And MethodologyCOS342 Information Security Mon 14-Jan-2008Overview. Identification, Authentication, Authorization Security Modes Security Models Terminology Reference Monitor / TCB / Security Kern. Access Control Met
Taylor IN - CAPSTONE - 08
A flash tour of Taylor Universitys campus incorporating 3D modelsJason Graham Ladley Computer Science New Media, Taylor University, Upland IN, 46989IntroductionTaylor Universitys interactive campus tour is outdated and lacking functionality. Noti
Taylor IN - COS - 342
Security Overview: Balance in Information SecurityCOS342 Information Security Fri 04-Jan-2008An Example from Nehemiah. Neh. 4:6-14 Illustrates the balance of our responsibility and our ultimate dependence and acknowledgement of God.Security.
MNSU - CHM - 100
CHM 100 - Chemistry: Man &amp; Environment The World of Chemistry TAPE RESOURCE LISTwww.learner.org/resources/series61.htmlThesetapesareonreserveintheLibraryandmaybeviewedonaLibraryTV anytimeaTVisfree.ThesetapesarealsoavailableforcheckoutatsomeVa. Beac
MNSU - MATH - 153
Math153.02 Date: Exam 5 (Sections 6.6 - 7.2)Name: Score:1. Evaluate the expression without the aid of a calculator. a. arcsin 0 where the range is - , _ 2 2 3 where the range is [0, ] b. arctan - _ 3 3 where the range is - , c.
MNSU - PHY - 160
MNSU - BIO - 261
NAMENorfolk State University Norfolk, Virginia General BotanyA. Multiple Choices. Choosethe bestans\ver.1. The cell cycle . a. Is completed in all cells before death b. Consists of repeatingprocess of cellular growth and division c. Is completed
MNSU - CSC - 361
Chapter 16Logic Programming LanguagesISBN 0-321-33025-0Chapter 16 Topics Introduction A Brief Introduction to Predicate Calculus Predicate Calculus and Proving Theorems An Overview of Logic Programming The Origins of Prolog The Basic E
MNSU - NUR - 150
Chapter 44 Urinary EliminationMosby items and derived items 2005 by Mosby, Inc.Urinary System Kidneys Ureters Bladder Urethra Act of urinationMosby items and derived items 2005 by Mosby, Inc.Factors Influencing Urination Disease co
MNSU - MATH - 153
Digital LessonExponential Functions and Their GraphsThe exponential function f with base a is defined by f(x) = ax where a &gt; 0, a 1, and x is any real number. For instance, f(x) = 3x and g(x) = 0.5x are exponential functions.Copyright by Houg
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
MNSU - NUR - 362
Maryland - PHYS - 171
Homework #3 Due Friday, Feb. 11 1. (a) A spring scale is attached to a 50 g weight by a string, and is held at rest by a string, as shown below.The spring scale weighs 10 g. The reading on the spring scale is 50 g, just as it should be. What is the
MNSU - HSM - 300
Answers to Sample Quiz (chapters 1-6) 1. b 2. c 3. b 4. c 5. a 6. c 7. d 8. a 9. c 10. b 11. a 12. b 13. c 14. c 15. d 16. c 17. b 18. a 19. d 20. c 21. d 22. a 23. c 24. b 25. a 26. d 27. b 28. a 29. c 30. a 31. c 32. b 33. b 34. b 35. d1
MNSU - CSC - 435
Lecture 8 Security in Networks (cont.)Network segmentation This protects some vital functions in case some other functions are compromisedFigure 7-20 Segmented Architecture.Encryption Link Encryption Encryption is provided just before it is
MNSU - CSC - 635
MANAGEMENT of INFORMATION SECURITY Second EditionLearning Objectives Upon completion of this material, you should be able to: R Recognize and understand th organizational approaches i d d t d the i ti l h to information security List and describ
MNSU - CSC - 635
Management of Information Security, 2nd ed.8-1Chapter 8 Risk Management: Controlling RiskAt a GlanceInstructor's Manual Table of Contents Chapter Overview Chapter Outline Chapter Objectives Setup Notes Lecture Notes and Teaching Tips wit
MNSU - MATH - 153
Section 5.3Properties of Logarithms105 Course NumberSection 5.3 Properties of LogarithmsInstructor Objective: In this lesson you learned how to use the change-of-base formula to rewrite and evaluate logarithmic expressions and how to use prope
MNSU - MTH - 103
MNSU - MATH - 151
Section 3.3Polynomial and Synthetic Division77 Course NumberSection 3.3 Polynomial and Synthetic DivisionInstructor Objective: In this lesson you learned how to use long division and synthetic division to divide polynomials by other polynomial
MNSU - MATH - 151
Section 1.3Modeling with Linear Equations29 Course NumberSection 1.3 Modeling with Linear EquationsInstructor Objective: In this lesson you learned how to write and use mathematical models to solve real-life problems. DateI. Introduction to
MNSU - MATH - 153
Section 7.5Multiple-Angle and Product-to-Sum Formulas145 Course NumberSection 7.5 Multiple-Angle and Product-to-Sum FormulasInstructor Objective: In this lesson you learned how to use multiple -angle formulas, power-reducing formulas, half-ang
MNSU - PHY - 160
MNSU - MATH - 151
Chapter 9Systems of Equations and InequalitiesCourse Number InstructorSection 9.1 Solving Systems of EquationsObjective: In this lesson you learned how to solve systems of equations by substitution and by graphing and how to use systems of equ
MNSU - NUR - 150
STUDENT: _ INSTRUCTOR: _DATE: _ DATE: _PROCEDURE PERFORMANCE CHECKLIST Skill 38-1 Bathing a ClientS1. Assess clients tolerance for activity, discomfort level, cognitive ability, and musculoskeletal function. 2. Assess clients bathing preferenc
MNSU - MATH - 153
Section 6.2Right Triangle Trigonometry117 Course NumberSection 6.2 Right Triangle TrigonometryInstructor Objective: In this lesson you learned how to evaluate trigonometric functions of acute angles and how to use the fundamental trigonometric
MNSU - MATH - 351
The Normal DistributionThe Normal DistributionIf X is B(9, 1/3), the mean of X, X,is equal to:a) b) c) d)6 3 2 1.4141)If X is B(9, 1/3), the standard deviation of X, X,is equal to:a) b) c) a)6 3 2 approximately 1.4141) A pol
MNSU - MATH - 151
Section 3.2Polynomial Functions of Higher Degree75 Course NumberSection 3.2 Polynomial Functions of Higher DegreeInstructor Objective: In this lesson you learned how to sketch and analyze graphs of polynomial functions. DateImportant Vocabul
MNSU - MATH - 153
Section 5.2Logarithmic Functions and Their Graphs101 Course NumberSection 5.2 Logarithmic Functions and Their GraphsInstructor Objective: In this lesson you learned how to recognize, evaluate, and graph logarithmic functions. DateImportant V
MNSU - ELT - 111
Chapter 10 - CapacitorsIntroductory Circuit Analysis Robert L. Boylestad10.1 Introduction Capacitor displays its truecharacteristics only when a change in voltage is made in the network.10.2 The Electric Field The electric field is represe
MNSU - ELT - 111
Chapter 3 - ResistanceIntroductory Circuit Analysis Robert L. Boylestad3.1 Introduction The resistance of any material with a uniform cross-sectional area is determined by the following factors: Material Length Cross-sectional Area Temperatu
MNSU - NUR - 150
NORFOLK STATE UNIVERSITY DEPARTMENT OF NURSING NUR 150L - CRITERIA FOR GRADING NUTRITIONAL ASSESSMENT 1 = Not Met 2 = Poorly Met 3 = Met 4 = Well Met 5 = Very Well Met1. Collected nursing history focused upon nutritional needs 1 2 3 4 5 X 4 = _ (20
MNSU - CSC - 422
Database forms can be used for all of the following EXCEPT: A) collecting data. B) displaying query results. C) creating a query. D) providing a switchboard for other forms or reports. Ans: CWhich of the following is NOT one of the basic human fact
MNSU - CSC - 435
Computer Security Lecture 6Database SecurityIntroduction to Databases A database is a collection of data Database consists of records (tuples) Each record contains fields (attributes) Logical structure of a database is called a schema Hierarc
MNSU - CSC - 295
Ch 1 / Foil 2Ch 1 / Foil 3Enhancing ClasseslReferenceslNow we can explore various aspects of classes and objects in more detail Chapter 5 focuses on:n object references and aliases n passing objects references as parameters n the static mo
Johns Hopkins - MUSEWEB - 108
Book Reviews123does not appear enough to say merely that they &quot;are connected,&quot; as Desmond so often does. Similarly a recurrent allusion to the Lacanian and Derridean writings on the &quot;Seminar on the Purloined Letter&quot; animate Desmond's discourse ab
Johns Hopkins - MUSEWEB - 037
F R O MT H EE D I T O RThis Fall issue brings many exciting changes. The first to catch your eye will be, no doubt, the stunning book cover and layout design by John Stevens, a calligrapher, designer of logotypes, and illustrator of expressive
MNSU - CSC - 295
CSC295 Java Programming Language Test3 Hands-on Write an applet that draws a color circle at the mouse position wherever the user clicks the mouse. Your program should satisfy the followings: 1. The circle's center should be at the tip of the mouse
MNSU - MTH - 103
MNSU - MTH - 103