Using IBM DB2 for I As a Storage Engine of Mysql
Total Page:16
File Type:pdf, Size:1020Kb
Front cover Using IBM DB2 for i as a Storage Engine of MySQL Discover how to configure and manage the IBMDB2I Storage Engine Integrate and consolidate MySQL and DB2 in one place Access PHP Applications data through native interfaces Hernando Bedoya Brad Bentley Xie Dan Dan Sadamitsu Hayakawa Shirley Pintos Guo Qi Morten Buur Rasmussen Satid Singkorapoom Wang Yun ibm.com/redbooks International Technical Support Organization Using IBM DB2 for i as a Storage Engine of MySQL March 2009 SG24-7705-00 Note: Before using this information and the product it supports, read the information in “Notices” on page vii. First Edition (March 2009) This edition applies to IBM i 6.1 © Copyright International Business Machines Corporation 2009. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices . vii Trademarks . viii Preface . ix The team that wrote this book . ix Become a published author . xi Comments welcome. xii Chapter 1. Overview . 1 1.1 MySQL on IBM i . 2 1.2 MySQL pluggable storage engine. 3 1.3 IBM DB2 for i Storage Engine for MySQL on IBM i. 5 Chapter 2. Architecture and functional support. 7 2.1 Architecture introduction . 8 2.2 DB2 for i SQL Server Mode . 9 2.3 Using the IBMDB2I Storage Engine . 10 2.3.1 Plugging in the storage engine . 10 2.3.2 Unplugging the storage engine . 10 2.3.3 Setting the storage engine . 11 2.3.4 MySQL metadata files when using IBMDB2I . 11 2.4 Comparison of MySQL and DB2 for i . 13 2.5 Usage notes for the IBMDB2I Storage Engine . 14 2.5.1 Supports available from IBMDB2I for MySQL. 14 2.5.2 Case-sensitive name mapping support for MySQL. 17 2.5.3 Object access control between IBMDB2I and native IBM i jobs . 17 2.5.4 Using System i Navigator database function with MySQL schemas. 18 2.6 IBMDB2I support for MySQL DDL and DML statements . 19 2.6.1 MySQL statements . 20 2.6.2 Column DEFAULT values. 24 2.7 Other factors in DB2 for i interoperability . 25 2.7.1 Effect of the IBM i commands on the MySQL tables. 25 2.7.2 Effect of DB2 for i SQL statements on MySQL tables. 26 2.8 Data type mapping from MySQL to IBMDB2I Storage Engine . 28 2.8.1 Data type mapping table . 28 2.8.2 IBMDB2I support for the MySQL UTF8 data. 29 2.8.3 A usage note on invalid data handling of MySQL column. 30 2.9 MySQL auto_increment column attribute . 30 2.10 National language support in IBMDB2I . 31 Chapter 3. Installing and configuring MySQL V5.1 Server on IBM i. 41 3.1 Packaging . 42 3.2 Product structure. 42 3.3 IBM i PASE, runtime environment. 44 3.3.1 File systems . 45 3.3.2 Shells and utilities . 45 3.3.3 Additional commands . 47 3.3.4 Additional information and links . 48 3.4 Installation and configuration of the MySQL Database Server on IBM i . 48 © Copyright IBM Corp. 2009. All rights reserved. iii 3.4.1 Checking the prerequisites . 48 3.4.2 Installing and configuring the MySQL Database Server on IBM i . 50 3.4.3 Verifying the installation . 59 3.4.4 Post installation tasks . 60 3.4.5 Installing the IBMDB2I Storage Engine plug-in component for MySQL . 63 3.4.6 Common installation and restoration errors . 64 3.4.7 Uninstalling the MySQL Database Server on IBM i . 64 3.5 Running additional same-release MySQL instances . 65 3.6 Installing additional MySQL instances of different releases . 69 Chapter 4. Implementation . 71 4.1 Finding objects in DB2 . 72 4.1.1 Libraries . 72 4.1.2 Tables . 75 4.1.3 Indexes . 75 4.1.4 Views . 76 4.1.5 Journal and journal receivers . 77 4.2 Accessing MySQL data. 77 4.2.1 Accessing MySQL data with DB2 tools. 77 4.2.2 Accessing MySQL data from RPG using embedded SQL . 77 4.2.3 Accessing MySQL data from RPG with native access . 78 4.2.4 Accessing MySQL data from Query/400. 79 4.2.5 Use of Copy File . 81 4.2.6 Updating MySQL data from CL commands . 81 4.3 DB2 updates of objects . 81 4.3.1 Renaming tables . 81 4.3.2 Altering tables . 81 4.3.3 Deleting tables . 81 4.3.4 Indexes . 81 4.3.5 Constraints . 82 4.3.6 Triggers. 82 Chapter 5. Configuration options and variables . ..