MySQL Workbench - Khoury College Of Computer Sciences

Transcription

MySQL Workbench

MySQL WorkbenchAbstractThis manual documents the MySQL Workbench SE version 5.2 and the MySQL Workbench OSS version 5.2.If you have not yet installed MySQL Workbench OSS please download your free copy from the download site. MySQLWorkbench OSS is available for Windows, Mac OS X, and Linux.For release notes detailing the changes in each release, see the MySQL Workbench Release Notes.For legal information, see the Legal Notices.Document generated on: 2013-01-16 (revision: 33964)

Table of ContentsPreface and Legal Notices . ix1. MySQL Workbench Introduction . 12. MySQL Workbench Editions . 33. Installing and Launching MySQL Workbench . 53.1. Hardware Requirements . 53.2. Software Requirements . 53.3. Starting MySQL Workbench . 63.3.1. Installing MySQL Workbench on Windows . 73.3.2. Launching MySQL Workbench on Windows . 73.3.3. Uninstalling MySQL Workbench on Windows . 83.3.4. Installing MySQL Workbench on Linux . 93.3.5. Launching MySQL Workbench on Linux . 93.3.6. Uninstalling MySQL Workbench on Linux . 93.3.7. Installing MySQL Workbench on Mac OS X . 103.3.8. Launching MySQL Workbench on Mac OS X . 103.3.9. Uninstalling MySQL Workbench on Mac OS X . 114. Getting Started Tutorial . 134.1. Administering a MySQL Server . 134.2. Creating a Model . 254.3. Adding Data to Your Database . 315. The Home Window . 355.1. Workbench Central . 365.2. Workspace . 375.3. Workbench Application Minimum Window Size . 375.4. Workbench Preferences . 375.4.1. The General Tab . 395.4.2. The Administrator Tab . 395.4.3. The SQL Editor Tab . 395.4.4. The Model Tab . 415.4.5. The MySQL Tab . 425.4.6. The Diagram Tab . 425.4.7. The Appearance Tab . 436. SQL Development . 456.1. Open Connection to Start Querying . 456.2. New Connection . 466.3. Edit Table Data . 466.4. Edit SQL Script . 466.5. Manage Connections . 466.6. Manage DB Connections Dialog . 466.6.1. The Password Storage Vault . 476.6.2. Standard TCP/IP Connection . 486.6.3. Local Socket/Pipe Connection . 496.6.4. Standard TCP/IP over SSH Connection . 506.7. SQL Editor . 506.7.1. Main Menu . 516.7.2. Toolbar . 536.7.3. SQL Query Panel . 536.7.4. Main Tabsheets . 546.7.5. Sidebar . 577. Data Modeling . 637.1. Open an Existing EER Model . 64iii

MySQL Workbench7.2.7.3.7.4.7.5.Create New EER Model . 64Create EER Model from Existing Database . 64Create EER Model from SQL Script . 64Model Editor . 657.5.1. Modeling Menus . 667.5.2. The Toolbar . 767.5.3. EER Diagrams . 777.5.4. The Physical Schemata Panel . 777.5.5. The Schema Privileges Panel . 787.5.6. The SQL Scripts Panel . 797.5.7. The Model Notes Panel . 797.5.8. The History Palette . 797.5.9. The Model Navigator Panel . 807.5.10. The Catalog Tree Palette . 807.5.11. The Layers Palette . 817.5.12. The Properties Palette . 817.6. EER Diagram Editor . 827.6.1. The Vertical Toolbar . 827.7. Working with Models . 867.7.1. Creating Tables . 867.7.2. Creating Foreign Key Relationships . 987.7.3. Creating Views . 1017.7.4. Creating Routines and Routine Groups . 1037.7.5. Creating Layers . 1077.7.6. Creating Notes . 1087.7.7. Creating Text Objects . 1097.7.8. Creating Images . 1107.7.9. Reverse Engineering . 1117.7.10. Forward Engineering . 1207.8. Modeling Tutorials . 1407.8.1. Importing a Data Definition SQL Script . 1417.8.2. Using the Default Schema . 1427.8.3. Basic Modeling . 1437.8.4. Documenting the sakila Database . 1447.9. Printing . 1467.9.1. Printing Options . 1467.10. MySQL Workbench Schema Validation Plugins (Commercial Version) . 1467.10.1. General Validation . 1467.10.2. MySQL-Specific Validation . 1477.11. The DBDoc Model Reporting Dialog Window (Commercial Version) . 1487.12. Customizing DBDoc Model Reporting Templates . 1517.12.1. Supported Template Markers . 1557.12.2. Creating a Custom Template . 1588. Generating code overview . 1638.1. Generating SQL queries . 1638.2. Generating PHP code . 1639. Server Administration . 1659.1. Server Administration . 1659.2. New Server Instance . 1669.3. Manage Data Import/Export . 1669.4. Manage Security . 1669.5. Manage Server Instances . 1669.6. Creating and Managing Server Instances . 1669.6.1. New Server Instance Wizard . 166iv

