open source programming. outline tentative schedule tentative schedule definition: what is open...

45
Open source programming

Upload: gerard-harmon

Post on 20-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Open source programming

Page 2: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

outlineoutline

Tentative scheduleTentative schedule definition: what is open source software?definition: what is open source software? examples of open source softwareexamples of open source software history of free software and open sourcehistory of free software and open source Proprietary vs. Open Source Licensing Proprietary vs. Open Source Licensing

ModelsModels open source software development open source software development

modelmodel open source business modelsopen source business models

Page 3: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

ObjectiveObjective

On completion of this course the On completion of this course the students understand how to create students understand how to create open source software applications and open source software applications and can publish it over the Internetcan publish it over the Internet

Page 4: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Week #

Date Topic

1 12-Apr-15 UNIT – I: INTRODUCTION TO OSP, PHP, MYSQL

2 19-Apr-15 APACHE, POSTGRESS , SQL

3 26-Apr-15OVERVIEW OF PHP – VARIABLESOPERATIONS, CONSTANTS,

4 10-May-15 CONTROL STRUCTURES ARRAYS, FUNCTIONS,

5 17-May-15 CLASSES – HANDLING FILES

6 24-May-15UNIT – II: MY SQL DATABASE PROGRAMMING - CONNECTING – TABLE CREATION – RECORD INSERTION

7 31-May-15 UPDATION – MULTIPLE DATABASE HANDLING

8 7-Jun-15UNIT – III: E-MAILINGWITH PHP - SENDING AN EMAIL – MULTIPART MESSAGE

Schedule Schedule

Page 5: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Week #

Date Topic

9 14-JUN-15 STORING IMAGES – GETTING CONFIRMATION

28-JUN-15 MID SEM EXAM

04-JUL-15 MID SEM EXAM

10 12-JUL-15SESSION TRACKING USING PHP – GRAPHICS INPUT VALIDATORS – COOKIES

11 26-JUL-15UNIT-IV : INTRODUCTION TO PERL - NUMBERS AND STRINGS – CONTROL STATEMENTS

12 2-AUG-15 LISTS AND ARRAYS – FILES

13 9-AUG-15 PATTERN MATCHING – HASHES – FUNCTIONS.

14 23-AUG-15 UNIT – V : TCL / PYTHON - INTRODUCTION TO TCL/TK

15 30-AUG-15 INTRODUCTION TO PYTHON

16 6-SEP-15 PYTHON

13-SEP-15 PL & APD

20-SEP-15 END SEM EXAM

27-SEP-15 END SEM EXAM

05-OCT-15 PAPER DISTRIBUTION

Page 6: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Expected OutcomeExpected Outcome

Students should be able to design open source software applications and can publish it over the Internet

Page 7: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Text booksText books

1. Julie C. Meloni, SAMS Teach yourself PHP, MYSQL and Apache, Second edition Pearson Education, 2006.2. Michael K.glass, Rommn le Scouarnec, et.al., Beginning PHP, Apache, MySQL webdevelopment,Wiley Publishing, Inc, New Delhi, 20043. Leon Atkinson and Zeev Suraski, Core PHP programming, 3rd Edition, Pearson Education, Delhi, 2004.

Page 8: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

what is open source what is open source software?software?

Open Source software is software licensed under anOpen Source software is software licensed under an

agreement that conforms to the Open Source agreement that conforms to the Open Source DefinitionDefinition

• • Access to Source CodeAccess to Source Code

• • Freedom to RedistributeFreedom to Redistribute

• • Freedom to ModifyFreedom to Modify

• • Non-Discriminatory Licensing Non-Discriminatory Licensing (licensee/product)(licensee/product)

• • Integrity of AuthorshipIntegrity of Authorship

• • Redistribution in accordance with the Open Redistribution in accordance with the Open SourceSource

– License AgreementLicense Agreement

Page 9: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

examples of open examples of open source softwaresource software Operating SystemsOperating Systems

– LinuxLinux– FreeBSD, OpenBSD, and NetBSD: The FreeBSD, OpenBSD, and NetBSD: The

