7/8/05MySQL David Lawrence1 David Lawrence, JLab An introduction for the novice.

Slides:



Advertisements
Similar presentations
MySQL Access Privilege System
Advertisements

Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic PHP.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Objectives Connect to MySQL from PHP
Lecture 4: Introduction to PHP 3 PHP & MySQL
MySQL and PHP By Trevor Adams.
Intermediate PHP & MySQL
CSC 2720 Building Web Applications Database and SQL.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Database Lecture # 1 By Ubaid Ullah.
1 Chapter 8 – Working with Databases spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
INTERNET APPLICATION DEVELOPMENT For More visit:
Java Database Connectivity (JDBC) Introduction to JDBC JDBC is a simple API for connecting from Java applications to multiple databases. Lets you smoothly.
True or False? Programming languages can be used to update databases and communicate with other systems. True.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Database Access Through the Web.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
DB Libraries: An Alternative to DBMS By Matt Stegman November 22, 2005.
Python MySQL Database Access
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 MySQL and JDBC.
Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
Introduction to MySQL Lab no. 10 Advance Database Management System.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
Chapter 6 PHP Interacts with Mysql Database. Introduction In PHP, there is no consolidated interface. Instead, a set of library functions are provided.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
1. Connecting database from PHP 2. Sending query 3. Fetching data 4. Persistent connections 5. Best practices.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
MySQL Database Connection
Chapter 5 MYSQL Database. Introduction to MYSQL MySQL is the world's most popular open-source database. Open source means that the source code, the programming.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Chapter 8 Databases.
WEB/DB1 DATABASE PROGRAMMING 3JDBC by the ASU Scholars.
Introduction to MySQL MySQL Overview by Ray Williams CS 320/565 Marymount University.
PHP Database Processing CIS 1715 Web Technologies.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Permissions Lesson 13. Skills Matrix Security Modes Maintaining data integrity involves creating users, controlling their access and limiting their ability.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Database Access Using JDBC BCIS 3680 Enterprise Programming.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
CP476 Internet Computing Perl CGI and MySql 1 Relational Databases –A database is a collection of data organized to allow relatively easy access for retrievals,
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Lab 3.21 MySQL Database Lab Developing the Tools May 5 th, 2004 Montréal, Québec Dominik Gehl Hôpital Ste-Justine, Montréal.
MY SQL INTRODUCTION TO LOGIN BASIC COMMANDS OTHER COMMANDS.
JDBC. Database is used to store data permanently. These days almost all Applications needs database to store its data persistently. Below are the most.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
Web Systems & Technologies
PGT(CS) ,KV JHAGRAKHAND
Relational database and SQL MySQL LAMP SQL queries
Session 4 PHP & MySQL.
JDBC.
PHP-language, database-programming
ISC440: Web Programming 2 Server-side Scripting PHP 3
Chapter 8 Working with Databases and MySQL
Interacting with Database
MSIS 655 Advanced Business Applications Programming
Tutorial 6 PHP & MySQL Li Xu
Web Application Development Using PHP
Presentation transcript:

7/8/05MySQL David Lawrence1 David Lawrence, JLab An introduction for the novice

7/8/05MySQL David Lawrence2 What is a Database? Store information(data) in a reliable, accessible way Allow access to data over a network to multiple users Provide easy way to select a specific “view” of the data

7/8/05MySQL David Lawrence3 Relational Database A relational database is a collection of tables that can be dynamically (and temporarily) combined into a single table. Columns of the contributing tables can be related to one another. In a non-relational database, the tables are always separate entities

7/8/05MySQL David Lawrence4 A Few Terms: Server - Program that accepts connections and implements the database Database - A collection of tables on a single server. More than one “database” can exist on a single server Table - A set of column definitions

7/8/05MySQL David Lawrence5 A Few Terms: Column - Provides a name and data type Row - A single entry in a table. It contains one value for every column (possibly NULL) Query - A command in SQL syntax for the database. It can insert, modify, or extract data.

7/8/05MySQL David Lawrence6 tructured uery anguage ANSI/ISO Standard:

7/8/05MySQL David Lawrence7 SQL: Structured Query Language SQL is a syntax for probing and manipulating a database.

7/8/05MySQL David Lawrence8 Creating a table CREATE TABLE IF NOT EXISTS friends( idint PRIMARY KEY AUTO_INCREMENT, firstnamechar(255) NOT NULL, lastnamechar(255), pets_namechar(255), ageint, statusENUM("like","hate") default 'like', createddatetime, modifiedtimestamp ) TYPE=MyISAM;