MySQL Workbench9.6.2. Manage Server Instances Dialog .9.7. Server Administration and Configuration .9.7.1. The Startup Tab .9.7.2. The Configuration Tab .9.7.3. The Accounts Tab .9.7.4. The Connections Tab .9.7.5. The Variables Tab .9.7.6. The Data Dump Tab .9.7.7. The Logs Tab .10. Database Migration Wizard .10.1. General installation requirements .10.1.1. ODBC Libraries .10.1.2. ODBC Drivers .10.2. Migration Overview .10.2.1. A visual guide to performing a database migration .10.2.2. Migrating from supported databases .10.2.3. Migrating from unsupported (generic) databases .10.3. Conceptual DBMS equivalents .10.4. Microsoft SQL Server migration .10.4.1. Preparations .10.4.2. Drivers .10.4.3. Connection Setup .10.4.4. Microsoft SQL Server Type Mapping .10.5. PostgreSQL migration .10.5.1. Preparations .10.5.2. Drivers .10.5.3. Connection Setup .10.5.4. PostgreSQL Type Mapping .10.6. MySQL migration .10.7. Using the MySQL Workbench Migration Wizard .10.7.1. Connecting to the databases .10.7.2. Schemata Retrieval and Selection .10.7.3. Reverse Engineering .10.7.4. Object Selection .10.7.5. Migration .10.7.6. Manual Editing .10.7.7. Target Creation Options .10.7.8. Schema Creation .10.7.9. Create Target Results .10.7.10. Data Migration Setup .10.7.11. Bulk Data Transfer .10.7.12. Migration Report .10.8. MySQL Workbench Migration Wizard FAQ .11. Extending Workbench .11.1. GRT and Workbench Data Organization .11.2. Modules .11.3. Plugins .11.4. Adding a GUI to a Plugin Using MForms .11.5. The Workbench Scripting Shell .11.5.1. Exploring the Workbench Scripting Shell .11.5.2. The Shell Window .11.5.3. The Files, Globals, Classes, and Modules Tabs .11.6. Tutorial: Writing Plugins .12. Keyboard Shortcuts 17218219220223