BSDs are all based on the Berkeley BSDs are all based on the Berkeley Systems Distribution of Unix, Systems Distribution of Unix, developed at the University of developed at the University of California, Berkeley. Another BSD California, Berkeley. Another BSD based open source project is Darwin, based open source project is Darwin, which is the base of Apple's Mac OS X.which is the base of Apple's Mac OS X.

Page 10: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

examples of open source examples of open source softwaresoftware

InternetInternet– Apache, which runs over 50% of the world's web Apache, which runs over 50% of the world's web

servers.servers.– BIND, (Berkeley Internet Name Daemon ) the BIND, (Berkeley Internet Name Daemon ) the

software that provides the DNS (domain name software that provides the DNS (domain name service) for the entire Internet.service) for the entire Internet.

– sendmail, the most important and widely used sendmail, the most important and widely used email transport software on the Internet.email transport software on the Internet.

– Mozilla, the open source redesign of the Netscape Mozilla, the open source redesign of the Netscape BrowserBrowser

– OpenSSL is the standard for secure OpenSSL is the standard for secure communication (strong encryption) over the communication (strong encryption) over the Internet.categories.Internet.categories.

Page 11: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

example of open source example of open source softwaresoftware Programming ToolsProgramming Tools

– Zope, and PHP, are popular engines behind the Zope, and PHP, are popular engines behind the "live content" on the World Wide Web."live content" on the World Wide Web.

– Languages:Languages: PerlPerl PythonPython RubyRuby Tcl/TkTcl/Tk

– GNU compilers and toolsGNU compilers and tools GCCGCC MakeMake AutoconfAutoconf AutomakeAutomake

Page 12: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

open source software open source software sitessites Free Software Foundation Free Software Foundation www.fsf.org Open Source Initiative Open Source Initiative www.opensource.org Freshmeat.netFreshmeat.net SourceForge.netSourceForge.net OSDir.comOSDir.com developer.BerliOS.dedeveloper.BerliOS.de Bioinformatics.orgBioinformatics.org see also individual project sites; e.g., see also individual project sites; e.g.,

www.apache.org; ; www.cpan.org; etc.; etc.

Page 13: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

some dates from the some dates from the history of open sourcehistory of open source 1970s: UNIX operating system developed 1970s: UNIX operating system developed

at Bell Labs and by a diverse group of at Bell Labs and by a diverse group of contributors outside of Bell Labs; later contributors outside of Bell Labs; later AT&T enforces intellectual property rights AT&T enforces intellectual property rights and “closes” the codeand “closes” the code

1983: Richard Stallman founds the Free 1983: Richard Stallman founds the Free Software FoundationSoftware Foundation

1993: Linus Torvalds releases first version 1993: Linus Torvalds releases first version of Linux builtof Linux built

1997: Debian Free Software Guidelines 1997: Debian Free Software Guidelines releasedreleased

1998: Netscape releases Navigator in 1998: Netscape releases Navigator in sourcesource

Page 14: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Proprietary vs. Open Source Licensing Proprietary vs. Open Source Licensing ModelsModels

Page 15: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

conventional models conventional models of software developmentof software development waterfallwaterfall

– from requirements to code without a from requirements to code without a backward turnbackward turn

historically used for large military and historically used for large military and corporate software productions; originally corporate software productions; originally used because computing time was expensiveused because computing time was expensive

spiralspiral– iterative cycles of requirements, iterative cycles of requirements,

development, testing, redrafting of development, testing, redrafting of requirements, etc.requirements, etc.

B. W. Boehm. “A spiral model of software B. W. Boehm. “A spiral model of software development and enhancement”. development and enhancement”. IEEE IEEE ComputerComputer, 21(5):61--72, 1988, 21(5):61--72, 1988

Page 16: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Waterfall ModelWaterfall Model

Page 17: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Spiral ModelSpiral Model

Page 18: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

open source software developmentopen source software development

Coredeveloper(s)

Maintainers

Patchers

Bug reporters

Documenters Users

Users

Users

Users

Page 19: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Phases of OSDPhases of OSD

