Introduction to My SQL
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Introduction to My SQL

  • 998 views
Uploaded on

COMMON Europe Congress 2012 - Vienna

COMMON Europe Congress 2012 - Vienna

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
998
On Slideshare
953
From Embeds
45
Number of Embeds
2

Actions

Shares
Downloads
32
Comments
0
Likes
0

Embeds 45

http://www.ustudy.in 44
http://webcache.googleusercontent.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. MySQL for IBM i Function JunctionMike PavlakSolutions Consultantmike.p@zend.com(815) 722 3454 © All rights reserved. Zend Technologies, Inc.
  • 2. PHP Sessions Sun 11:30 AM • What’s New with Zend Server Sun 1:30 PM • Business Value of PHP Sun 4:00 PM • Practical PHP by Example (Leth-Kjaer) Mon 10:00 AM • PHP on IBM i: Getting Started Mon 10:00 AM • DB Standards in Zend PHP usage (Sielhorst) Tue 10:00 AM • MySQL on IBM i, Open Source & DB2 Store Tue 11:30 AM • PHP Arrays for the RPG Programmer| 2 Copyright © 2009 Zend Technologies, Inc, All rights reserved © All rights reserved. Zend Technologies, Inc. 02/03/
  • 3. Agenda • What is MySQL • Install • Access • GUI’s • DB2 Storage Engine • Q&A| 3 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 4. What is MySQL? • Most Popular and widely used Open Source Database • Relational Database management System (RDBMS) • Like DB2, but not, really • Command line interface • Many utilities available to manage • phpMyAdmin, Adminer,| 4 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 5. Who uses MySQL & why? • Millions of downloads • Big companies • Growing in IBM i • Nearly Everyone using open source PHP applications • Free • Open Source • Delivered by Zend • Back end for thousands of applications like drupal, Sugar CRM, Media Wiki, etc.| 5 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 6. How does it work? • Essentially flat files in the IFS • MySQL has two major parts: • UI Layer • Storage Engine • MyISAM • INNODB • IBMDB2 • Sound familiar?| 6 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 7. Architecture © All rights reserved. Zend Technologies, Inc.
  • 8. History of MySQL © All rights reserved. Zend Technologies, Inc.
  • 9. In the beginning Founded by David Axmark Allan Larsson Michael “Monty” Widenius Named after Monty’s daughter “My” (Pronounced mee)| 9 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 10. OwnershipRemember MySQL is Open Source: Anyone can compile the source code and use the binaries as long as they follow the rules of the license.Jan 2008:Sun purchased MySQL for $1BOracle purchased sun about year later for $7.4BFUD ensues…Today, MySQL continues to live on © All rights reserved. Zend Technologies, Inc.
  • 11. What about IBM i?Two years ago Oracle dropped support for MySQL on Power and discontinued compiling the binaries.Old binaries still available on Oracle archive siteIBM began looking for a new suitorZend stepped up and took over the binary distribution for MySQL for IBM i and the new product is called Zend DBiSame wonderful MySQL, just compiled for POWER IBM iAvailable for no charge at www.zend.com/products/dbi © All rights reserved. Zend Technologies, Inc.
  • 12. Installation, Zend DBi © All rights reserved. Zend Technologies, Inc.
  • 13. First, remove old version??? • If you have no real data… • Stop ZMYSQL Subsystem • Delete ZMYSQL library • RMVLNK ‘/usr/local/mysql*’ • Knowledge base article 305 (Dated but still useful!) • http://kb.zend.com/index.php?View=entry&EntryID=305| 13 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 14. Zend DBi Installation process • Documented at Zend.com • Option to install or update within point release • Can update 5.1.n to 5.1.current (Zend Server) • Cannot update 5.0.n (Zend Core) • Download .zip from Zend.com, contains SAVF & README • Follow readme.txt in SAVF, pretty straight forward • Required LP’s are typically installed before Zend Server • A word about QSECOFR…| 14 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 15. Update anyone? • Here we have 5.1.50 (install with ZS 5.1) • Let’s go up to 5.1.59| 15 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 16. Start the installation process • Have ROOT password before updating • Just stop ZMYSQL • GO ZMYSQL/ZCMYSQL • Option 5 then Option 2 then exit MySQL menu| 16 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 17. Get SAVF to IBM i • FTP and check it…(DSPSAVF)| 17 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 18. Start the update process • Steps to fire up process • RSTLIB SAVLIB(ZMYSQL) • CHGCURLIB ZMYSQL • CALL ZMYSQLUPG1…update begins…| 18 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 19. Set update options • Have ROOT password before you get here • Will run MySQL script to update! • Without ROOT process will fail, QSECOFR doesn’t work here!| 19 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 20. Woohoo!| 20 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 21. New subsystem and daemon • ZENDDBI • ZENDDBID| 21 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 22. MySQL Command Line © All rights reserved. Zend Technologies, Inc.
  • 23. MySQL Monitor • MySQL has no native GUI interface (sound familiar?) • Command line accessible from QSHELL, QP2TERM, etc. • This is the brute force method for accessing. • Will show you access, but not a big fan. • Fully documented at mysql website • Many books on the subject| 23 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 24. Starting MySQL Monitor • I typically use CALL QP2TERM, can use QSH, etc. • The mysql> is the prompter for the monitor • Mysql –u root (First time, please set password!) • Mysql –u root –p mikey| 24 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 25. List all the databases • Show databases; • List all databases in MySQL • Database is like a library • Usually sorted by application| 25 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 26. Set database • Use <DBNAME> • Selects the database you will use for processing • Database is like a library, where you store tables, etc. • Typically on database per application| 26 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 27. List tables| 27 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 28. Display the user table • Use SQL, • select host, user, password from user; • Use quit to end the session in the MySQL Monitor and F3 to close shell.| 28 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 29. Are there any GUI’s? © All rights reserved. Zend Technologies, Inc.
  • 30. Many GUI solutionsAdminer Single PHP script Lightweight, powerful and easy to usephpMyAdmin Widely used by community Installed with Zend Server © All rights reserved. Zend Technologies, Inc.
  • 31. Adminer © All rights reserved. Zend Technologies, Inc.
  • 32. phpMyAdmin • Open Source PHP Project • Provides nearly every access to MySQL you might need • Installed automatically with Zend Server. • Launch from Zend Server MonitorDashboard tab| 32 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 33. phpMyAdmin – Set ROOT password • Login with “root” profile • Create your profile • Test your profile • Change root password IMMEDIATELY (if not sooner) • This is a similar process as you might use for new LPARs| 33 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 34. Tour the dashboard..then on to privileges| 34 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 35. Privileges • Click Add new user • Fill out details, click GO| 35 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 36. Look at databases & tables • Left hand navigation • Right hand workspace • FULL CRUD capabilities • Think DFU for MySQL!| 36 © All rights reserved. Zend Technologies, Inc. 02/04/
  • 37. IBM DB2 StorageEngine © All rights reserved. Zend Technologies, Inc.
  • 38. Why use MySQL to store data in DB2?Many PHP applications in the open source arenaThese application “talk” to MySQL by designModifying to access DB2 can be cumbersome & then updates?Zend DBi includes IBM DB2 Storage EngineTwo instructions and you are there! © All rights reserved. Zend Technologies, Inc.
  • 39. Architecture © All rights reserved. Zend Technologies, Inc.
  • 40. How to installFrom the MySQL Monitor in QSH or QP2TERMNow go to phpMyAdmin and select the engine © All rights reserved. Zend Technologies, Inc.
  • 41. IBM DB2 Storage Engine:phpMyAdminCreate Table, set number of fieldsSelect storage engine © All rights reserved. Zend Technologies, Inc.
  • 42. phpMyAdmin gives you the SQL! © All rights reserved. Zend Technologies, Inc.
  • 43. Add records to table © All rights reserved. Zend Technologies, Inc.
  • 44. What happened on the i?Library test was createdTable was createdRecords populated © All rights reserved. Zend Technologies, Inc.
  • 45. Records, please?STRSQLSelect * from test/exampleDB2 © All rights reserved. Zend Technologies, Inc.
  • 46. IBM Redbook and Redpiece Discovering MySQL Using the DB2 Storage Engine © All rights reserved. Zend Technologies, Inc.
  • 47. Join us at ZendConThe premier PHP conference!October 22-25, 2012 – Santa Clara, CA Conference Themes Conference Highlights PHP in 2012 - The latest PHP technologies and tools • Sessions focused on how to best develop and deploy PHP Learn how to leverage the latest mobile, HTML 5, testing and PHP best practices • Sessions designed for all knowledge levels Zend Framework 2 - Hit the ground running • Intensive tutorials for accelerated learning Learn how to build faster, more modular and more expandable • PHP Certification crash courses and testing applications • Exhibit hall showcasing the latest products Development & The Cloud – A love story Learn how the latest developments in cloud-based services, • Special networking opportunities during meals and events infrastructure and best practices can benefit you www.zendcon.com © All rights reserved. Zend Technologies, Inc.
  • 48. Q&A www.zend.com mike.p@zend.com Please fill out your Session Evaluation!48 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.