MySQL Workbench13. MySQL Utilities . 22713.1. Introduction . 22713.1.1. Introduction to MySQL Utilities . 22713.1.2. Connection Parameters . 22813.1.3. Introduction to extending the MySQL Utilities . 22913.2. Commands . 23513.2.1. mysql.utilities.command.grep — Search Databases for Objects . 23513.2.2. mysql.utilities.command.proc — Search Processes on Servers . 23613.3. Manual Pages . 23813.3.1. MySQL Utilities Overview — Brief overview of command-line utilities . 23813.3.2. mut — MySQL Utilities Testing . 24013.3.3. mysqldbcompare — Compare Two Databases and Identify Differences . 24313.3.4. mysqldbcopy — Copy Database Objects Between Servers . 24913.3.5. mysqldbexport — Export Object Definitions or Data from a Database . 25313.3.6. mysqldbimport — Import Object Definitions or Data into a Database . 26013.3.7. mysqldiff — Identify Differences Among Database Objects . 26313.3.8. mysqldiskusage — Show Database Disk Usage . 26713.3.9. mysqlfailover — Automatic replication health monitoring and failover . 27113.3.10. mysqlindexcheck — Identify Potentially Redundant Table Indexes . 27713.3.11. mysqlmetagrep — Search Database Object Definitions . 28013.3.12. mysqlprocgrep — Search Server Process Lists . 28313.3.13. mysqlreplicate — Set Up and Start Replication Between Two Servers . 28613.3.14. mysqlrpladmin — Administration utility for MySQL replication . 29013.3.15. mysqlrplcheck — Check Replication Prerequisites . 29713.3.16. mysqlrplshow — Show Slaves for Master Server . 30013.3.17. mysqlserverclone — Clone Existing Server to Create New Server . 30313.3.18. mysqlserverinfo — Display Common Diagnostic Information from a Server . 30513.3.19. mysqluc — Command line client for running MySQL Utilities . 30713.3.20. mysqluserclone — Clone Existing User to Create New User . 31013.4. Parsers . 31213.4.1. mysql.utilities.parser — Parse MySQL Log Files . 312A. Third Party Licenses . 315A.1. .NET Flat TabControl License . 316A.2. ANTLR 3.4 License . 317A.3. Bitstream Vera License . 317A.4. Boost Library License . 318A.5. Cairo License . 319A.6. CTemplate (Google Template System) License . 319A.7. cURL (libcurl) License . 320A.8. DockPanel Suite License . 320A.9. Dojo Toolkit v1.7.0b1 License . 321A.10. GLib License (for MySQL Workbench) . 321A.11. Glitz License . 321A.12. GNU Lesser General Public License Version 2.1, February 1999 . 322A.13. HtmlRenderer (System.Drawing.Html) . 330A.14. iODBC License . 330A.15. Libiconv License . 331A.16. Libintl License . 332A.17. Libxml2 License . 332A.18. Libzip License . 333A.19. Lua (liblua) License . 333A.20. Paramiko License . 334A.21. PCRE License . 334A.22. Pixman License . 335vi

MySQL WorkbenchA.23. PyCrypto License .A.24. PyODBC License .A.25. Python License .A.26. Scintilla License .A.27. ScintillaNET License .A.28. TinyXML License .A.29. TreeViewAdv for .NET License .A.30. VSQLite License .A.31. zlib License .B. MySQL Workbench FAQ .C. MySQL Workbench and Utilities Change History .C.1. MySQL Workbench Change History .C.2. MySQL Utilities Change History .vii337337338348350350351351352353355355355

viii

Preface and Legal NoticesThis is the User Manual for the MySQL Workbench.For license information, see the Legal Notices. This product may contain third-party code. For licenseinformation on third-party code, see Appendix A, Third Party Licenses.Legal NoticesCopyright 2006, 2013, Oracle and/or its affiliates. All rights reserved.This software and related documentation are provided under a license agreement containing restrictionson use and disclosure and are protected by intellectual property laws. Except as expressly permittedin your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast,modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by anymeans. Reverse engineering, disassembly, or decompilation of this software, unless required by law forinteroperability, is prohibited.The information contained herein is subject to change without notice and is not warranted to be error-free.If you find any errors, please report them to us in writing.If this software or related documentation is delivered to the U.S. Government or anyone licensing it onbehalf of the U.S. Government, the following notice is applicable:U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation andtechnical data delivered to U.S. Government customers are "commercial computer software" or

MySQL Utilities Change History . 355. viii. ix Preface and Legal Notices This is the User Manual for the MySQL Workbench. For license information, see the Legal Notices. This product may contain third-party code. For license information on th