Page 20: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

open source business open source business modelsmodels What it Provides??What it Provides??

– serviceservice– supportsupport– educationeducation– extensionsextensions

Page 21: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

open source open source companiescompanies

IBMIBM uses and develops Apache and Linux; created uses and develops Apache and Linux; created

Secure Mailer and created other software on Secure Mailer and created other software on AlphaWorksAlphaWorks

AppleApple released core layers of Mac OS X Server as an released core layers of Mac OS X Server as an

open source BSD operating system called Darwin; open source BSD operating system called Darwin; open sourcing the QuickTime Streaming Server open sourcing the QuickTime Streaming Server and the OpenPlay network gaming toolkitand the OpenPlay network gaming toolkit

HPHP uses and releases products running Linuxuses and releases products running Linux

SunSun uses Linux; supports some open source uses Linux; supports some open source

development efforts(Forte IDE for Java and the development efforts(Forte IDE for Java and the Mozilla web browser)Mozilla web browser)

Page 22: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

open source open source companiescompanies Red Hat SoftwareRed Hat Software

– Linux vendor Linux vendor ActiveStateActiveState

– develops and sells professional tools develops and sells professional tools for Perl, Python, and Tcl/tk for Perl, Python, and Tcl/tk developers.developers.

Page 23: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

open source licensingopen source licensing

see see http://www.opensource.org/licenses/– apache software licenseapache software license– python licensepython license– ibm public licenseibm public license– apple public source licenseapple public source license– etc.etc.

Page 24: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

PHP – IntroductionPHP – Introduction

Page 25: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

AgendaAgenda

1. Brief History of PHP1. Brief History of PHP

2. Getting started2. Getting started

3. Resources3. Resources

Page 26: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Brief History of PHPBrief History of PHPPHPPHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially

developed for HTTP usage logging and server-side form generation in Unix. developed for HTTP usage logging and server-side form generation in Unix.

PHP 2 (1995)PHP 2 (1995) transformed the language into a Server-side embedded scripting language. transformed the language into a Server-side embedded scripting language. Added database support, file uploads, variables, arrays, recursive functions, Added database support, file uploads, variables, arrays, recursive functions, conditionals, iteration, regular expressions, etc.conditionals, iteration, regular expressions, etc.

PHP 3 (1998)PHP 3 (1998) added support for ODBC data sources, multiple platform support, email added support for ODBC data sources, multiple platform support, email protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans . protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans .

PHP 4 (2000)PHP 4 (2000) became an independent component of the web server for added efficiency. became an independent component of the web server for added efficiency. The parser was renamed the Zend Engine. Many security features were added.The parser was renamed the Zend Engine. Many security features were added.

PHP 5 (2004)PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML support adds Zend Engine II with object oriented programming, robust XML support using the libxml2 library, SOAP extension for interoperability with Web Services, using the libxml2 library, SOAP extension for interoperability with Web Services, SQLite has been bundled with PHP SQLite has been bundled with PHP

The latest PHP versions are:The latest PHP versions are:

PHP 5.3.8 (23 August 2011)PHP 5.3.8 (23 August 2011)

Stable:Stable:

PHP 5.3.4 (09 December 2010)PHP 5.3.4 (09 December 2010)PHP 5.3: version 5.3.3 (22 July 2010) PHP 5.3: version 5.3.3 (22 July 2010) PHP 5.2: version 5.2.14 (22 July 2010)PHP 5.2: version 5.2.14 (22 July 2010)

Page 27: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Why is PHP used?Why is PHP used?1. Easy to Use

Code is embedded into HTML. The PHP code is enclosed in special start and end tags that allow you to jump into and out of "PHP mode".

<html>   <head>       <title>Example</title>   </head>   <body>

       <?php        echo "Hi, I'm a PHP script!";        ?>

   </body></html>

Page 28: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Why is PHP used?Why is PHP used?2. Cross Platform

Runs on almost any Web server on several operating systems.One of the strongest features is the wide range of supported databases

Web Servers: Apache, Microsoft IIS, Caudium, Netscape Enterprise Server