7/8/05MySQL David Lawrence9 The INSERT statement INSERT INTO friends (firstname,lastname,pets_name,age,created) VALUES("Amelia", "Lawrence", "Star", 8, NOW());

7/8/05MySQL David Lawrence10 The SELECT statement

7/8/05MySQL David Lawrence11 The SELECT statement SELECT can specify both columns and rows…

7/8/05MySQL David Lawrence12 The SELECT statement SELECT can limit the number of rows returned…

7/8/05MySQL David Lawrence13 The SELECT statement SELECT can also be used with functions…

7/8/05MySQL David Lawrence14 The SELECT statement SELECT can do math …

7/8/05MySQL David Lawrence15 UPDATEing table data

7/8/05MySQL David Lawrence16 The DELETE statement

7/8/05MySQL David Lawrence17 Database Table Design is an Art! # ---- BAD CREATE TABLE IF NOT EXISTS tagger_t_cal_dave3( tidint, toffset_lint, toffset_rint ); CREATE TABLE IF NOT EXISTS tagger_table_names( runint, tagger_t_cal_tablechar(255), tagger_e_cal_tablechar(255) ); “If you have to do more than one query to get the data you want out of the database, you have not done a good job designing your tables.” -R. Chapman, Professional Database Designer

7/8/05MySQL David Lawrence18 Database Table Design is an Art! # ---- GOOD CREATE TABLE IF NOT EXISTS tagger_t_cal( runint NOT NULL, tidint NOT NULL, toffset_lint, toffset_rint, PRIMARY KEY(run,tid) );

7/8/05MySQL David Lawrence19 Client/Server Model Server Client server listens … … client connects Client Many clients can Connect to the server at once

7/8/05MySQL David Lawrence20 Permissions/Access Control Permissions are kept by server independent of any Unix system Accounts are determined by the host you connect from and the username you supply Permissions can be granted at the global, database, table and column levels Permissions can be granted for all or only a partial set of commands

7/8/05MySQL David Lawrence21 Permissions/Access Control Use the GRANT and REVOKE commands to set permissions: GRANT ALL PRIVILEGES ON test.* TO IDENTIFIED BY "tutu” REVOKE ALL PRIVILEGES ON test.* FROM IDENTIFIED BY "tutu”

7/8/05MySQL David Lawrence22 The mysql command-line tool

7/8/05MySQL David Lawrence23 API: Application Programming Interface The API provides the means to access the database from your language of choice –C –Perl –PHP –Java (JDBC) –Python –Tcl –Eiffel

7/8/05MySQL David Lawrence24 C API Very useful for adding database access to C programs, but most jobs are better done in scripting languages –mysql_init() –mysql_real_connect() –mysql_query() –mysql_store_result() –mysql_fetch_row() –mysql_free_result() –mysql_close()

7/8/05MySQL David Lawrence25

7/8/05MySQL David Lawrence26 Compiling the C program

7/8/05MySQL David Lawrence27 Perl API Uses the DBI and DBD-mysql modules –DBI->connect() –prepare() execute() fetchrow_arrayref() fectrow_hashref() –disconnect()

7/8/05MySQL David Lawrence28 Perl API

7/8/05MySQL David Lawrence29 PHP API The PHP interface is extremely valuable for interfacing a MySQL database with a web page –mysql_connect() –mysql_select_db() –mysql_query() mysql_fetch_array() –mysql_close()

7/8/05MySQL David Lawrence30 PHP API

7/8/05MySQL David Lawrence31 Java API Java uses JDBC to interface to MySQL –Class.forName() –getConnection() –createStatement() –executeQuery() next() getString() getInt()

7/8/05MySQL David Lawrence32

7/8/05MySQL David Lawrence33 Backing Up: mysqldump The mysqldump command line utility can print the entire contents of a database to the screen. –-d option says don’t include table data –-t option says don’t include table definitions –Individual tables can be specified

7/8/05MySQL David Lawrence34

7/8/05MySQL David Lawrence35 Supported Platforms AIX Amiga BSDI Digital Unix FreeBSD HP-UX Linux SunOS True64 Mac OS X NetBSD Novell Netware OpenBSD OS/2 Warp SCO Unix SGI True64 MS Windows

7/8/05MySQL David Lawrence36 Summary MySQL is a popular, free database well suited to most applications There are APIs supporting many programming languages including PHP which makes a powerful combination for generating web pages See more at