Operating Systems: UNIX (HP-UX,OpenBSD,Solaris,Linux), Mac OSX, Windows NT/98/2000/XP/2003

Supported Databases: Adabas D, dBase,Empress, FilePro (read-only), Hyperwave,IBM DB2, Informix, Ingres, InterBase, FrontBase, mSQL, Direct MS-SQL, MySQL, ODBC, Oracle (OCI7 and OCI8), Ovrimos, PostgreSQL, SQLite, Solid, Sybase, Velocis,Unix dbm

Page 29: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Why is PHP used?Why is PHP used?3. Cost Benefits

PHP is free. Open source code means that the entire PHP community will contribute towards bug fixes. There are several add-on technologies (libraries) for PHP that are also free.

PHPPHP

SoftwareSoftware FreeFree

PlatformPlatform Free (Linux)Free (Linux)

Development Development ToolsTools

FreeFreePHP Coder, , jEdit

Page 30: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Getting StartedGetting Started1.1. How to escape from HTML and enter PHP modeHow to escape from HTML and enter PHP mode PHP parses a file by looking for one of the special tags thatPHP parses a file by looking for one of the special tags that

tells it to start interpreting the text as PHP code. The parser then tells it to start interpreting the text as PHP code. The parser then executes all of the code it finds until it runs into a PHP closing tag.executes all of the code it finds until it runs into a PHP closing tag.

Starting tagStarting tag Ending Ending tagtag

NotesNotes

<?php<?php ?>?> Preferred method as it allows Preferred method as it allows the use of PHP with XHTMLthe use of PHP with XHTML

<?<? ?>?> Not recommended. Easier to Not recommended. Easier to type, but has to be enabled and type, but has to be enabled and may conflict with XMLmay conflict with XML

<script <script language="php">language="php">

?>?> Always available, best if used Always available, best if used when FrontPage is the HTML when FrontPage is the HTML editoreditor

<%<% %>%> Not recommended. ASP tags Not recommended. ASP tags support was added in 3.0.4support was added in 3.0.4

<?php echo “Hello World”; ?>

PHP CODE HTMLHTML

Page 31: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Getting StartedGetting Started

2.2. Simple HTML Page with PHPSimple HTML Page with PHP The following is a basic example to output The following is a basic example to output

text usingtext usingPHP.PHP.<html><head><html><head><title>My First PHP Page</title><title>My First PHP Page</title></head></head><body><body><?php<?phpecho "Hello World!";echo "Hello World!";?>?></body></html> </body></html>

Copy the code onto your web server and save it as “test.php”.

You should see “Hello World!” displayed.

Notice that the semicolon is used at the end of each line of PHP code to signify a line break. Like HTML, PHP ignores whitespacebetween lines of code. (An HTML equivalent is <BR>)

Page 32: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Additional ResourcesAdditional Resources

PHP Manual PHP Manual http://docs.php.net/

PHP Tutorial PHP Tutorial http://academ.hvcc.edu/~kantopet/php/index.php

PHP CoderPHP Coder http://www.phpide.de/

JEdit JEdit http://www.jedit.org/

PHP's creator offers his thoughts on the PHP phenomenon, PHP's creator offers his thoughts on the PHP phenomenon, what has shaped and motivated the language, and where the what has shaped and motivated the language, and where the PHP movement is heading PHP movement is heading http://www.oracle.com/technology/pub/articles/php_experts/rasmus_php.html

Hotscripts – A large number of PHP scripts can be found at:Hotscripts – A large number of PHP scripts can be found at: http://hotscripts.com/PHP/Scripts_and_Programs/index.html

Page 33: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Additional InformationAdditional InformationSome of the new functions added in version 5:Some of the new functions added in version 5:

Arrays:Arrays:array_combine() - Creates an array by using one array for keys and another array_combine() - Creates an array by using one array for keys and another for its values for its values

array_walk_recursive() - Apply a user function recursively to every member array_walk_recursive() - Apply a user function recursively to every member of an array of an array

Date and Time Related:Date and Time Related: idate()idate() - - Format a local time/date as integer Format a local time/date as integer date_sunset()date_sunset() - - Time of sunset for a given day and locationTime of sunset for a given day and location date_sunrise() -date_sunrise() - Time of sunrise for a given day and locationTime of sunrise for a given day and location time_nanosleep()time_nanosleep() - - Delay for a number of seconds and nano seconds Delay for a number of seconds and nano seconds

Strings:Strings: str_split() -str_split() - Convert a string to an arrayConvert a string to an array strpbrk()strpbrk() - - Search a string for any of a set of charactersSearch a string for any of a set of characters substr_compare()substr_compare() - - Binary safe optionally case insensitive comparison of Binary safe optionally case insensitive comparison of

two strings from an offset, up to length characters two strings from an offset, up to length characters

Other:Other: php_check_syntax() - Check the syntax of the specified filephp_check_syntax() - Check the syntax of the specified file php_strip_whitespace() php_strip_whitespace() - - Return source with stripped comments and Return source with stripped comments and

whitespace whitespace

Page 34: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

MySQLMySQLIt is It is namednamed after developer Michael after developer Michael Widenius' daughter, My.Widenius' daughter, My.

The SQL phrase stands for The SQL phrase stands for Structured Query Language. Structured Query Language.

Page 35: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

WHAT IS MYSQLWHAT IS MYSQL

Free SQL (Structured Query Language) database Free SQL (Structured Query Language) database server.server.

licensed with the licensed with the GNUGNU General public license General public license http://www.gnu.org/http://www.gnu.org/

MySQLMySQL is a database management system. is a database management system. MySQLMySQL is a relational database management is a relational database management

system.system. MySQLMySQL is Open Source Software. is Open Source Software.

Page 36: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

MAIN SUPPORTED MAIN SUPPORTED PLATFORMSPLATFORMS

First developed for First developed for SolarisSolaris and RedHat and RedHat LinuxLinux.. FreeBSD.FreeBSD. OpenBSD.OpenBSD. Mac OS X Server.Mac OS X Server. Win95, Win98, NT, and Win2000.Win95, Win98, NT, and Win2000. All modern systems with working Posix All modern systems with working Posix

threads and a C++ compilerthreads and a C++ compiler..

Page 37: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Fully multi-threaded using kernel threads.Fully multi-threaded using kernel threads. Works on many different platforms.Works on many different platforms. Uses very fast B-tree disk tables (Uses very fast B-tree disk tables (MyISAMMyISAM) with index ) with index

compression. compression. Very fast joins using an optimized nested loop-joinVery fast joins using an optimized nested loop-join APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are

available, enabling MySQL clients to be written in many available, enabling MySQL clients to be written in many languages. languages.

A privilege and password system that is very flexible and secure.A privilege and password system that is very flexible and secure. Handles large databases.Handles large databases. Tested with a broad range of different compilers. (C/C++)Tested with a broad range of different compilers. (C/C++) Designed to make it relatively easy to add other storage engines. Designed to make it relatively easy to add other storage engines.

This is useful if you want to provide an SQL interface for an in-This is useful if you want to provide an SQL interface for an in-house database.house database.

You can refer to tables from different databases in the same You can refer to tables from different databases in the same statement.statement.

A privilege and password system that is very flexible and secure, A privilege and password system that is very flexible and secure, and that enables host-based verification. and that enables host-based verification.

Main FeaturesMain Features

Page 38: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

ADVANTAGESADVANTAGES

very fastvery fast reliable and easy to usereliable and easy to use multi-threaded multi-user and multi-threaded multi-user and

robust SQL database server.robust SQL database server.

Page 39: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

DISADVANTAGESDISADVANTAGES

Missing Sub-selects. Missing Sub-selects. MySQL doesn't yet support the Oracle SQL MySQL doesn't yet support the Oracle SQL

extension: i SELECT ... INTO TABLE , but extension: i SELECT ... INTO TABLE , but supports INSERT INTO ... SELECT ..supports INSERT INTO ... SELECT ..– Does not support Stored Procedures and Does not support Stored Procedures and

Triggers.Triggers.– MySQL doesn't support views.MySQL doesn't support views.

Untill Mysql 5.1. Untill Mysql 5.1.

Page 40: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

DATA MANAGEMENTDATA MANAGEMENT SHOW DATABASES;SHOW DATABASES; USE databaseName;USE databaseName; SHOW TABLES;SHOW TABLES; DESCRIBE table;DESCRIBE table; SELECT * FROM table;SELECT * FROM table; SELECT * FROM table \GSELECT * FROM table \G CREATE DATABASE databaseName;CREATE DATABASE databaseName; DROP DATABASE databaseName;DROP DATABASE databaseName; CREATE TABLE tableName(name1 type1, name2 CREATE TABLE tableName(name1 type1, name2

type2, ...); type2, ...); DROP TABLE tableName;DROP TABLE tableName; INSERT INTO TABLE VALUES( value1, value2, ...);INSERT INTO TABLE VALUES( value1, value2, ...); SELECT field1, field2, ... FROM tableName;SELECT field1, field2, ... FROM tableName; SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr; SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr; LOAD DATA INFILE /path/file.txt INTO TABLE skr;LOAD DATA INFILE /path/file.txt INTO TABLE skr;

Page 41: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

DOWNLOADDOWNLOAD

http://www.dev.mysql.com/downloadshttp://www.dev.mysql.com/downloads Download instructionsDownload instructions

http://download.sourceforge.net/mirrors/mysql/http://download.sourceforge.net/mirrors/mysql/ RedHat and SuSe RedHat and SuSe LinuxLinux distributions. distributions. http://www.analysisandsolutions.com/code/http://www.analysisandsolutions.com/code/

mybasic.htmmybasic.htm Beginners MySQL Tutorial on how to Beginners MySQL Tutorial on how to install and set up MySQL on ainstall and set up MySQL on a Windows Windows machine.machine.

Page 42: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

INSTALLATIONINSTALLATION Under RedHat Linux from an RPM packageUnder RedHat Linux from an RPM package (install as (install as

root) rpm -i MySQL-VERSION.i386.rpm MySQL-client-root) rpm -i MySQL-VERSION.i386.rpm MySQL-client-VERSION.i386.rpmVERSION.i386.rpm

Under any (other) LinuxUnder any (other) Linux (install as root) (install as root) groupadd mysql groupadd mysql useradd -g mysql mysql useradd -g mysql mysql

cd /usr/localcd /usr/local gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -xvf - ln -s mysql-VERSION-OS ln -s mysql-VERSION-OS mysqlmysql cd cd mysqlmysql scripts/mysql_install_dbscripts/mysql_install_db chown -R mysql /usr/local/mysql chown -R mysql /usr/local/mysql chgrp -R mysql chgrp -R mysql /usr/local/mysql/usr/local/mysql bin/safe_mysqld --user=mysql bin/safe_mysqld --user=mysql &&

Page 43: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

DocumentationDocumentation http://www.mysql.com/documentation/http://www.mysql.com/documentation/ http://www.mysql.com/documentation/http://www.mysql.com/documentation/

manual.phpmanual.php As text As text manual.txtmanual.txt As HTML As HTML manual_toc.html manual_toc.html As GNU InfoAs GNU Info mysql.infomysql.info As PostScript As PostScript manual.psmanual.ps

http://www.turbolift.com/mysqlhttp://www.turbolift.com/mysql

Page 44: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

START MYSQL ServerSTART MYSQL Server

As root under LinuxAs root under Linux with the with the commandcommand

safe_mysqld &safe_mysqld &

Page 45: Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

START A MYSQL START A MYSQL CLIENTCLIENT

Without using passwordsWithout using passwords (when the password for the (when the password for the specified user is empty)specified user is empty) mysql -u <user> -h <Host> mysql -u <user> -h <Host>

Using passwordsUsing passwords mysql -u <user> -h <Host> -p mysql -u <user> -h <Host> -p

Example: mysql -u root Example: mysql -u root -h localhost -h localhost

Exitting with the command quit or exitExitting with the command quit or exit..