Home

MySQL Workbench 5.2 - MySQL Community Downloads

image

Contents

1. 22 Ensure that your model is saved Click Save Model to Current File on the main toolbar 5 3 Adding Data to Your Database In the previous section you created a model schema and table You also forward engineered your model to the live server In this section you will see how you can use MySQL Workbench to add data into your database on the live server 1 On the Home window click the link Edit Table Data in the SQL Development area of the Workspace This launches Edit Table Data wizard 44 Adding Data to Your Database Figure 5 19 Getting Started Tutorial Edit Table Data aS eens BONO E What s New in This Release O bo Ee about all changes in this MySQL Workbench release Workspace SQL Development Server Administration QQ dit data and whe status variables manage da Ont and C3 Open Connection to Start Querying gt Open Easting EER Model E Server Administration 7 ee Local instance MySQL5S B Home_media GE User rost Host weamost 3308 Last modified Thu Dec 01 16 50 54 2011 fe New Connection amp New Server Instance m Table Data He Create New EER Model gA Manage Import Export 4 CO se Create EER Model From Exasting Database OV amp e Manage Connections Create EER Model From SQL Script ig Manage Server Instances 2 Inthe wizard select the Big Iron Server connection from the stored connection list Click Next 3 Select the schema dvd_collection Select the table to edit
2. ccceceeeeeeeeeaeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaneneeeees 220 TAG 2 MYSQL MIQration biisi iieaoe annann A Eaa iy dea E ANA aE NEA 222 11 7 Using the MySQL Workbench Migration Wizard sesssseseesssenessssessrsrrrrrresssrsrrrrrrens 222 11 7 1 Connecting to the databases cceceeceeceeeeeee ects ee ae aaeeeeeeeeeeeeaeaaeeneeeeeeeeeaeaae 222 11 7 2 Schemata Retrieval and Selection cc ceeeceeeeeeeee ce aeeeeeeeeeeeeeseaaeaeeeeeeeeeeeeaaa 222 11 7 3 Reverse Engineering 00 cccceeeee ce eeee ee ee eeee ee ee eeee E RAPANA EA KERA ARAARA 222 V7 A Object SCISCHON aie sices ence ciecwasieed aranna n a a aaa 222 TECO Migration sosise kioisess EE R E E AS E R 223 AAs 726s Ma nual EGIN eiin E T TAT 223 11 7 7 Target Creation Options Sossio idani inan iaaea EAEAN EA 223 11 7 8 SCHEMA Creaton snseriresies samien R E a E aS 223 11 7 9 Create Target Results visecc2crcdseiasecsensgeceseutieedsanng cceartiauidsansgecestuieeedeaaseetelannadingys 223 11 7 10 Data Migration Setup 0 0 0 0 cece ceee cece cece ae aa eeeeeeeeeeeeeeaaeaaeeeeeeeeeeaaaaaeeeeeeeeees 224 T1741 Bulk Data Transten aianei nat beiabcee eee ieee ea 224 TL12 Migration Repo essnee 224 11 8 MySQL Workbench Migration Wizard FAQ ssssessssssssissesssssrrirnrsrssrsrrrrnrerssssnrrrnrns 224 12 Extending WOrkDeNGM seriata E cioeiaweneeedae i S 225 12 1 GRT and Workbench Data Organization 0 cccceeeceeeeeeeeeeeeeeeeee
3. destination serverl1 ALTER TABLE dbl tablel ADD COLUMN notes char 30 AFTER a CHANGE COLUMN misc misc char 55 destination server2 ALTER TABLE dbx table3 DROP COLUMN notes CHANGE COLUMN misc misc char 30 Compare failed One or more differences found 14 4 9 mysqldiskusage Show Database Disk Usage This utility displays disk space usage for one or more databases The utility optionally displays disk usage for the binary log slow query log error log general query log relay log and InnoDB tablespaces The default is to show only database disk usage If the command line lists no databases the utility shows the disk space usage for all databases Sizes displayed without a unit indicator such as MB are in bytes The utility determines the the location of the data directory by requesting it from the server For a local server the utility obtains size information directly from files in the data directory and InnoDB home directory In this case you must have file system access to read those directories Disk space usage shown includes the sum of all storage engine specific files such as the MYI and MYD files for MyISAM and the tablespace files for InnoDB If the file system read fails or if the server is not local the utility cannot determine exact file sizes It is limited to information that can be obtained from the system tables which therefore should be considered an estimate For informa
4. 245 14 3 2 mysql utilities command proc Search Processes on Servers 246 MySQL Workbench 5 2 14 4 14 5 14 6 14 7 Manual Pages ecer k uy cectanieedenstseecstantvencans EARE 14 4 1 MySQL Utilities Overview Brief overview of command line utilities 14 4 2 mysqlauditadmin Allows users to perform maintenance action on the aud OG eoa cc trenee cen Seng ce osha el eden eten etyeatces ae ea cet eater ete a cen apace ee 14 4 3 mysqlauditgrep Allows users to search the current or an archived audit TOG 23a 2 chsnarcnne E T E E E sent T E E E E E E A 14 4 4 mysqldbcompare Compare Two Databases and Identify Differences 14 4 5 mysqldbcopy Copy Database Objects Between Servers ceeeeeeeees 14 4 6 mysqldbexport Export Object Definitions or Data from a Database 14 4 7 mysqldbimport Import Object Definitions or Data into a Database 14 4 8 mysqldiff Identify Differences Among Database Objects 0 14 4 9 mysqldiskusage Show Database Disk Usage ccccceeseeeeeeeeeeeeeeenees 14 4 10 mysql failover Automatic replication health monitoring and failover 14 4 11 mysqlindexcheck Identify Potentially Redundant Table Indexes 14 4 12 mysqlimetagrep Search Database Object Definitions ccccceeeeeeeees 14 4 13 mysqlprocgrep Search S
5. After the connection parameters have been set click Execute The next page of the wizard displays the results of the forward engineering process 147 Forward Engineering Figure 8 38 Forward Engineering Progress Options Forward Engineering Progress Select Objects Review SQL Script The following tasks will now be executed Please monitor the execution Press Show Logs to see the execution logs Connection Options Connect to DEMS Execute Forward Engineered Script Commit Progress Forward Engineer Finished Successfully You can confirm that the script created the schema by connecting to the target MySQL server and issuing a SHOW DATABASES statement 8 7 10 3 Database Synchronization It is possible to synchronize a model in MySQL Workbench with a live database By default the synchronization process will change the live database to be the same as the model but this is configurable during the synchronization process Caution A Because MySQL databases correspond to directories within the data directory you must consider case sensitivity for database table and trigger names which follow the case sensitivity rules of the underlying file system for your operating system Synchronizing models with objects that differ in case may lead to MySQL Workbench producing a DROP statement for that object before recreating it as lowercase For more information see Identifier Case Sensitivity Workarounds include
6. 4 4 4 STATUS SERVER_ID NAME TIMESTAMP CONNECTION_ID USER PRIV USER SQLTEX 4 4 4 4 4 4 4 0 2 Oaery 2012 09 28T1ts26250 10 Soot Foot SET 4 4 4 4 4 14 4 4 mysqldbcompare Compare Two Databases and Identify Differences This utility compares the objects and data from two databases to find differences It identifies objects having different definitions in the two databases and presents them in a diff style format of choice Differences in the data are shown using a similar diff style format Changed or missing rows are shown in a standard format of GRID CSV TAB or VERTICAL Use the notation db1 db2 to name two databases to compare or alternatively just db1 to compare two databases with the same name The latter case is a convenience notation for comparing same named databases on different servers The comparison may be run against two databases of different names on a single server by specifying only the server1 264 option The user can also connect to another server by specifying the server2 264 option In this case db1 is taken from server1 and db2 from server2 Those objects considered in the database include tables
7. verbose v 264 mysqldbcompare Compare Two Databases and Identify Differences NOTES Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit e width lt number gt Change the display width of the test report The default is 75 characters The login user must have the appropriate permissions to read all databases and tables listed For the difftype 264 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example difftype d 264 specifies the differ type An error occurs if a prefix matches more than one valid value The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf If any database identifier specified as an argument contains special characters or is a reserved word then it must be appropriately quoted with backticks In turn names quoted with backticks must also be quoted with single or double quotes depending on the operating system i e in Windows or in non Windows systems in order for the
8. If the user does not specify the rpl user 813 and the user has specified the switchover or failover command the utility will check to see if the slaves are using master info repository TABLE If they are not the utility will stop with an error All the commands require either the s laves 313 or discover slaves login 312 option but both cannot be used at the same time In fact some commands only allow the use of the slaves 813 option which is safer to specify the list slaves because discover slaves login 312 might not provide an up to date list of available slaves The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To perform best slave election for a topology with GTID_ MODE ON server version 5 6 5 or higher where all slaves are specified with the slaves 313 option run the following command UV mysqlrpladmin master root localhost 3331 slaves root localhost 3332 root localhost 3333 root localhost 3334 elect Electing candidate slave from known slaves Best slave found is located on localhost 3332 icone To perform best slave election supplying a candidate list use the following command mysqlrpladmin mas
9. To add a foreign key click the last row in the Foreign Key Name list Enter a name for the foreign key and select the column or columns that you wish to index by checking the column name in the Column list You can remove a column from the index by removing the check mark from the appropriate column Under Foreign Key Options choose an action for the update and delete events The options are e RESTRICT e CASCADE e SET NULL e NO ACTION To drop a foreign key right click the row you wish to delete then select the Delete Selected FKs menu item To modify properties of a foreign key select it and make the desired changes 8 7 1 3 5 The Triggers Tab The Triggers tab opens a field for editing an existing trigger or creating a new trigger Create a trigger as you would from the command line 110 Creating Tables Figure 8 13 The Triggers Tab Triggers 1 Trigger DDL Statements 2 DELIMITER 3 4 USE sakila ss 5 6 CREATE 7 DEFINER root localhost 8 TRIGGER sakila customer_create_date 9 BEFORE INSERT ON sakila customer 10 FOR EACH ROW 11 SET NEW create_date NOw ss Columns Indexes Foreign Keys Partitioning Options 8 7 1 3 6 The Partitioning Tab To enable partitioning for your table check the Enable Partitioning check box This enables the partitioning options Figure 8 14 The Partitioning Tab Partitioning E Enable Partitioning Partition By v Parameters Partition Cou
10. 100 The Vertical Toolbar Figure 8 7 The Vertical Toolbar Diagram im dy v a TENUN Code CHAR 3 CountryCode CHAR 3 2 suabatatiites Name CHAR 52 Language CHAR 30 _ CARS Continent ENUM IsOfical ENUM TF na oe Region CHAR 26 Percentage FLOAT Population INT 11 BAROAT z z dl gt IndepY ear SMALLINT 6 aay T Population INT 11 LifeExpectancy FLOAT gt GNP FLOAT z gt GNPOld FLOAT Q LocdName CHAR 45 GovernmentForm CHAR 45 gt HeadOf tate CHAR 60 ER gt Capita INT 11 Code2 CHAR 2 gt 3 4 W Clicking a tool changes the mouse pointer to a pointer that resembles the tool icon indicating which tool is active These tools can also be activated from the keyboard by pressing the key associated with the tool Hover the mouse pointer over a toolbar icon to display a description of the tool and its shortcut key A more detailed description of each of these tools follows 8 6 1 1 The Standard Mouse Pointer The standard mouse pointer located at the top of the vertical toolbar is the default mouse pointer for your operating system Use this tool to revert to the standard mouse pointer after using other tools To revert to the default pointer from the keyboard use the Esc key 8 6 1 2 The Hand Tool The hand tool is used to move the entire EER diagram Left click on this tool and then left click anywhere on the EER diag
11. 18 In the table editor change the name of the column movie_title to title Note that the EER Diagram is automatically updated to reflect this change At this point you can save your model Click the main toolbar button Save Model to Current File You have not yet saved this file so you will be prompted to enter a model file name For this tutorial enter Home_Media The Home_Media model may contain further schemata in addition to dvd_collection such aS cd_collection Click Save to save the model You can synchronize your model with the live database server First you must tell MySQL Workbench how to connect to the live server From the main menu select Database Manage Connections In the Manage DB Connections dialog click New Enter Big Iron Server for the connection name This enables you to identify the server to which this connection corresponds although it is possible to create multiple connections to the same server Enter the user name for the account you will use to connect to the server Click on the Store in Vault button and enter the password for the user name you entered in the previous step You can optionally ignore this step and you will be prompted for this password whenever MySQL Workbench connects to the server Click Test Connection to test your connection parameters If everything is okay at this point you can click Close Figure 5 17 Getting Started Tutorial Manage Conn
12. 648 4240 7d7a 1le0 870b 89c43de3bd0a Once you have the new GUID values edit the info xm1 file accordingly Edit the textual information for the TemplateInfo and TemplateStyleInfo objects to reflect the purpose of the custom template The modified file will now look something like the following lt xml version 1 0 gt lt data gt lt value type object struct name workbench model reporting TemplateInfo id cac9ba3f ee2a 49f0 b5f6 32580fab1640 struct checksum 0xb46b524d gt lt value type string key description gt Custom basic TEXT report listing schemata and objects lt value gt lt value type string key name gt Custom Basic text report lt value gt lt value type list content type object content struct name workbench model reporting TemplateStyleInfo key styles gt lt value type object struct name workbench model reporting TemplateStyleInfo id 39e3b767 a832 4016 8753 b4cb93aaz2dd6 struct checksum 0xab08451b gt 174 Creating a Custom Template lt value type string key description gt Designed to be viewed with a fixed sized font lt value gt lt value type string key name gt Fixed Size Font lt value gt lt value type string key previewImageFileName gt preview_basic png lt value gt lt value type sString key styleTagValue gt fixed lt value gt lt value gt lt value gt lt value type String key
13. A 1 NET Flat TabControl License eseseeeeeenenesennrnnerernrnrrsnnnrrrniurernnnrsinrenrnrenennnnnnnne ANTER LICONS E iaaa anna anaana a aa AEA AE AE EEEE EA E AAA EA AA eaa ARE KOAA Aai Bitstream Vera LICENSE vcctecacteensaseoscartnaeecesansen cantnenddessmnvacaataevardatuseacenaceacusanheacentaabendes BOOSE LiDrary LICCNSE eseistik A RA Garo LICENSE epean EEE ANENE AEREA AL NS CTemplate Google Template System License cccceeeeeeeeeeeeeeeaeeeeeeeeeeeeeeeaeaaeeees JOUR Ii nenr 1 LCOS O eia R T E Oe atenciuendeaseteel outs DockPanel Suite LIGENS iiccascwiecidavnseecaanndeceaansiaeesansnieenannaten KRAN RNEER EANES KRENKE KRE AR RAREN Dojo Toolkit v1 7 061 LIC NSE 2 20 nir E GLib License for MySQL Workbench 0 ccceceeeeeeeeeeeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaeaaeeaes OZ LICENSE carura E cde cence ee Cae ta shee eae eve eae een GNU Lesser General Public License Version 2 1 February 1999 n n HtmlRenderer System Drawing Html cccceeeeeeeeeeeeeeeaaeeeeeeeeeeeeaeaaeeneeeeeeeeeaeaaeeees ODBC LIGENSC ssxs2estetsseasaveedese ta tatescivoddeyia EE sex AA a E a SAE R seia beet la al AEE EA s LIDICONY LICONSO cran or aE A A TT EIDINU LICENSE isieseestsseisennsannanseia e ainan aeania E A EEEE NAERA NARE AAAA SID XMM LICENSE iran E E T E a LipZIO LICCASE seisear inoseni E EERE E KESAN AE KEDR ENEA ALga Mua SLICC NSS so a TE E E Paramiko LICENSE ses srisuedeateccteladpannaitnnces
14. Match any character excepta x or y a Match a sequence of zero or more a a Match a sequence of one or more a a Match zero or one a ab cd Match ab or cd a 5 Match five instances of a a 2 5 Match from two to five instances of a abc Match one or more repetitions of abc This is but a brief set of examples of regular expressions The full syntax is described in the MySQL manual but can often be found in regex 7 301 mysqlmetagrep Search Database Object Definitions OPTIONS NOTES mysqimetagrep accepts the following command line options help Display a help message and exit body b Search the body of stored programs procedures functions triggers and events The default is to match only the name database lt pattern gt Look only in databases matching this pattern format lt format gt f lt format gt Specify the output display format Permitted format values are grid csv tab and vertical The default is grid object types lt types gt search objects lt types gt Search only the object types named in types which is a comma separated list of one or more of the values procedure function event trigger table and database The default is to search in objects of all types pattern lt pattern gt e lt pattern gt The pattern to use when matching This is required when the first nonoption argument looks like a connection specificatio
15. North America Caribbean 800 00 2170 ARE United Arab E Asia Middle East 83600 00 1971 2441 ARG Argentina South America South America 2780400 00 1816 3703 ARM Armenia Asia Middle East 29800 00 1991 3520 ASM American Samoa Oceania Polynesia 199 00 mm 6800 ATA Antarctica Antarctica Antarctica 13120000 00 0 French Southe Antarctica Antarctica 7780 00 0 Antigua and B North America Caribbean 442 00 1981 Australia Oceania Australia and 7741220 00 1901 Austria Europe Western Europe 83859 00 1918 gt gt gt gt Country 1 Apply Action Output Time Action Response Duration Fetch Time 12 40 35 drop schema example_source Changes applied 12 40 40 drop schema f Changes applied 12 40 45 drop schema new_schema3 Changes applied 12 41 48 Apply changes to phpbugsdb No changes detected 12 44 08 drop schema phpbugsdb Changes applied The SQL Editor user interface has these main elements e Main Menu Toolbar SQL Query Panel Main Tabsheets Overview Output History Snippets Results e Sidebar Auto completion in the Main Menu The following sections describe each of these elements 7 7 1 Main Menu When an SQL Editor tab is selected the most important items on the main menu bar are the Query and Edit menus Query Menu The Query menu features the following items e Execute All or Selection Executes all statements in the SQL Query area or only the selected statements e Ex
16. Review Settings The modified settings may be reviewed which also includes the default values Check the Change Parameters checkbox if the MySQL Config File section will be edited and then click Next to continue MySQL Config File Allows configuration of the MySQL server version It also allows the editing and validation of the configuration file path and validation of the server instance section Click Next to continue Specify Commands This page enables you to set the commands required to start stop and check the status of the running server instance It is possible to customize the commands if required but the defaults should be suitable in most cases The defaults are set based on the options selected in the Operating System page of the wizard Click Next to continue Complete Setup On this page you finally assign a name to the server instance This name is used in various parts of the GUI to enable you to refer to this instance After setting a suitable name click Finish to save the instance 10 6 2 Manage Server Instances Dialog The Manage Server Instances dialog enables you to create delete and manage server instances The Connection tab of the wizard enables you to select a predefined connection to use for connecting to a server to be managed It is also possible to connect to a remote server using an SSH connection 182 Manage Server Instances Dialog Figure 10 1 Manage Server Instances Dialog
17. The Data Dump Tab Figure 10 11 Administrator Import from Disk SSS _ MySQL Workbench Task and Object Browser MANAGEMENT 6 Server Status J Startup Shutdown E Status and System Variables A Server Logs CONFIGURATION ra Options File SECURITY Users and Privileges DATA EXPORT RESTORE Data Export and Restore WB Admin Opened Admin mysqld 127 0 0 1 X File Edit View Database Plugins Scripting Community Help Data Export and Restore Export to Disk Import from Disk Advanced Export Options Options Import from Dump Project Folder Select the Dump Project Folder to import You can do a selective reste Folder Path C Users Tony Documents dumps Load Folder Contents Import from Self Contained File File Path C Users Tony Documents dumps export sql Press Start Import to start Select Database Objects to Import only available for Project Folders Schema Statistics Import Tables in Schema Select All Tables Unselect Al 10 7 6 3 Advanced Export Options The Advanced Export Options tab contains a number of options to enable you to control the export operation These options control the SQL generated during the operation 195 The Logs Tab Figure 10 12 Administrator Advanced Options Admin mysqld 127 00 1 x File Edit View Database Plugins Scripting Community Help Task and Object Browser Data Export and Restore MANAGEMENT 6 Server
18. to indicate there are additional GTIDs to view You can view the complete list of GTIDs on the GTID display screens The default interface will display the replication health report like the following In this example the log file is enabled A sample startup command is shown below mysqlfailover master root localhost 3331 discover slaves login root log log txt MySQL Replication Monitor and Failover Utility Failover Mode auto Next Interval Mon Mar 19 15 56 03 2012 Master Information Binary Log File Position Binlog Do_DB Binlog Ignore_DB mysql bin 000001 571 GTID Executed Set 2A67DE00 2DA1 11R2 A711 00764F2BE90F 1 7 Replication Health Status 4 4 4 4 4 host port role state gtid_mode health 4 4 4 4 4 4 eliocallhosta posol MASTER UP ON OK Ielocalhosta sss2 SLAVE UP ON OKs lio callhositum pesos SLAVE UP ON IROK localhost 3334 SLAVE UP ON OK 4 4 4 4 4 4 Q quit R refresh H health G GTID Lists U UUIDs L log entries Pressing the q key will exit the utility Pressing the r key will refresh the current display Pressing the h key will return to the replication health report If the user presses the g key the gtid report is shown like the following The first pag
19. 9 You can also carry out a similar check from within MySQL Workbench Click on the Home window tab 10 Click the link Open Connection to start Querying in the SQL Development section of the Workspace This will launch the Connect to Database dialog Select Big Iron Server from the list Click OK 11 A new SQL Editor tab will be displayed In the SQL Statements area enter the following code USE dvdlcollection SELECT FROM movies 12 Now click the Execute toolbar button This resembles a small lightning bolt The SQL Editor will display a new Result tab contain the result of executing the SQL statements 46 Adding Data to Your Database Figure 5 21 Getting Started Tutorial Results Guiry Faces 2 USE dvd collection 20 SELECT FROM movies ber yy Aone TF releone _date Gene wen te Wind 19990417 The Hound of the Baskerv es 1939 0331 The Matix HOD Above te Law 1968 0448 Action Outpt Tre Acton 1 190521 USE d colection 2 190521 SELECT FROM movies LIMIT 1000 In this section of the tutorial you have learned how to add data to your database and also how to execute SQL statements using MySQL Workbench 47 48 Chapter 6 The Home Window Table of Contents 6 1 Workbench Central cscs adodson Dictate la a idle etadnaitial fue ineade i a N L wediveed Bie WOLKSPACE EA E E E cave SEE E E ess he wee EE T hua Ver ands cc wae eS kee OG 6 3 Workbench Application Minimum
20. Copyrom 99S S99 SAuGomatiaixg lnc uc E NESES Ery eds Author Skip Montanaro Copyright 1991 1995 Stichting Mathematisch Centrum all rights reserved Permission to use copy modify and distribute this Python software and its associated documentation for any purpose without fee is hereby granted provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of neither Automatrix Bioreason or Mojam Media be used in advertising or publicity pertaining to distribution of the software without specific written prior permission UUencode and UUdecode functions The uu module contains the following notice Copyright 1994 by Lance Ellinghouse Cathedral City California Republic United States of America All Rights Reserved Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of Lance Ellinghouse not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVEN
21. Display a help message and exit 268 mysqldbcopy Copy Database Objects Between Servers default storage engine lt def_engine gt The engine to use for tables if the destination server does not support the original storage engine on the source server destination lt destination gt Connection information for the destination server in the format lt users lt passwa gt lt host gt lt port gt lt sockets or lt ogin path gt lt port gt lt socket gt where lt passwd gt is optional and either lt port gt or lt socket gt must be provided exclude lt exclude gt x lt exclude gt Exclude one or more objects from the operation using either a specific name such as db1 t1 or a search pattern Use this option multiple times to specify multiple exclusions By default patterns use LIKE matching With the regexp 269 option patterns use REGEXP matching This option does not apply to grants force Drop each database to be copied if exists before copying anything into it Without this option an error occurs if you attempt to copy objects into an existing database locking lt locking gt Choose the lock type for the operation Permitted lock values are no locks do not use any table locks lock all use table locks but no transaction and no consistent read and snapshot consistent read using a single transaction The default is snapshot new storage engine lt new_engine gt The
22. Found slave localhost 3331 Discovering slave at localhost 3333 Found slave localhost 3333 Discovering slave at localhost 3334 Found slave localhost 3334 Checking privileges Replication Topology Health 4 4 4 host port role state gtid_mode health 4 4 4 4 4 4 localhost 3332 MASTER UP ON OK localhost S3531 SLAVE UP ON Oks localhost 3333 SLAVE UP ON OK localhost S834 SLAVE UP ON OK 4 4 4 4 4 done 317 mysqlrplcheck Check Replication Prerequisites 14 4 16 mysql rplcheck Check Replication Prerequisites This utility checks the prerequisites for replication between a master and a slave These checks called tests are designed to ensure a healthy replication setup The utility performs the following tests 1 Is the binary log enabled on the master 2 Are there binary logging exceptions such as _do_db or _ignore_db settings If so display them 3 Does the replication user exist on the master with the correct privileges 4 Are there server_idconflicts 5 Is the slave connected to this master If not display the master host and port 6 Are there conflicts between the master info file on the slave and the values shown in SHOW SLAVE STA
23. If you have a task that is not met by these utilities or one that can be met by combining one or more of the utilities or even parts of the utilities you can easily form your own custom solution The following sections present an example of a custom utility discussing first the anatomy of a utility and then what the mysql utilities module library has available Anatomy of a MySQL Utility MySQL Utilities use a three tier module organization At the top is the command script which resides in the scripts folder of the installation or source tree Included in the script is a command module designed to encapsulate and isolate the bulk of the work performed by the utility The command module resides in the mysql utilities command folder of the source tree Command modules have names similar to the script A command module includes classes and methods from one or more common modules where the abstract objects and method groups are kept The common modules reside in the mysql utilities common folder of the source tree The following illustrates this arrangement using the mysqiserverinfo utility scripts mysqlserverinfo py mysql utilities command serverinfo py an mysql utilities common options py an mysql utilities common server py ae mysql utilities common tools py ee mysql utilities common format py Each utility script is designed to process the user input and option settings and pass them on to the command module Thus the scr
24. Options force sw render Force Xlib rendering force opengl render Force OpenGL rendering e n Show command line options and exit Uninstalling MySQL Workbench on Linux The procedure for uninstalling MySQL Workbench on Linux depends on the package you are using Uninstalling DEB packages To uninstall a Debian package use this command 23 Installing MySQL Workbench on Mac OS X shell gt sudo dpkg r mysql workbench oss This command does not remove the configuration files If you wish to also remove the configuration files use this command shell gt sudo dpkg purge mysql workbench oss Uninstalling RPM packages To uninstall an RPM package use this command shell gt sudo rpm e mysql workbench oss This command does not remove the configuration files 4 3 7 Installing MySQL Workbench on Mac OS X MySQL Workbench for Mac OS X is distributed as a DMG file The file is named mysql workbench oss version osx10 5 i1686 dmg where version is the MySQL Workbench version To install MySQL Workbench on Mac OS X download the file Double click the downloaded file You will be presented with the installation window Figure 4 1 MySQL Workbench Mac OS X Installation Window AAO MySQL Workbench x 2 items 5 6 MB available ON Workbench Visual Database Design For Professionals ia A gt gt A MySQLWorkbench Applications To install the applications drag the MySQL Workbench icon to your Appli
25. Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE A 28 TinyXML License The following software may be included in this product TinyXML TinyXML is released under the zlib license This software is provided as is without any express or implied warranty In no event will the authors be held liable for any damages arising from the use of this software Permission is granted to anyone to use this software for any purpose including commercial applications and to alter it and redistribute it freely subject to the following restrictions 1 The origin of this software must not be misrepresented you must not claim that you wrote the original software If you use this software in a product an acknowledgment in the product documentation would be apprecia
26. PostgreSQL 8 0 and greater 212 Migrating from unsupported generic databases e Sybase Adaptive Server Enterprise 15 x and greater 11 2 3 Migrating from unsupported generic databases Most ODBC compliant databases may be migrated using the generic database support In this case code objects will not be retrieved from the source database only tables and data When using the generic support column datatypes are mapped using the following steps 1 It searches for the first entry in the Generic Datatype Mapping Table for the source type name If the length scale ranges of the entry matches the source column it will pick that type Otherwise it continues searching 2 If no matches were found in the generic table then it tries to directly map the source type to a MySQL type of the same name 3 If the source type name doesn t match any of the MySQL datatypes thenit will not be converted and an error is logged You can then manually specify the target datatype in the Manual Object Editing step of the wizard 11 3 Conceptual DBMS equivalents Table 11 1 Conceptual equivalents between supported DBMS products and MySQL Concept MS SQL Sybase PostgreS lySQL Note Server ASE Authentication Yes Yes Yes Yes Auto_Increment Yes Yes Yes Yes PostgreSQL uses sequences for Auto_Increment Backup Yes Yes Yes Yes See MySQL Enterprise Backup Catalog Yes Yes Yes N A You can map a catalog into a schema and drop the
27. Select Sources Select Sources to Compare Source for Left Catalog Model Schemata Live Database Server Source for Right Catalog Model Schemata Live Database Server O Script File Browse You then proceed through the wizard providing connection information if accessing a live database The wizard then produces a catalog diff report showing the differences between the compared catalogs 155 Modeling Tutorials Figure 8 46 Catalog Diff Report Compare and Report Differences in Catalogs Select Sources Differences Found in Catalog Comparison Connection Options Connect to DBMS Se Catalog Diff Report Select Schemata eee Table mydb table was dropped Fetch Object Info Table mydb table was dropped Table mydb table3 was modified foreign keys added foreign key fk_table3_table41 with columns table4_idtable4 referred table table4 with columns idtable4 action on update NO ACTION action on delete NO ACTION removed foreign key tk_table3_table41 End of MySQL Workbench Report Differences Report 8 8 Modeling Tutorials This chapter contains three short tutorials intended to familiarize you with the basics of MySQL Workbench These tutorials show how MySQL Workbench can be used both to design and to document databases Creating a database from scratch is the focus of Section 8 8 2 Using the Default Schema and exploring the graphi
28. e SQL extensions specific to MySQL Cluster are not supported For the difftype 284 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example difftype d 284 specifies the differ type An error occurs if a prefix matches more than one valid value The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf If any database object identifier specified as an argument contains special characters or is a reserved word then it must be appropriately quoted with backticks In turn names quoted with backticks must also be quoted with single or double quotes depending on the operating system i e in Windows or in non Windows systems in order for the utilities to read backtick quoted identifiers as a single argument For example to show the difference between table weird table1 from database weird db name and table weird table2 from database other weird db name the objects pair must be specified using the following syntax in non Windows weird db name weird table1 other weird db name weird table2 EXAMPLES To compare the employees and emp databases on the loca
29. e The left button displays database objects as large icons e The middle button displays small icons in multiple rows e The right button displays small icons in a single list 8 5 4 1 The Schema Objects Panel The Physical Schemata panel has the following sections e Tables e Views e Routines e Routine Groups Each section contains the specified database objects and an icon used for creating additional objects Any database objects added to an EER diagram canvas also show up in the Physical Schemata section For information about adding objects to an EER diagram canvas see Section 8 6 EER Diagram Editor 8 5 5 The Schema Privileges Panel The Schema Privileges panel has the following sections used to create users for your schemata and to define roles 96 The Schema Privileges Panel e Users Roles The following image displays the Schema Privileges section of the MySQL Model tab Figure 8 4 Roles and Privileges Y Schema Privileges Users 2 items Add User pal stefan Roles 2items Add Role admin docs 8 5 5 1 Adding Roles To add a role double click the Add Role icon This creates a role with the default name role Right clicking a role opens a pop up menu with the following items e Cut role_name Cuts the role e Copy role_name Copies the role Edit Role Opens the role editor e Edit in New Window Opens the role editor in a new editor window e Delete role_name
30. 11 7 10 Data Migration Setup 2 0 0 cece ec ee cece eee ea eeee eter tees ae aa ea eeeeeeeeeeeeaaaaeeneeeeeeeeeaeaaeeees 224 11711 Bulk Data TranSter ici ccccedscctis becebedeedseetine nE E eae 224 T7212 MIQration REDON wiscsecctccsedcanccwcinas REE REE TERNER EE chien ERNER REONE REA Ee 224 11 8 MySQL Workbench Migration Wizard FAQ ssessssessssssesssssrrirrrssssrsrrrrrrerssssrrrrrrerssssrrrrrnnt 224 MySQL Workbench provides the ability to migrate ODBC compliant databases to MySQL The MySQL Workbench Migration Wizard was added in MySQL Workbench 5 2 41 e Convert migrate different database types including MySQL across servers e Convert tables and copy data but will not convert stored procedures views or triggers e Allows customization and editing during the migration process e Works on Linux Mac OS X and Microsoft Windows This is not an exhaustive list The following sections discuss these and additional migration capabilities Set up may be the most challenging aspect of using the MySQL Workbench Migration Wizard There is the installation section which describes setting up ODBC requirements for Linux Mac OS X and Microsoft Windows and the Database Product Specific Notes section that references setup conditions for each RDBMS 199 General installation requirements 11 1 General installation requirements The MySQL Workbench Migration Wizard uses ODBC to connect to a source database except for MySQL You
31. 8 5 1 10 1 System Info Use the System Info menu item to display information about your system This item is especially useful for determining your rendering mode Sample output follows read_mysql_cfg_file C Program Files MySQL MySQOL Server 5 1 my ini RG rmpmtabilemsazc OMe a myisam_sort_buffer_size 18M table cachet 2560 Irceadi rnd butter size 256R porto 20E mer comnecedems AOO innodb_buffer_pool_size 18M myi Sein max sort iene sage YOO sql mode STRICT_TRANS_TABLES NO_AUTO_CREATE_USER NO_LENGINE_SUBSTITUTION basedir C Program Files MySQL MySQL Server 5 1 tJefault character set Llatinl y datadir C ProgramData MySOL MySOL Server 5 1 Data Tatiniaverclo _Ikexe _lowicieere same IMIS Miivoreels here ri Ihe same ioe Amnodbrthread concurrency n ienn read _bu uffer_size 64K innodb_additional_mem_pool_size 2M thread_cache_size 8 Miiminecls ie lusia logier Sur Comme iL query cachersize TOL Psort buffer siz 250K T default storage engine INNODB key buffer size 11M MySQL Workbench OSS for Windows version 5 2 8 CanToORNVersSioni 1 8 6 Rendering Mode GDI requested create a diagram to confirm OpenGL Driver Version Not Detected OS unknown CPU Intel R Core TM 2 Duo CPU T9300 2 50GHz 1 0 GB RAM Video adapter inf
32. ALL CREATE DROP GRANT OPTION REFERENCES ALTER DELETE INDEX INSERT SELECT UPDATE TRIGGER You can choose to assign all privileges to a specific user or any other privilege as listed previously Privileges irrelevant to a specific table such as the FILE privilege are not shown If a role has already been granted privileges on a specific table those privileges show as already checked in the Assigned Privileges list 8 7 2 Creating Foreign Key Relationships Foreign key constraints are supported for the TnnoDB storage engine only For other storage engines the foreign key syntax is correctly parsed but not implemented For more information see Foreign Key Differences 115 Creating Foreign Key Relationships Using MySQL Workbench you may add a foreign key from within the table editor or by using the relationship tools on the vertical toolbar of an EER Diagram This section deals with adding a foreign key using the foreign key tools To add a foreign key using the table editor see Section 8 7 1 3 4 The Foreign Keys Tab The graphical tools for adding foreign keys are most effective when you are building tables from the ground up If you have imported a database using an SQL script and need not add columns to your tables you may find it more effective to define foreign keys using the table editor 8 7 2 1 Adding Foreign Key Relationships Using an EER Diagram The vertical
33. EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE Copyright c 2002 Apple Computer Inc All Rights Reserved A 27 ScintillaNET License The following software may be included in this product SComm eani aN E ScintillaNET is based on the Scintilla component by Neil Hodgson ScintillaNET is released on this same license The ScintillaNET bindings are Copyright 2002 2006 by Garrett Serack lt gserack gmail com gt All Rights Reserved Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation GARRETT SERACK AND ALL EMPLOYERS PAST AND PRESENT DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL GARRETT SERACK AND ALL EMPLOYERS PAST AND PRESENT BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE The license for Scintilla is as follows Copyright 1998 2006 by Neil Hodgson lt neilh scintilla org gt 375 TinyXML License All Rights Reserved
34. Executing POLICY command Showing options after command Audit Log Variables and Options 4 4 Variable_name Value 4 4 audit_log_buffer_size 1048576 audit_log_file audit log audit_log_flush OFF audit_log_policy QUERIES audit_log_rotate_on_size 0 audit_log_strategy ASYNCHRONOUS 4 4 To change the audit log automatic file rotation size to 32535 and show the system variables before and after the execution of the rotate_on_size command use the following command Notice that the value set is actually 28672 because the specified rotate_on_size value is truncated to a multiple of 4096 shell gt mysqlauditadmin show options server root localhost 3310 rotate_on_size value 32535 253 mysqlauditgrep Allows users to search the current or an archived audit log Showing options before command Audit Log Variables and Options 4 4 Variable_name Value 4 4 audit_log_buffer_size 1048576 audit_log_file audit log anarchic loe se inet OFF AUCitalhoqmpolaay ALL audit_log_rotate_on_size 0 audit_log_strategy ASYNCHRONOUS 4 4 Executing ROTATE_ON_SIZE command Showing options after command Audit Log Variables and
35. For more information about creating and editing views see Section 8 7 3 Creating Views 8 6 1 9 The Routine Group Tool 8 6 1 10 Use this tool to create a routine group on the EER Diagram canvas When this tool is activated a schema list appears on the toolbar below the main menu enabling you to associate the routine group with a specific schema You can also select a color for the routine group by choosing from the color list to the right of the schema list After selecting this tool clicking the canvas creates a new group To edit this view right click it and choose Edit Routine Group or Edit in New Window from the pop up menu To activate the routine group tool from the keyboard use the G key For more information about creating and editing routine groups see Section 8 7 4 2 Routine Groups The Relationship Tools The five relationship tools are used to represent the following relationships e One to many nonidentifying relationships e One to one nonidentifying relationships e One to many identifying relationships e One to one identifying relationships e Many to many identifying relationships These tools appear at the bottom of the vertical tool bar Hover the mouse pointer over each tool to see a text hint that describes its function 103 Working with Models For more information about relationships see Section 8 7 2 Creating Foreign Key Relationships 8 7 Working with Models 8 7
36. INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR ONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF UBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS NTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN ONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE BILITY OF SUCH DAMAGE HP H zZ i 1G fs Ge fe el E gel Oo n n A 31 zlib License The following software may be included in this product zlib Oracle gratefully acknowledges the contributions of Jean loup Gailly and Mark Adler in creating the zlib general purpose compression library which is used in this product zlib h interface of the zlib general purpose compression library Copyright C 1995 2004 Jean loup Gailly and Mark Adler zlib h interface of the zlib general purpose compression library version INA S July Whelan 2005 Copyright C 1995 2005 Jean loup Gailly and Mark Adler zlib h interface of the zlib general purpose compression library version oA Merewil Weel Z0 i 0 Copyright C 1995 2010 Jean loup Gailly and Mark Adler This software is provided as is without any express or implied warranty In no event will the authors be held liable for any damages arising from the 377 zlib License use of this software Permission is granted
37. JIOwER BIS role SLAVE state WIE gtid_mode ON health OK version 5 6 5 m8 debug log master_log_file mysql bin 000001 master_log_ pos 571 IO_Thread Yes SQL_Thread Yes Secs_Behind 0 Remaining_Delay No IO_Error_Num 0 TO Error kkkkxkxkxkxkxkkkxkxkxkk xkxkkxkkkkkxk kxx k Si row KKEKKKKKKEKKEKKKKKKKAKKKKKKKK Tost lheeellineste Owes BIDS role SLAVE state UE gtid_mode ON health OK version 5 6 5 m8 debug log master_log_file mysql bin 000001 master_log_ pos 571 IO_Thread Yes SQL_Thread Yes Secs_Behind 0 Remaining_Delay No IO_Error_Num 0 TO Error kkkkxkxkxkxkxkkkxkxkxkk xkxkkkkkkkkxx k g row kkkkxkxkxkxkxkxkkxkxkxkxk kxk kxkkkkkkkxxkxx k nose lhe eellineste Owes BIsu role SLAVE state UP gtid_mode ON health OK version 5 6 5 m8 debug log master_log_file mysql bin 000001 master_log_ pos 571 I0_Thread Yes SQL_Thread Yes Secs_Behind 0 Remaining_Delay No IO_Error_Num 0 ALO ETrOr 4 rows done To run the same failover command above but specify a log file use the following command S mysqlrpladmin slaves root localhost 3332 root localhost 3333 root localhost 3334 candidates root localhost 3333 root localhost 3334 log test_log txt failover Performing failover Candidate slave localhost 3333 will become the new master Preparing candidate for failover Creating replication user if it does not exist Stopping slaves Performing STOP on all s
38. MySQL Model Y EER Diagrams GH Add Diagram From an EER diagram page you can graphically design a database 8 8 3 1 Adding a Table The tools in the vertical toolbar on the left of the EER Diagram tab are used for designing an EER diagram Start by creating a table using the table tool The table tool is the rectangular grid in the middle of the vertical toolbar Mousing over it shows the message Place a New Table T Clicking this tool changes the mouse pointer to a hand with a rectangular grid Create a table on the canvas by clicking anywhere on the EER Diagram grid Right click the table and choose Edit in New Window from the pop up menu This opens the table editor docked at the bottom of the application The table name defaults to table1 Change the name by entering invoice into the Name field Changes here affect the name of the tab in the table editor and the name of the table on the canvas Pressing Tab or Enter while the cursor is in the table name field selects the Columns tab of the table editor and creates a default column named idinvoice Pressing Tab or Enter again sets the focus on the Datatype list with INT selected Notice that a field has been added to the table on the EER canvas Pressing Tab yet again and the focus shifts to adding a second column Add a Description anda Customer_id column When you are finished close the table editor by clicking the x button on the top left of the table editor 8 8 3
39. Oracle is hereby making the election to license iODBC under the BSD license iODBC Driver Manager Copyright C 1995 by Ke Jin lt kejin empress com gt Copyright C 1996 2009 by OpenLink Software lt iodbc openlinksw com gt All Rights Reserved This software is released under either the GNU Library General Public License see LICENSE LGPL or the BSD License see LICENSE BSD Note that the only valid version of the LGPL license as far as this 357 Libiconv License project is concerned is the original GNU Library General Public License Version 2 dated June 1991 While not mandated by the BSD license any patches you make to the iODBC may be contributed back into the iODBC project at your discretion Contributions will benefit the Open Source and Data Access community as a whole Submissions may be made at http www iodbc org LICENSE BSD Copyright C 1995 2009 OpenLink Software Inc and Ke Jin All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met 1 Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer 2 Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution 3 Neither the name of OpenLi
40. Show the Find panel for the editor Invisible characters Toggle display of invisible characters such as newlines tabs spaces 7 7 3 SQL Query Panel In this area you can enter SQL statements directly The statements entered can be saved to a file or snippet for later use At any point you can also execute the statements you have entered To save a snippet of code entered into the SQL Query panel click the Save SQL to Snippets List icon in the Snippets panel enter a name optional and click OK The snippet can be inserted into the SQL Query panel at any time by double clicking the snippet in the SQL Snippets panel 73 Main Tabsheets Figure 7 7 SQL Editor SQL Query Panel Ge Ff ACB B s a m 1e SELECT name code FROM Country 100 32 1 Filter Q a Export Ep name code Aruba ABW Afghanistan AFG Angola AGO Anguilla AIA Albania ALB Andorra AND Netherlands A ANT United Arab E ARE Argentina ARG Armenia ARM Country 4 Read Ony Executing a SELECT query will display the associated result set in the SQL View panel directly below the SQL Query panel These cells are editable if MySQL Workbench is able to determine how as for example they are editable if a Primary or Unique key exists within the result set If not MYSQL Workbench will display a read only icon at the bottom right corner of the SQL View panel and hovering the mouse cursor over this icon will provide a hint as to why it s not edit
41. Status and System Variables Data Export and Restore Export to Disk Import from Disk Advanced Export Options Select Database Objects to Export Options Export Tables in Schema Export to Dump Project Folder Export Schema Server Logs mysql Each table will be exported into a separate fle This allows a selective performance_schen 7 CONFIGURATION test Folder Path C Wsers Tony Documents dumps Dump20110301 Options File world Export to Self Contained File SECURITY File Path C Users Tony Documents dumps Dump20110301 sql Users and Privileges DATA EXPORT RESTORE Data Export and Restore Dump Views Refresh Select All Tables Unselect All i P T E S E E T e T 4 Mm Press Start Export to start Log WARNING A mysqidump exe is version 5 1 40 but the J ET MySQL Server to be dumped has version 5 5 9 Statistics Because the version of mysqldump is older than _ Stop Start Export WB Admin Opened 10 7 6 2 Import from Disk The Import from Disk tab enables you to import a previously exported project You can select to import a project where tables were stored in individual files In this case you will also be able to select which of these tables to import You can also import a project saved to a single file 194
42. The installation process is shell gt cd the src directory shell gt configure with iodbc enable pthreads shell gt CFLAGS arch i386 arch x86_64 make shell gt sudo make install 11 5 2 Drivers If you are compiling psqlodb first configure with the without libpg option 11 5 3 Connection Setup After loading the Migration Wizard click on the Start Migration button in the Overview page to begin the migration process You will first connect to the source PostgreSQL database Here you will provide the information about the PostgreSQL RDBMS that you are migrating from the ODBC driver that will be used for the migration and all of the parameters required for the connection The name of the ODBC driver is the one you set up when you registered your psqlIODBC driver with the driver manager Opening the Database System dropdown will reveal each RDBMS that is supported on your system Select PostgreSQL from the list Below that is the Stored Connection dropdown which is optional Stored connections will be listed here which are connections saved after defining a connection with the Store connection for future use as checkbox enabled The three Connection Method options are ODBC manually entered parameters Each parameter like a username is defined separately ODBC Data Source For pre configured data sources DSN e ODBC direct connection string A full ODBC connection string Note R The psqlODBC driver does
43. This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf The console creates a special table in the mysql database that is used to keep track of which instance is communicating with the master If you use the force 292 option the console will remove the rows in this table The table is constructed with CREATE TABLE IF NOT EXISTS mysql failover_console host char 30 port char 10 294 mysql failover Automatic replication health monitoring and failover When the console starts a row is inserted containing the hostname and port of the master On startup if a row matches these values the console will not start If you use the force 292 option the row is deleted EXAMPLES To launch the utility you must specify at a minimum the master 293 option and either the discover slaves login 292 option or the slaves 293 option The option option can be used in conjunction with the s laves 293 option to specify a list of known slaves or slaves that do not report their host and ip and to discover any other slaves connected to the master An example of the user interface and some of the report views are shown in the following examples Note E The GTID Executed Set will display the first GTID listed in the SHOW MASTER STATUS view If there are multiple GTIDs listed the utility shall display
44. This work was produced at the University of California Lawrence Livermore National Laboratory under contract no W 7405 ENG 48 between the U S Department of Energy and The Regents of the University of California for the operation of UC LLNL DISCLAIMER This software was prepared as an account of work sponsored by an agency of the United States Government Neither the United States Government nor the University of California nor any of their em ployees makes any warranty express or implied or assumes any liability or responsibility for the accuracy completeness or usefulness of any information apparatus product or process disclosed or represents that its use would not infringe privately owned rights Reference herein to any specific commer cial products process or service by trade name trademark manufacturer or otherwise does not necessarily constitute or imply its endorsement recommendation or favoring by the United States Government or the University of California The views and 369 Python License opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California and shall not be used for advertising or product endorsement purposes The source code for the md5 module contains the following notice Copyright C 1999 2002 Aladdin Enterprises All rights reserved This software is provided as is without any express or
45. Y Reverse Engineer Source Migrate View objects OBJECT MIGRATION 6 total 0 selected Migration Manual Editing Migrate Routine objects Target Creation Options 3 total 0 selected Create Schemata Show Selection Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report 206 A visual guide to performing a database migration Migration The migration process now converts the selected objects into MySQL compatible objects View the logs and then proceed Figure 11 9 MySQL Workbench migration Migration Migration X File Edit View Database Plugins Scripting Help Migration Task List Migration OVERVIEW Overview Reverse engineered objects from the source RDBMS will now be automatically converted into MySQL compatible objects Default datatype and default column value SOURCE amp TARGET mappings will be used You will be able to review and edit generated objects and column definitions in the Manual Editing step Y Source Selection Target Selection Y Fetch Schemata List Migrate Selected Objects Y Schemata Selection Generate SQL CREATE Statements Y Reverse Engineer Source OBJECT MIGRATION v 7 SEU SES Finished performing tasks Gh est Manual Editing Menage Ling Target Creation Options Starti Create Schemata SEBE rT a Create Target Results Migrating Migrating schema HumanResources DATA MIGRATION Migrating schema content
46. a confirmation dialog box opens only when you are deleting an object from an EER Diagram When deleting in the MySQL Model view there is no confirmation dialog window and the delete action always removes the object from the catalog There are a variety of ways to delete an object from an EER canvas using the eraser tool choosing a pop up menu item using the delete key and by choosing the delete option from the Edit menu In each case the action performed by the delete key is determined by the option chosen from the When Deleting Physical Model Figures in Diagram section Use the Model tab to set the default value for various object names and the primary key data type The following table shows the object names and their default values Object Name Default Value PK Column Name idstable 58 The Model MySQL Tab Object Name Default Value PK Column Type INT Column Name Stablescol Column Type VARCHAR 45 FK Name fk stable_Sdtable Foreign Key Column Name ON UPDATE Stable _ column NO ACTION ON DELETE NO ACTION Associative Table Name Sstable S_has_ sdtable The PK Column Name PK Column Type Column Name and Column Type values are the defaults used by the table editor and only function on Microsoft Windows and Mac OS X The others are the default names used when using the relationship tools on an EER diagram Within object values ite
47. e errmsg sys exit Lastly we copy the user accounts Once again we must provide a dictionary of options and call the command module directly In this case the userclone module provides a method that clones one user to one or more users so we must loop through the users and clone them one at a time from mysql utilities command import userclone options overwrite True Uke ear c TEUS globalzs True 244 Commands for user in user_list CEN res userclone clone_user conn dest_values user user options except exception UtilError e print ERROR e errmsg sys exit We are done As you can see constructing new solutions from the MySQL utility command and common modules is easy and is limited only by your imagination Enhancing the Example A complete solution for the example named copy_server py is located in the Appendix section It is complete in so far as this document explains but it can be enhanced in a number of ways The following briefly lists some of the things to consider adding to make this example utility more robust e Table locking Currently databases are not locked when copied To achieve a consistent copy of the data on an active server you may want to add table locking or use transactions for example if you are using InnoDB for a more consistent copy e Skip users not associated with the databases being copied Do not copy users with only global privileges Start re
48. first_name varchar 45 last_name varchar 45 email varchar S0 address_id smaillint S UN active tinyint 1 create_date datetime last update timestamp 100 1 13 _1error found Table templates Define templates of tables with commonly used columns to be used to create new tables in a live connection or in an EER model In the SQL Editor choose Create Table Like or in Modeling use the right sidebar Vertical Text A Vertical Text output option for queries equivalent to G from the command line Client was added To execute choose Query Execute Current Statement Vertical Text Output 10 Vertical Text Figure 2 9 Vertical Text G MySQLWorkbench File Edit View Ta Database Plugins Scripting Help 000 Execute All or Selection THEO Execute All or Selection to Text a Execute Current Statement ee e Execute Current Statement Vertical Text Output Explain Current Statement xe Guo F Visual Explain Current Statement Koge Q Filter objects ae SELG to vE sakila p v Tables V Stop Script Execution on Errors gt amp actor TS gt IB address gt SELECT FROM Reconnect to Server gt category seeeeeeseeeeess New Tab to Current Server CRT gt i city actor_id 1 first nan A v Auto Commit Transactions P county last_update 201 Commit Transaction d gig tor id 2 Rollback Transaction gt E fiim first_name NII l gt amp film_actor last_name WA C
49. lt format gt Display the replication health output in either grid default tab csv or vertical format 312 mysql rpladmin Administration utility for MySQL replication log lt log_file gt Specify a log file to use for logging messages log age lt days gt Specify maximum age of log entries in days Entries older than this will be purged on startup Default 7 days master lt connection gt Connection information for the master server in the format lt user gt lt passwa gt lt host lt port lt socket gt or lt login path gt lt port gt lt socket gt max position lt position gt Used to detect slave delay The maximum difference between the master s log position and the slave s reported read position of the master A value greater than this means the slave is too far behind the master Default 0 new master lt connection gt Connection information for the slave to be used to replace the master for switchover in the form lt user gt lt passwa gt lt host gt lt port gt lt socket gt or lt login path gt lt port gt lt socket gt Valid only with switchover command no health Turn off health report after switchover or failover ping lt number gt Number of ping attempts for detecting downed server Note on some platforms this is the same as number of seconds to wait for ping to return This value is also used to check down status of master Failover wi
50. movies Click Finish 4 You will see a data grid This is where you can enter the data for your database Remember that the movie_id was set to be autoincrement so you need not enter values directly for this column In the data grid enter the movie information shown in the following table title release_date Gone with the Wind 1939 04 17 The Hound of the Baskervilles 1939 03 31 The Matrix 1999 06 11 Above the Law 1988 04 08 Note R Do not modify any values in the movie_id column 5 Now click the Apply button in the toolbar located in the bottom right corner A list of SQL statements will be displayed Confirm that you understand the operations to be carried out Click Apply to apply these changes to the live server 6 Confirm that the script was executed correctly then click Finish 7 View the data grid again and observe that the autoincrement values have been generated 45 Adding Data to Your Database Figure 5 20 Getting Started Tutorial Edit Data O tae Avid ve ror py aose E telense cate Gone mth the Wing 1998 06 17 The Hound of the Baskerv es 1905 03 31 The Matix 1999 0331 Abore De Law 1968 04 06 Action Outpt Tre 1 183606 SELECT FROM dvd colection moves LIMIT Q 1000 M dvd colecton moves LIMI 8 Now you will check that the data really has been applied to the live server Launch the MySQL Command Line Client Enter SELECT FROM movies to see the data just entered
51. option To examine the existing indexes use the verbose 299 option which prints the equivalent CREATE INDEX or ALTER TABLE for primary keys To display the best or worst nonprimary key indexes for each table use the best 298 or worst 299 option This causes the output to show the best or worst indexes from tables with 10 or more rows By default each option shows five indexes To override that provide an integer value for the option To change the format of the index lists displayed for the show indexes 299 best 298 and worst 299 options use one of the following values with the format 298 option grid default Display output in grid or table format like that of the mysql monitor csv Display output in comma separated values format tab Display output in tab separated format sql print SQL statements rather than a list vertical Display output in single column format like that of the G command for the mysql monitor Note The best 298 and worst 299 lists cannot be printed as SQL statements OPTIONS mysqlindexcheck accepts the following command line options help Display a help message and exit best lt N gt If stats 299 is given limit index statistics to the best N indexes The default value of Nis 5 if omitted format lt index_format gt f lt index_format gt Specify the index list display format for output produced by stats 299 Per
52. script or run finishes 4 3 1 Installing MySQL Workbench on Windows MySQL Workbench for Windows can be installed using the Windows Installer package or installed manually from a Zip file Important Administrator or Power User privileges If you are using the Zip file without an A Installing MySQL Workbench using the Installer package requires either installer you do not need Administrator or Power User privileges Installing MySQL Workbench Using the Installer Package MySQL Workbench can be installed using the Windows Installer msi installation package The MSI package bears the name mysql workbench version win32 msi where version indicates the MySQL Workbench version number Improving the MySQL Installation Wizard depends on the support and feedback of users If you find that the MySQL Installation Wizard lacks some feature important to you or if you discover a bug please report it in our bugs database Select the Report a Bug item from the Help menu 1 To install MySQL Workbench right click the MSI file and select the Install item from the pop up menu or double click the file 2 In the Setup Type window you may choose a Complete or Custom installation To use all features of MySQL Workbench choose the Complete option 3 Unless you choose otherwise MySQL Workbench is installed in C PROGRAMFILES MySOL MySQL Workbench 5 1 edition_type where PROGRAMFILES is the default directory for programs for you
53. then click Next 11 Finally you can give the server instance a suitable name This will be used to select this particular instance from a list of available instances 36 Administering a MySQL Server Figure 5 10 Getting Started Tutorial Instance Name Create New Server Instance Profile Create the Instance Profile onnection Test DB Connection Please enter a name for this server instance and click Next A new Server Instance Profile entry will be created for managing this MySQL server Server Instance Name mysqld localhost Complete Setup Set the desired name then click Finish to complete the server instance creation process 12 You will now be returned to the Home window You will see the new server instance you created along with the new connection you created as part of the preceding procedure 37 Administering a MySQL Server Figure 5 11 Getting Started Tutorial Home Window Instance r MySQL Workbench Plats Workbench Central Workspace SQL Development Connect to existing databases and run SQL Queries SQL scripts edit data and manage database objects F Open Connection to Start Querying localhost a User root Host localhost 3306 amp New Connection Bi Edit Table Data B Edit SQL Script 6 Manage Connections New server instance created Welcome to MySQL Workbench What s New in This Release Read about all changes in this MySQL Workbench
54. this practice is strongly discouraged and should be used only in situations where it is appropriate or deemed a last resort 238 Connection Parameters 14 2 2 Connection Parameters To connect to a server it is necessary to specify connection parameters such as user name host name password and perhaps also port or socket Whenever connection parameters are required they can be specified three different ways As a dictionary containing the connection parameters e As a connection specification string containing the connection parameters e As a Server instance When providing the connection parameters as a dictionary the parameters are passed unchanged to the connector s connect function This enables you to pass parameters not supported through the other interfaces but at least these parameters are supported e user The name of the user to connect as The default if no user is supplied is login name of the user as returned by getpass getuser passwd The password to use when connecting The default if no password is supplied is the empty password e host The domain name of the host or the IP address The default ilf no host name is provided is localhost This field accepts host names and IPv4 and IPv6 addresses It also accepts quoted values which are not validated and passed directly to the calling methods This enables users to specify host names and IP addresses that are outside of the supported
55. use the owner as the schema name or merge the owner and object name together ownerobject Constraints Yes Yes Yes Yes Data Dictionary N A Database Yes Yes Yes Yes Database Instance Dump Yes Yes Yes Yes mysqldump Events Yes Yes Yes Yes Foreign Keys Yes Yes Yes Yes Full Text Search Yes Yes Yes Yes In InnoDB as of MySQL Server 5 6 and in all versions of MyISAM Index Yes Yes Yes Yes Information Schema Yes No Yes Yes Object Names Case Depends Depends Mixed Mixed MySQL sensitivity of database Sensitivity on on table and trigger names OS collation collation dependent other object names are case insensitive PostgreSQL as specified in the SQL 99 standard unquoted object names are treated as case insensitive while quoted object names are case sensitive 213 Conceptual DBMS equivalents Concept MS SQL Sybase PostgreS lySQL Note Server ASE Unlike the standard unquoted object names are converted to lowercase instead of uppercase Object Naming Yes Yes Yes Yes Conventions Packages N A N A N A N A Partitioning Yes Yes Yes Yes Performance Schema N A N A Yes Yes Permissions Yes Yes Yes Yes Primary Key Yes Yes Yes Yes Referential Integrity Yes Yes Yes Yes Sybase ASE referential integrity only through triggers Replication Yes Yes Yes Yes Role Yes Yes Yes N A Roles are not
56. which must be distributed under Sections 1 and 2 above and if the work is an executable linked with the Library with the complete machine readable work that uses the Library as object code and or source code so that the user can modify the Library and then relink to produce a modified executable containing the modified Library It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions b Use a suitable shared library mechanism for linking with the Library A suitable mechanism is one that 1 uses at run time a copy of the library already present on the user s computer system rather than copying library functions into the executable and 2 will operate properly with a modified version of the library if the user installs one as long as the modified version is interface compatible with the version that the work was made with c Accompany the work with a written offer valid for at least three years to give the same user the materials specified in Subsection 6a above for a charge no more than the cost of performing this distribution d If distribution of the work is made by offering access to copy from a designated place offer equivalent access to copy the above specified materials from the same place e Verify that the user has already received a copy of these materials or that you have already sent
57. 2 JIS S33 33S Query SET session autocommit OFF 7 0 AWDLE 09 2 JRISS 33359 Query SHOW VARIABLES LIKE READ_ONLY 7 0 AWDLE O9 2 PRIS S333 3S Query SHOW VARIABLES LIKE datadir 7 0 AWDLE 09 2 JTISS 33359 Query SHOW VARIABLES LIKE basedir 7 0 e012 09 2771 3233239 Query SET NAMES latinl COLLATE latinl_swedish_ci 8 0 AWDLE 09 2 JIS S33 359 Query SET session autocommit OFF 8 0 AWLZ 09 2 7 TiS 8 33359 Query SHOW VARIABLES LIKE READ_ONLY 8 0 AQIL YS 2 7 USES ese Query SHOW VARIABLES LIKE basedir 8 0 ADQLZ O 23 ili E5 Query SET NAMES latinl COLLATE latinl_swedish_ci 9 0 AWLE 09 2i 0 AOR Query SET session autocommit OFF 9 0 AWLE 02 2iyr 20 S50 Query SHOW VARIABLES LIKE READ_ONLY 9 0 e012 09 26T 26250 Query SET NAMES latinl COLLATE latinl_swedish_ci 0 0 AWLZ 09 2E 0 BO 50 Query SET session autocommit OFF 0 0 AWLE O9 2130 AGS SiO Query SHOW VARIABLES LIKE READ_ONLY 0 0 AWLE 02 2iy8 20 S50 Query SET GLOBAL audit_log_flush ON 0 0 AQILASO S25 26 50 Query SHOW VARIABLES LIKE audit_log_policy 0 0 2012 09 70 2 28 50 Query SHOW VARIABLES LIKE audit_log_rotate_on_size 0 0 AOIZ AL OIL 8 Soi 8 10 Query show databases 1 1046 AQLZ NO ALOT 2 5 1826 Query show tables test 1 1046 2012 10 1052 57836 Query show tables test 1 0 AMAL 2s Oa 8 Sya zl Query show tables in test 1 4 4 4 4 4 To displ
58. 4 Manage Security This action item takes you quickly to the page that enables you to manage user accounts It launches an Admin page and locates you on the Accounts tab For further details see Section 10 7 3 The Accounts Tab 10 5 Manage Server Instances Clicking this action item launches the Manage Server Instances dialog Within this dialog you can change the configuration of existing server instances or create a new server instance For further details see Section 10 6 Creating and Managing Server Instances 10 6 Creating and Managing Server Instances Server instances can be created and managed from the Home page To create new server instances use one of these methods Click the New Server Instance action item from the Server Administration section of the Home window This launches the Create a new server instance wizard For further details see Section 10 6 1 New Server Instance Wizard Click the Manage Server Instances action item from the Server Administration section of the Home window This launches the Manage Server Instances dialog from within which a new server instance can be created For further details see Section 10 6 2 Manage Server Instances Dialog 10 6 1 New Server Instance Wizard Clicking the New Server Instance action item launches the Create a new server instance wizard The wizard provides a step by step approach to creating a new server instance This is most suitable for beg
59. 6 1 alone or in any derivative version provided however that CNRI s License Agreement and CNRI s notice of copyright i e Copyright c 1995 2001 Corporation for National Research Initiatives All Rights Reserved are retained in Python 1 6 1 alone or in any derivative version prepared by Licensee Alternately in lieu of CNRI s License Agreement Licensee may substitute the following text omitting the quotes Python 1 6 1 is made available subject to the terms and conditions in CNRI s License Agreement This Agreement together with Python 1 6 1 may be located on the Internet using the following unique persistent identifier known as a handle 1895 22 1013 This Agreement may also be obtained from a proxy server on the Internet using the following URL http hdl handle net 1895 22 1013 3 In the event Licensee prepares a derivative work that is based on or incorporates Python 1 6 1 or any part thereof and wants to make the derivative work available to others as provided herein then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 1 6 1 4 CNRI is making Python 1 6 1 available to Licensee on an AS IS basis CNRI MAKES NO REPRESENTATIONS OR WARRANTIES EXPRESS OR MPLIED BY WAY OF EXAMPLE BUT NOT LIMITATION CNRI MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1 6 1 WILL NOT NFRINGE ANY THIRD PAR
60. Admin Opened 10 7 5 The Variables Tab The Variables tab displays a list of all server and status variables 192 The Data Dump Tab Figure 10 9 Administrator Variables Tab i Admin mysqld 127 0 0 1 X File Edit View Database Plugins Scripting Community Help Task and Object Browser Status and System Variables MANAGEMENT 06 Server Status J Startup Shutdown Name Description Aborted_clients The number of connections aborted because Aborted_conneds The number of failed attempts to connect to Binlog_cache_disk_use The number of transactions that used a temp Status Variables System Variables E Status and System Variables A Server Logs CONFIGURATION Search Results Binlog_cache_use Binlog Binlog_stmt_cache_disk_use Options File Replication Binlog_stmt_cache_use Bytes_received Bytes_sent Com_admin_commands Com_assign_to_keycache DATA EXPORT RESTORE Com_alter_db Data Export and Restore Com_alter_db_upgrade Com_alter_event Com_alter_function Com_alter_procedure Com_alter_server Com_alter_table Com_alter_tablespace Com_analyze Com_begin Com_binlog Com_call_procedure Com_change_db Com_change_master Com_check Com_checksum a b SECURITY Users and Privileges 139129 16256153 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A The number of transactions that used the te The number of bytes received from all clients The number of bytes sent to all clients Cou
61. Apple Software in its entirety and without modifications you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software Neither the name trademarks service marks or logos of Apple Computer Inc may be used to endorse or promote products derived from the Apple Software without pecific prior written permission from Apple Except as expressly stated in his notice no other rights or licenses express or implied are granted by pple herein including but not limited to any patent rights that may be nfringed by your derivative works or by other works in which the Apple oftware may be incorporated yee Be er to he Apple Software is provided by Apple on an AS IS basis APPLE MAKES NO ARRANTIES EXPRESS OR IMPLIED INCLUDING WITHOUT LIMITATION THE IMPLIED ARRANTIES OF NON INFRINGEMENT MERCHANTABILITY AND FITNESS FOR A PARTICULAR URPOSE REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS T W W 2 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL INDIRECT INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION ARISING IN ANY WAY OUT OF THE USE REPRODUCTION MODIFICATION AND OR DISTRIBUTION OF THE APPLE SOFTWARE HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT TORT INCLUDING NEGLIGENCE STRICT LIABILITY OR OTHERWISE
62. COLUMNS COLUMNS dictionary active Column Name COLUMN_NAME COLUMN_NAME variable is looked up and found in COLUMNS data dictionary COLUMNS COLUMNS_LISTING TABLES SCHEMATA Imagine now that for each column name displayed you also wanted to display its corresponding schema name the template would look like this SCHEMATA TABLES COLUMNS_LISTING COLUMNS Schema Name SCHEMA_NAME Column Name COLUMN_NAME COLUMNS COLUMNS_LISTING TABLES SCHEMATA When variable lookup is performed for SCHEMA_NAME the COLUMNS dictionary is checked As the variable is not found there the parent dictionary will be checked COLUMNS_LISTING and so on until the variable is eventually found where it is held in the SCHEMATA dictionary If there are multiple schemata in the model the outer section is iterated over a matching number of times and SCHEMA_NAME accordingly has the correct value on each iteration It s important to always consider which dictionary must be active and which parents for a variable to be evaluated correctly The following section has a table that helps you identify section requirements 8 12 1 Supported Template Markers The following table shows the supported markers These markers can be used in any template including custom templates Using the table 169 Supported Template Markers The table s
63. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE A 25 Python License The following software may be included in this product Python Programming Language This is the official license for the Python 2 7 release A HISTORY OF THE SOFTWARE Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum CWI see http www cwi nl in the Netherlands as a successor of a language called ABC Guido remains Python s principal author although it includes many contributions from others In 1995 Guido continued his work on Python at the Corporation for National Research Initiatives CNRI see http www cnri reston va us in Reston Virginia where he released several versions of the software In May 2000 Guido and the Python core development team moved to BeOpen com to form the BeOpen PythonLabs team In October of the same year the PythonLabs team moved to Digital Creations now Zope Corporation see http www zope com In 2001 the Python Software Foundation PSF see http www python org psf was formed a non profit organization created specifically to own Python related Intellectual Property Zope Corporation is a sponsoring member of the PSF All Python releases are Open Source see http www opensource org for the Open Source
64. Definition Historically most but not all Python releases have also been GPL compatible the table below summarizes the various releases Release Derived Year Owner GPL from compatible 1 O 9 0 tlre a7 PS Sil iL SSNs CWI yes 2s selene e242 Ihe 19051909 CNRI yes IG Lodo 2000 CNRI no 20 ISG 2000 BeOpen com no dhs Gl La 2001 CNRI yes 2 2a CONES calles coral 2001 PSF no 2a Opell 2 Orpll Gq I 2001 PSF yes 364 Python License eae PIN PLS ran 2001 PSF yes DEED 2 Sale 2001 PSF yes 2E E2 Teale 2002 PSF yes eles Dee 2002 PSF yes eee Dl 2002 PSF yes DED SD LEONE 2002 PSF yes Zee 38 DRED 2003 PSF yes 23 DR B 2002 2003 PSF yes RES De 2002 2003 PSF yes 2 SEP DRS 2002 2003 PSF yes RES De Bue 2002 2003 PSF yes 2NA 2 SS 2004 PSF yes De Ses De 34 2005 PSF yes DBA es 2004 PSF yes DAY DEA 2005 PSF yes DAER DA 2005 PSF yes 2A PARED 2006 PSF yes ZS DA 2006 PSF yes 2O 265 2007 PSF yes ARSE D 2008 Boe yes Dee 3 Deas 2008 Poe yes 7 Des 2008 Poe yes De 2 2008 PSF yes DOr De 2009 Poe yes De OLs Deer 2009 Poe yes 2 6 4 Dee 2010 PSF yes Ze 2 2010 PSF yes HO Oe Otero 1 GPL compatible doesn t mean that we re distributing Python under the GPL All Python licenses unlike the GPL let you distribute a modified version without making your changes open source The GPL compatible licenses make it possible to combine Python with other software that is released under the GPL the others do
65. Diagram Mode menus File Menu Table 13 1 File menu keyboard shortcuts Function Keyboard Shortcut Context New Model Modifier N All Open Model Modifier O All Open SQL Script Modifier Shift O SQL Editor Close Tab Modifier W Modifier F4 on Windows _ All Save Model Modifier S Model Save Script Modifier S SQL Editor Save Model As Modifier Shift S Model Modifier Shift S Modifier Shift G Model Save Script As SQL Editor Forward Engineer SQL CREATE Script Forward Engineer SQL ALTER Script Modifier Alt Y Model Synchronize With SQL Modifier Shift Y Model CREATE Script Print Modifier P EER Diagram mode only Exit Modifier Q All Edit Menu Table 13 2 Edit menu keyboard shortcuts Function Keyboard Shortcut Context Undo Modifier Z Model EER Diagram Redo Modifier Y Modifier Shift Z Mac OS Model EER Diagram X Cut Modifier X All Copy Modifier C All Paste Modifier V All Delete Modifier Delete Command All BackSpace Mac OS X Edit Selected Modifier E Model EER Diagram Edit Selected in New Window Modifier Shift E Model EER Diagram Select All Modifier A EER Diagram Find Modifier F All Find Advanced Modifier Alt F All 233 Function Keyboard Shortcut Context Find Next F3 All Find Previous Shift F3 All Search and Replace Modifier Shift F All Comme
66. Front Brings objects to the foreground Send to Back Sends objects to the background 90 Modeling Menus Center Diagram Contents Centers objects on the canvas Autolayout Automatically arranges objects on the canvas Reset Object Size Expands an object on an EER diagram For example if a table has a long column name that is not fully displayed this menu item expands the table to make the column visible This menu item is not enabled unless an object is selected Expand All Use this item to expand all objects on an EER diagram This item will display a table s columns if the object notation supports expansion Some object notations such as Classic do not permit expansion or contraction Indexes will not automatically be expanded unless they were previously expanded and have been collapsed using the Collapse All menu item Collapse All Undo the operation performed by Expand All 8 5 1 5 The Model Menu 8 5 1 5 1 The Model menu has these items Add Diagram Creates a new EER Diagram The keyboard shortcut is Control T Create Diagram From Catalog Objects Creates an EER diagram from all the objects in the catalog DBDoc Model Reporting For information about this menu item see Section 8 5 1 5 1 The DBDoc Model Reporting Dialog Window Commercial Version Commercial version only User Defined Types Presents a dialog box that enables you to add and delete user defined data types Object Notation For in
67. IN ANY WAY Gat Ole Able IWS ORATE S SORTWARE EVEN TF ADVT SED OUT sll POSS TBLLUDIS OE UCH DAMAGE HPH D yO el jel ey IS teal strtod and dtoa The file Python dtoa c which supplies C functions dtoa and strtod for conversion of C doubles to and from strings is derived from the file of the same name by David M Gay currently available from http www netlib org fp The original file as retrieved on March 16 2009 contains the following copyright and licensing notice RR KKK IR KK E E KR IR AR e A k I RI A A I I kk The author of this software is David M Gay 373 Scintilla License Copyright c 1991 2000 2001 by Lucent Technologies Permission to use copy modify and distribute this software for any purpose without fee is hereby granted provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software THIS SOFTWARE IS BEING PROVIDED AS IS WITHOUT ANY EXPRESS OR IMPLIED WARRANTY IN PARTICULAR NEITHER THE AUTHOR NOR LUCENT MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE a R ber Ge a O ber O Ber Ser O O Ber ber Ger Ger FERRI A IK A RA A I AA I A I A I AR I k k k k k k k kk kk k kkk A 26 Scintilla License The following software may be included
68. Manage Server Instances Dialog Server Instances World Connection System Profile Information about the server and MySQL configuration such as path to the configuration file command to start or stop it etc You may pick a preset configuration profile or customize one for your needs System Type Windows v Installation Type Custom v Configuration File C Program Files MySQL MySQL Server 5 1 my ini m Instance Name mysqld The following options specify how Workbench should perform certain administration actions Commands given here are the same as if they would be run in a system shell Commands which return a value might be combined with some predefined filters See Filters Help vor more details MySQL Management Server Stats Start MySQL sc start mysql Stop MySQL sc stop mysql Acquire administrator rights to execute start stop commands and write configuration data S Check MySQL Status sc query mysql findstr RUNNING Acquire administrator rights to execute status commands Sudo command v B new osete Dupicate moveup move nonn After an instance has been created it can be launched by double clicking its icon in the Server Administration panel of the Home page This creates an Admin page which has two main panels 184 Server Administration and Configuration Server Status and Configuration The Configuration
69. OET tener ce EEA E 189 10 7 4 The Connections Tab 200 0 cece cece cece esac ee anadai aa iiaa aai aeaaeai 191 10 75 The Variables Tab E ie beste A E T T E ae kes 192 10 7 6 The Data Dump Tab arera eee ieee ee eee veneered cee 193 10 7275 ne LOGS Tab Saeco ts wot ontie ares O einem atone ene 196 Since version 5 2 6 MySQL Workbench has included functionality for managing server instances A server instance is created to provide a way of connecting to a server to be managed The first step is to create a server instance if none exists or to work with an existing server instance MySQL Workbench also provides functionality to administer and configure a server using these server instances Thus the Server Administrator functionality can be broadly grouped into two main areas e Creating and managing server instances e Administration and configuration functions using a server instance The Workspace section of the Home window has an area for Server Administration tasks This section of the Workspace has the following action items e Server Administration e Server Administration icon e New Server Instance Manage Data Import Export e Manage Security e Manage Server Instances The following sections describe each of these action items 10 1 Server Administration This action item enables you to quickly connect to a predefined server instance and carry out administration functions on the associated server Clicking this item
70. OPTIONS mysqlrpladmin accepts the following command line options e help Display a help message and exit e candidates lt candidate slave connections gt Connection information for candidate slave servers for failover in the form lt user gt lt passwa gt lt host gt lt port gt lt socket gt or lt login path gt lt port gt lt socket gt Valid only with failover command List multiple slaves in comma separated list demote master Make master a slave after switchover e discover slaves login lt slave_login gt At startup query master for all registered slaves and use the user name and password specified to connect Supply the user and password in the form lt user gt lt passwa gt or lt ogin path gt For example discover joe secret will use joe as the user and secret as the password for each discovered slave e exec after lt script gt Name of script to execute after failover or switchover Script name may include the path e exec before lt script gt Name of script to execute before failover or switchover Script name may include the path e force Ignore prerequisite checks or any inconsistencies found e g errant transactions on the slaves or SQL thread errors forcing the execution of the specified command This option need to be used carefully as it will not solve any detected issue but will only ignore them displaying a warning message format lt format gt f
71. Preferences xs General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance Color Presets Colors available for tables views etc Colors available for layers notes etc 98BFDA FFEEEC FEDES3 FEFDED 98D8A5 EAFFES FE9898 ECFDFF FE98FE F0F1FE FFEBFA Location Font Editor Bitstream Vera Sans Mono Text Figure Text Tahoma 11 Connection Caption Tahoma 11 Layer Title Tahoma 11 Routine Group Figure Ite Tahoma 12 Routine Group Figure Title Tahoma Bold 12 Table Figure Items Tahoma 11 Table Figure Section Tahoma Bold 11 Table Figure Title Tahoma Bold 12 View Figure Title Tahoma Bold 12 Scripting Editor Bitstream Vera Sans Mono Scripting Shell Bitstream Vera Sans Mono Changes made here affect the list of colors that appears on the toolbar when adding objects to an EER diagram canvas For information about using this list see Section 8 5 2 1 Tool Specific Toolbar Items You can also use this tab to set the font face size and style for the following items e Editor e Layer Title e Text Figure Text e Text Figure Title e Connection Caption e Routine Group Figure Item e Routine Group Figure Title e Table Figure Items e Table Figure Section e Table Figure Title e View Figure Title 62 The Appearance Tab Note On Windows the default font for the editor supports only 1 at in 1 characters If you need to use characters not supported by the 1at in 1 character
72. Removes the role Copy SQL to Clipboard Currently not implemented To rename a role click the role name Then you will be able to edit the text All roles that have been defined are listed under Roles on the left side of the role editor Double clicking a role object opens the role editor docked at the bottom of the page Figure 8 5 Role Editor Select the role to which you wish to add objects You may drag and drop objects from the Physical Schemata to the Objects section of the role editor To assign privileges to a role select it from the Roles section then select an object in the Ob jects section In the Privileges section check the rights you wish to assign to this role For example a web_user role might have only SELECT privileges and only for database objects exposed through a web interface Creating roles can make the process of assigning rights to new users much easier 97 The SQL Scripts Panel 8 5 5 2 Adding Users To add a user double click the Add User icon This creates a user with the default name user1 Double clicking this user opens the user editor docked at the bottom of the application In the User Editor set the user s name and password using the Name and Password fields Assign one role or a number of roles to the user by selecting the desired roles from the field on the right and then clicking the lt button Roles may be revoked by moving them in the opposite direction Right clicki
73. Review SQL Script SET OLD_UNIQUE_CHECKS UNIGQUE_CHECKS UNIQUE_CHECKS 0 SET OLD_FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS 0 SET OLD_SOL_MODE SQL_MODE SQL_MODE TRADITIONAL CREATE TABLE IF NOT EXISTS mydb table idtabled INT 11 NOT NULL table2_idtable2 INT 11 NULL DEFAULT NULL PRIMARY KEY idtable3 INDEX fk_table3_table21 table2_idtable2 ASC CONSTRAINT tk_table3_table21 FOREIGN KEY table2_idtable2 REFERENCES mydb table2 idtable2 ON DELETE NO ACTION ON UPDATE NO ACTION ENGINE InnoDB DEFAULT CHARACTER SET latint COLLATE latint _swedish_ci SET SQL_MODE 0LD_SQL_MODE SET FOREIGN_KEY_CHECKS 0LD_FOREIGN_KEY_CHECKS SET UNIQUE_CHECKS 0LD_UNIQUE_CHECKS Copy to Clipboard Here you can review and change the alter script that will be generated Make any changes you wish and if you are happy with the changes save the ALTER script to file using the Save to File button You can also click the Execute button to tell MySQL Workbench to write the script to the previously specified output file The generated script can then be used to update the database Forward Engineering to a Live Server Use forward engineering to export your schema design to a MySQL server Select the schema that you wish to forward engineer and then choose the Database Forward Engineer menu item from the main menu The first page to be displayed
74. SSH connection Parameters In addition to a number of parameters that are in common with Standard TCP IP connections this connection method features a number of specialized parameters These are listed here 69 SQL Editor e SSH Hostname This is the name of the SSH server An optional port number can also be provided e SSH Username This is the name of the SSH user name to connect with e SSH Password The SSH password It is recommended that an SSH key file is also used e SSH Key File A path to the SSH key file Note Only key files in OpenSSH format are currently supported These options can be seen in the following screenshot Figure 7 4 Manage DB Connections SSH Parameters O x Stored Connections Connection Name Big Iron Server Type a name for the connection eter a Connection Method Standard TCP IP over SSH Method to use to connect to the RDBMS localhost Parameters Advanced SSH Hostname 127 0 0 1 22 SSH server hostname with optional port number SSH Username user Name of the SSH user to connect with SSH Password Store in Vault Clear Password for the SSH tunnel SSH Key File ana Path to SSH private key file MySQL Hostname 127 0 0 1 MySQL server host relative to the SSH server MySQL Server Port 3306 TCP IP port of the MySQL server Username root Name of the user to connect with Password Store in Vault Clear The MySQL user s
75. Selection Y Reverse Engineer Source OBJECT MIGRATION Y Source Objects Migration Review and edit migrated objects You can manually edit the generated SQL before applying them to the target database Migrated Objects Source Object v 8 HumanResources v Tables v B Employee v Columns rowguid UNI gt Indices gt ForeignKeys gt Triggers gt Dy EmployeeAddress Target Object 8 HumanResources Tables T Employee Columns rowguid VARCHAR 64 Indices ForeignKeys Triggers i EmployeeAddress Migration Message Migration warnings expand to view amp Migration warnings expand to view Migration warnings expand to view Default value newid is not supported amp Migration warnings expand to view gration Problem Migration Problems All Objects Column Mappings Views Routines gt Views gt Routines Target Creation Options Create Schemata Create Target Results You can rename target schemas and tables and change column definitions by clicking them once selected DATA MIGRATION Data Transfer Setup Bulk Data Transfer Lock edited SQL Comment out REPORT Migration Report Apply Changes Discard Changes OVERVIEW ovewview Review and edt migrated objects You can manily ecit the generated SQ before apgiying then to the target database Migrated Objects Sauce Schema Source Table Source Coun Source Type Murankescure I Department Department SMALLI
76. Socket Pipe Connection This connection method enables MySQL Workbench to connect to MySQL Server using a socket file on Unix or a named pipe on Windows Parameters The unique field here is Socket Pipe Path Enter the name of the socket or pipe here If the field is left blank the default socket or pipe name is used On Unix the default socket name is tmp mysql sock On Microsoft Windows the default pipe name is MySQL This option can be seen in the following screenshot Figure 7 3 Manage DB Connections Socket Pipe Parameters I Stored Connections Connection Name Big Iron Server Type a name for the connection Local camane a Connection Method Local Socket Pipe v Method to use to connect to the RDBMS Big Iron Server Sis localhost Parameters Advanced Socket Pipe Path Path to local socket or pipe file Leave empty for default Username root Name of the user to connect with Password Store in Vault l Clear The user s password Default Schema The schema that will be used as default schema New Delete Duplicate Move Up Move Down Test Connection Advanced The only option available in this tab is Use ANSI quotes to quote identifiers This option was discussed in Section 7 6 2 Standard TCP IP Connection 7 6 4 Standard TCP IP over SSH Connection This connection method enables MySQL Workbench to connect to MySQL Server using TCP IP over an
77. Status f Startup Shutdown Inserts E Status and System Variables 7 add ocks Surround each table dump with LOCK TABLES and UNLOCK TABLES statements i Export to Disk Import from Disk Advanced Export Options A Server Logs complete insert Use complete INSERT statements that indude column names CONFIGURATION extended insert Use multiple row INSERT syntax that indude several VALUES lists Options File insert ignore Write INSERT IGNORE statements rather than INSERT statements SECURITY replace Write REPLACE statements rather than INSERT statements Users and Privileges delayed insert Write INSERT DELAYED statements rather than INSERT statements DATA EXPORT RESTORE Data Export and Restore Other events Dump events from the dumped databases lock tables Lock tables for read Disable if user has no LOCK TABLES privilege dump date Indude dump date as Dump completed on comment if comments is given flush4ogs Flush the MySQL server log files before starting the dump delete master ogs On a master replication server delete the binary logs after performing the dump operation F no data Do not dump table contents hex blob Dump binary columns using hexadecimal notation for example abc becomes 0x616263 compress Use compression in server dient protocol fiu
78. TO YOU FOR DAMAGES INCLUDING ANY GENERAL SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library and you want it to be of the greatest possible use to the public we recommend making it free software that everyone can redistribute and change You can do so by permitting redistribution under these terms or alternatively under the terms of the ordinary General Public License To apply these terms attach the following notices to the library It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty and each file should have at least the copyright line and a pointer to where the full notice is found lt one line to give the library s name and a brief idea of what it does gt Copyright C lt year gt lt name of author gt This library is free software you can redistribute it and or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation either version 2 1 of the License or at
79. Table Editor mean Checking these boxes will alter the table column by assigning the checked constraints to the designated columns Hover over an acronym to view a description and see the MySQL Workbench Table Editor and MySQL CREATE TABLE documentation for further information 380 Appendix C MySQL Workbench and Utilities Change History Table of Contents C 1 MySQL Workbench Change History cccceeeeeceeeeeeeeeeee ee aeaaceeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaaaeenees 381 C 2 MySQL Utilities Change History cc ccceeeeeeeee cece eee eeeee ee ee sees ee aa eae eeeeeeeeeeaaaaaeneeeeeeeeeaeaaeaees 381 This appendix lists the changes from version to version in the MySQL Workbench and MySQL Utilities source code Note that we tend to update the manual at the same time we make changes to MySQL If you find a recent version of the MySQL Workbench or Utilities listed here that you can t find on our download page http dev mysql com downloads it means that the version has not yet been released The date mentioned with a release version is the date of the last Bazaar ChangeSet on which the release was based not the date when the packages were made available The binaries are usually made available a few days after the date of the tagged ChangeSet because building and testing all packages takes some time The manual included in the source and binary distributions may not be fully accurate when it comes to the releas
80. The statements added at the start of the code are SET OLD_UNIQUE_CHECKS UNIQUE_CHECKS UNIQUE_CHECKS 0 SET OLD_FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS 0 SET OLD_SQL_MODE SQL_MODE SQL_MODE TRADITIONAL These statements function as follows SET OLD_UNIQUE_CHECKS UNIQUE_CHECKS UNIQUE_CHECKS 0 Determines whether InnoDB performs duplicate key checks Import is much faster for large data sets if this check is not performed SET OLD_FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS 0 Determines whether the server should check that a referenced table exists when defining a foreign key Due to potential circular references this check must be turned off for the duration of the import to permit defining foreign keys e SET OLD_SQL_MODE SQL_MODE SQL_MODE TRADITIONAL Sets SQL_MODE to TRADITIONAL causing the server to operate in a more restrictive mode These server variables are then reset at the end of the script using the following statements SET SQL _MODE OLD_SQL_MODE SET FOREIGN_KEY_CHECKS OLD_FOREIGN_KEY_CHECKS SET UNIQUE_CHECKS OLD_UNIQUE_CHECKS B 2 MySQL Workbench 5 0 appears to run slowly How can increase performance Although graphics rendering may appear slow there are several other reasons why performance may be less than expected The following tips may offer improved performance e Upgrade to the latest version MySQL Workbe
81. The iODBC Data Source Administrator iODBC Data Source Administrator User DSN System DSN File DSN ODBC Drivers Connection Pooling ODBC Drivers that are installed on your system Name File Date Size Add a driver Remove the driver Configure th An ODBC driver allows ODBC enabled programs to get informal ODBC data sources To install new drivers use the driver s setup program if available or add it with the Add button Cancel Click Add a driver then fill out the form with the following values Description of the driver psqlODBC Driver file name usr local lib psqlodbcw so Setup file name No value is needed here And lastly clicking OK will complete the psqlODBc driver registration 11 5 1 3 Mac OS X To compile psqlODBCc on Mac OS X you will need to have Xcode and its Command Line Tools component installed on your system as this includes the required gcc compiler Xcode is free and available from the AppStore And after installing Xcode open it and go to Preferences Downloads Components and then install the Command Line Tools component 219 Drivers Download the psqlODBC source tarball file from http www postgresql org ftp odbc versions src Use the latest version available for download which will be at the bottom of the downloads page The file will look similar to psqlodbc 09 01 0200 tar gz Extract this tarball to a temporary location open a terminal and cd into that directory
82. Users and Privileges MANAGEMENT 6 Server Status Startup Shutdown Status and System Variables User From Host Login Administrative Roles Account Limits A Server Logs root localhost Server Access Management User Accounts Select an Account to Edit CONFIGURATION Options File SECURITY o Users and Privileges DATA EXPORT RESTORE 3 Data Export and Restore WB Admin Opened Note 9 In the current version of MySQL Workbench it is not possible to manage privileges below the schema level For example it is not possible to view or manage grants at the table column or procedure level 10 7 3 1 Administrative Roles To aid in assigning privileges to MySQL Server users MySQL Workbench introduces the concept of Administrative Roles Roles are a quick way of granting a set of privileges to a user based on the work the user must carry out on the server It is also possible to assign multiple roles to a user To assign roles click the User Account you wish to modify then click the Administrative Roles tab Then click the check boxes according to the roles you wish to allocate to the user After you select a role to a user you will see the accumulated privileges in the Global Privileges Assigned to User panel For example if you select the role BackupAdmin the privileges granted include EVENT LOCK TABLES SELECT SHOW DATABASES If you also select the role of Repl icationAdmin the list of priv
83. Vera License The following software may be included in this product Bitstream Vera Copyright c of Bitstream 2003 by Bitstream IETS Inc All Rights Reserved Bitstream Vera is a trademark Permission is hereby granted free of charge to any person obtaining a copy of the fonts accompanying this license Fonts and associated documentation files the Font Software to reproduce and distribute the Font Software including without limitation the rights to use copy publish distribute and or sell copies of the Font Software and to permit persons to whom the Font Software is furnished to do so subject to the following conditions merge H he above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces he Font Software may be modified altered or added o and in particular the designs of glyphs or characters n the Fonts may be modified and additional glyphs or haracters may be added to the Fonts only if the fonts re renamed to names not containing either the words Bitstream or the word Vera Oh Oy feb far dS This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the Bitstream Vera names The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself T
84. a ccte wien ae aaa e aE den a Dan daaa BAe a AAE Sae aeta 66 Te Edit Table Data snien e i ea et ie N ee ee eh 66 A o jele Ee d 1 ea E E E EE ead TT E A A 66 7 5 Manage ConnectonS eiia aa a a A a a ee 66 7 6 Manage DB Connections Dialog 0 c cccececeeeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeateseeeeeeeaeaaaaaeeees 66 7 6 1 The Password Storage Vault cccccecececeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeneeseeeseeaeaaeeees 67 7 6 2 Standard TCP IP Connection 0ccceceeeeeeeeeceeeeeeeeeeeeeseaaeeeeeeeeeeeeaeaaeaeeeeeeeeeeeeaaa 68 7 6 3 Local Socket Pipe Connection 2 0 2 2 ccceceeeeeeeeeee cece ee eeeeeeeeeeeeaeaaeaneeeeeeeeeaeaaaaneeeeeees 69 7 6 4 Standard TCP IP over SSH Connection ccccccceceeeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeeees 69 LAS SOL Edt tin basa hae aa aie Beh aa We 70 FAE a Mar MO NU EE iene dd twee ele uaa dest sa e re Nene ds ac T E T E Nene dsc E 71 AVA 22 TOOIDAD ius E Mea ewe atacand tea ete va eal need ed ean laa eta 72 Hlas SOL QUELY Panel reiecit dina Wes pita aia E 73 TrA Main FabSh ets vi bare nee ie Dae a A eas 74 ETDS SIC DAN E N ake haan evita kad ch area E 77 8 Data Modeling zsnt iv eect ees AA N VAARA EA AAN EAE dba ebewe 83 8 1 Open an Existing EER Model ccccccceeeeeeeeeeeee ee eee eeeeeeeeeeeeaaeaeeeeeeeeeeeeaaaaeeeeeseeeeeeaaa 84 8 2 Create New EER Model 0 ccccceeeee cee eeeeeeeeeeeeeeaaeeeaeeeeeeeeseaaaaaaeeeeeeeeseaaaaaeeeeeesee
85. a failure occurs execute failover to the best slave available The utility accepts a list of slaves to be considered the candidate slave This utility is designed to work exclusively for servers that support global transaction identifiers GTIDs and have GTID_ MODE ON MySQL server versions 5 6 9 and higher support GTIDs See the MySQL server online reference manual for more information about setting up replication with GTIDs enabled The user can specify the interval in seconds to use for detecting the master status and generating the health report using the interval 292 option At each interval the utility will check to see if the server is alive via a ping operation followed by a check of the connector to detect if the server is still reachable The ping operation can be controlled with the ping 293 option see below If the master is found to be offline or unreachable the utility will execute one of the following actions based on the value of the failover mode 292 option auto Execute automatic failover to the list of candidates first and if no slaves are viable continue to locate a viable candidate from the list of slaves If no slaves are found to be a viable candidate the utility will generate and error and exit Once a candidate is found the utility will conduct failover to the best slave The command will test each candidate slave listed for the prerequisites Once a candidate slave is elected it is made a slave
86. action item enables you to create a model from an SQL Create script Such a script may have been created by hand or as a result of reverse engineering an existing database The script may then be modified according to requirements Clicking this action item launches the Reverse Engineer SQL Script wizard This is a multi stage wizard that enables you to select the script you want to create your model from 84 Model Editor For further information see Section 8 7 9 1 Reverse Engineering Using a Create Script 8 5 Model Editor When the Model Editor is executed from the Home window MySQL Workbench displays the MySQL Model page The MySQL Model page has three main panels as shown in the following screenshot Description Editor User Types List History panel and Model Overview Figure 8 1 The MySQL Model Page _ MySQL Workbench arc File Edit View Arrange Model Database Plugins Scripting Community Help Bopesi gig ao Add Diagram Y Physical Schemata Definition TINYINT 1 g Add Routine TINYINT 1 DECIMAL 1O Routine Groups ters FLOAT 8 DOUBLE Add Group TINYINT 4 SMALLINT 6 MEDIUMINT Users Oitems INT 11 BIGINT 20 A Add User Y Schema Privileges Roles 0 items The Description Editor and User Types List History panel are contained within the Sidebar The Sidebar is located on the left by default but can be relocated to the right using a setting in the Workbench Preferences
87. additional controls are Edit current row Enters edit mode for the currently selected row Double clicking a cell has the same effect Note R It is possible to enter a function or other expression into a field Use the prefix func to prevent MySQL Workbench from escaping quotation marks 76 Sidebar For example for the expression md5 fred MySQL Workbench normally would generate the code md5 fred To prevent this enter the expression as func md5 fred to ensure that the quoting is not escaped Insert new row Inserts a new row and enables you to enter data Your changes will not be reflected on the live server until you click Apply changes to data Delete selected rows Removes the selected rows Your changes will not be reflected on the live server until you click Apply changes to data e Export recordset to an external file Exports the result set as a file to a defined location The same as choosing Query Export Results from the main menu Data may be exported as several formats including CSV CSV separated HTML JSON SQL and XML Import records from an external file Imports data from a csv file Data is separated by a comma and not the alternative CSV separated MySQL Workbench export option This feature was added in MySQL Workbench 5 2 45 See also Section 8 7 1 3 8 The Inserts Tab 7 7 5 Sidebar The Sidebar contains these panels e Session connection In
88. all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of InfoSeek not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission This permission is explicitly restricted to the copying and modification of the software to remain in Python compiled Python or other languages such as C wherein the modified or derived code is exclusively imported into a Python module INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE Execution tracing The trace module contains the following notice portions copyright 200 Autenomous Zones Industries Ine ald rights err reserved and offered to the public under the terms of the Python 2 2 license Author Zooko O Whielacronx HELD S77 ZOGKO Cony mailto zooko zooko com 371 Python License Copyright 2000 Mojam Media Inc all rights reserved Author Skip Montanaro Copyright 1999 Bioreason Inc all rights reserved Author Andrew Dalke
89. and above e MySQL Workbench 5 2 44 or newer Microsoft Windows Download and install the MSI package for psqlODBC Choose the newest file from http www postgresql org ftp odbc versions msi which will be at the bottom of the downloads page This will install psqlIODBC on your system and allow you to migrate from Postgresql to MySQL using MySQL Workbench Linux After installing iODBC proceed to install the PostgreSQL ODBC drivers Download the psqlODBC source tarball file from http www postgresql org ftp odbc versions src Use the latest version available for download which will be at the bottom of the downloads page The file will look similar to psqlodbc 09 01 0200 tar gz Extract this tarball to a temporary location open a terminal and cd into that directory The installation process is shell gt cd the src directory shell gt configure with iodbc enable pthreads shell gt make shell gt sudo make install Verify the installation by confirming that the file psqlodbcw so is in the usr local 1lib directory Next you must register your new ODBC Driver Open the iODBC Data Source Administrator application by either executing iodbcadm gtk in the command line or by launching it from the Overview page of the MySQL Workbench Migration Wizard by clicking the Open ODBC Administrator button Go to the ODBC Drivers tab in the iODBC Data Source Administrator It should look similar to 218 Preparations Figure 11 18
90. and column definitions in the next step which is Section 11 7 6 Manual Editing The steps performed include Migrating the selected objects and generating the SQL CREATE statements 11 7 6 Manual Editing The migrated objects may be reviewed and edited here You can manually edit the generated SQL before applying them to the target database Target schemas and tables may be renamed and column definitions may be changed by double clicking on them By default the All Objects View is loaded Other View options include Migration Problems and Column Mappings All Objects Shows all objects which can also be edited by double clicking e Migration Problem Will list all of the migration problems or report that no mapping problems were found Column Mappings Displays all of the schema columns which may also be edited There is an advanced Show Code and Messages option that displays the SQL CREATE script for the selected object 11 7 7 Target Creation Options Defines addition settings for the target schema Configuration options include Create schema in target RDBMS e Create a SQL script file e An option to keep the schemata if they already exist Objects that already exist will not be recreated or update 11 7 8 Schema Creation The SQL scripts generated for the migrated schema objects will now be executed in the target database You can monitor execution in the logs if errors exist then they will be fixed
91. and conditions 6 This License Agreement shall be governed by and interpreted in all respects by the law of the State of California excluding conflict of law provisions Nothing in this License Agreement shall be deemed to create any relationship of agency partnership or joint venture between BeOpen and Licensee This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee or any third party As an exception the BeOpen Python logos available at http www pythonlabs com logos html may be used according to the permissions granted on that web page 7 By copying installing or otherwise using the software Licensee agrees to be bound by the terms and conditions of this License 366 Python License Agreement CNRI LICENSE AGREEMENT FOR PYTHON 1 6 1 1 This LICENSE AGREEMENT is between the Corporation for National Research Initiatives having an office at 1895 Preston White Drive Reston VA 20191 CNRI and the Individual or Organization Licensee accessing and otherwise using Python 1 6 1 software in source or binary form and its associated documentation 2 Subject to the terms and conditions of this License Agreement CNRI hereby grants Licensee a nonexclusive royalty free world wide license to reproduce analyze test perform and or display publicly prepare derivative works distribute and otherwise use Python 1
92. available in MySQL at the database level Schema Yes Yes Yes Yes Equivalent to database in MySQL Sybase ASE Schemata corresponds to user names Sequences Yes Yes Yes Yes Standalone sequence objects are not supported in MySQL Similar functionality can be obtained with IDENTITY columns in MSSQL and AUTO_INCREMENT columns in MySQL SQL Modes Yes Yes Yes SET_ANSIL in MSSQL Storage Engines N A N A Yes Yes PostgreSQL itself supports and uses only one storage engine Postgresql Other companies have added extra storage engines to PostgreSQL Stored Procedures Yes Yes Yes Yes Synonyms N A N A N A N A Table Yes Yes Yes Yes Tablespace Yes Yes Yes N A MSSQL groups tables in schemata unless referring to CREATE TABLESPACE Sybase ASE tables are grouped in schemata which are more like user names Temporary Tables Yes Yes Yes Yes Transactions Yes Yes Yes Yes Triggers Yes Yes Yes Yes UDFs Yes Yes Yes Yes Unicode Yes Yes Yes Yes Unique Key Yes Yes Yes Yes User Yes Yes Yes Yes Views Yes Yes Yes Yes 214 Microsoft SQL Server migration A Microsoft SQL Server database is made up of one catalog and one or more schemata MySQL only supports one schema for each database or rather a MySQL database is a schema so this difference in design must be planned for The Migration Wizard must know how to handle the migration of schemata for the source Microsoft SQL Server database It can either keep all of
93. button The stored connection then is available for use from any of the wizards requiring a connection to a live server You can duplicate an existing connection using the Duplicate button This is an easy way to begin setting up a new connection that differs only slightly from an existing one 7 6 1 The Password Storage Vault The vault provides a convenient secure storage for passwords used to access MySQL servers By using the vault you need not enter credentials every time MySQL Workbench attempts to connect to a server The vault is implemented differently on each platform Windows The vault is an encrypted file in the MySQL Workbench data directory This is where connections xml and related files are located The file is encrypted using a Windows API which performs the encryption based on the current user so only the current user can decrypt it As a result it is not possible to decrypt the file on any other computer It is possible to delete the file in which case all stored passwords are lost but MySQL Workbench will otherwise perform as expected You then must re enter passwords as required e Mac OS X The vault is implemented using the Mac OS X Secure Keychain The keychain contents can be viewed using the Keychain Access app Utility 67 Standard TCP IP Connection e Linux The vault works by storing passwords using the gnome keyring daemon which must be running for password persistency to work The daemon is automatic
94. cece eeeeee teeter ee ee ee aaa teeeeeeeeeeeaaaaeeeeseeeeeeaeaaeaees 200 TAs ODBC Librae S aeieeiaii deedesehondellvasieaet eeateactuiuivexsacpacasuaauaeaetavas onctina at 200 12 ODBC Drivers sisa anaedai anea i davies lauiaide aden soled aa ceed 201 11 2 Migration Overview ceccecececece cece cece ee ee eee ee te eee e ee ee aaa a ee ee esse ee aeaaeeeeeeeeeeeeaeaaeaeeeeseeeeaeaaeaees 201 11 2 1 A visual guide to performing a database migration ceeeeeeeeeeeeeneeeeeeaaeeeeeeaaee ees 202 11 2 2 Migrating from Supported databases ccceccceeeeeeeeeeeeeee cece eeeeeeeeeeeeaaeaeeeeeeeeeeeeaea 212 11 2 3 Migrating from unsupported generic databases cece eeeeeeeeeeeeeeaaeeeeeeaaeeeees 213 3 Conceptual DBMS equivalents ccccceeceeeeeeee cece ee eeeeeeeeeeeeeeaaeaeeeeeeeeeeeaaaaeeeeseeeeeeaaaaeeeees 213 11 4 Microsoft SQL Server Migration cece cece cece cece cece eect eect tees seca ea eee sete ee ee aaaaeeeeeeeeeeeaaaaeenees 215 TAA Preparations secisccccec tac vecee dasece bans REE EE Eria E EEES AREAS shi vuascantiessceted deucecebeeatackivuateer 215 TLA 2 DOVES orcarina lisence tae le ate eet ed eee 215 11 4 3 Connection Setup 20 0 ccc cece ee ee eee etter ee ee ee ae aa etter ee ee sede aaae te eeeeeeseaaaaaaneeeeeeees 216 11 4 4 Microsoft SQL Server Type Mapping ccceceeeeeee ee ceceeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaees 216 11 5 PostgreSQL Migration poirien nissu
95. default is to use LIKE for matching rpl lt dump_option gt replication lt dump_option gt Include replication information Permitted values are master include the CHANGE MASTER statement using the source server as the master slave include the CHANGE MASTER statement using the destination server s master information and both include the master and slave options where applicable rpl file RPL_FILE replication file RPL_FILE The path and file name where the generated replication information should be written Valid only with the rp1 275 option rpl user lt replication_user gt The user and password for the replication user requirement in the format lt users lt password gt or lt login path gt For example rp1 passwd The default is None Server lt server gt Connection information for the server in lt user gt lt passwa gt lt host gt lt port gt lt socket gt or lt ogin path gt lt port lt socket skip lt skip objects gt Specify objects to skip in the operation as a comma separated list no spaces Permitted values are CREATE_DB DATA EVENTS FUNCTIONS GRANTS PROCEDURES TABLES TRIGGERS and VIEWS 275 mysqldbexport Export Object Definitions or Data from a Database NOTES e skip blobs Do not export BLOB data e skip gtid Skip creation of GTID_ PURGED statements e all Generate an export file with all of the databases and the GTIDs executed to
96. dept_manager pass pass pass Database consistency check failed done Given two databases with the same table layout Data for each table contains mysql gt select from db1 tl I Test 789 2 Test 456 2 Test 123 4 New row dbl I Test 123 2 Test 456 3 Test 789 5 New row db2 4 rows in set 0 00 sec To generate the SQL statements for data transformations to make db1 t1 the same as db2 t1 use the changes for server1 263 option We must also include the a option to ensure that the data consistency test is run The following command illustrates the options used and an excerpt from the results generated mysqldbcompare serverl root root localhost server2 root root localhost db1l db2 changes for serverl a difftype sql ol Defn Row Data Type Object Name Bate Count Check TABLE ie dL pass pass FAIL Data transformations for direction serverl Data differences found among rows UPDATE db1l tl SET b Test 123 WHERE ae UPDATE db let le SH D siesta So WHERE ae 3 DELETE FROM dbl tl WHERE a 4 INSERT INTO dbl tl a bD VALUES 5 New mony Cloz p Database consistency check failed done Similarly when the same command is run with changes for server2 263 and difftype sql 264 the following report is generated mysqldbcompare serverl root root localhost 266 mysqldbcopy Copy Da
97. engine to use for all tables created on the destination server quiet q Turn off all messages for quiet execution regexp basic regexp G Perform pattern matches using the REGEXP operator The default is to use LIKE for matching rpl lt dump_option gt replication lt dump_option gt Include replication information Permitted values are master include the CHANGE MASTER statement using the source server as the master slave include the CHANGE MASTER statement using the destination server s master information and both include the master and slave options where applicable rpl user lt replication_user gt The user and password for the replication user requirement in the form lt user gt lt passwora gt or lt login path gt E g rpl passwd Default None skip gtid Skip creation and execution of GTID statements during the copy operation all Copy all of the databases on the server skip lt objects gt 269 mysqldbcopy Copy Database Objects Between Servers NOTES Specify objects to skip in the operation as a comma separated list no spaces Permitted values are CREATE_DB DATA EVENTS FUNCTIONS GRANTS PROCEDURES TABLES TRIGGERS and VIEWS e SOUrce lt SOUurce gt Connection information for the destination server in the format lt user gt lt passwd gt lt host gt lt port gt lt sockets or lt ogin path gt lt port gt lt socket gt where lt passwd
98. failover is complete and the utility has refreshed the health report e failover mode lt mode gt f lt mode gt Action to take when the master fails auto automatically fail to best slave elect fail to candidate list or if no candidate meets criteria fail fail take no action and stop when master fails Default auto e force Override the registration check on master for multiple instances of the console monitoring the same master See notes interval lt seconds gt i lt seconds gt 292 mysqlfailover Automatic replication health monitoring and failover Interval in seconds for polling the master for failure and reporting health Default 15 seconds Minimum is 5 seconds log lt log_file gt Specify a log file to use for logging messages log age lt days gt Specify maximum age of log entries in days Entries older than this will be purged on startup Default 7 days master lt connection gt Connection information for the master server in the format lt user gt lt passwa gt lt host gt lt port lt socket or lt login path gt lt port gt lt socket gt max position lt position gt Used to detect slave delay The maximum difference between the master s log position and the slave s reported read position of the master A value greater than this means the slave is too far behind the master Default 0 pedantic p Used to stop failover
99. file_name INTO var_name var RE Ae FOR UPDATE T LOCK IN SHARE HOO SELECT is used to retrieve rows selected from one smallint S UN Al PK varchar 45 varchar 45 timestamp you want to retrieve There must be at least one select_expr table_reterences indicates the table or tables trom which to retrieve rows Its syntax Schema Inspector New Schema Inspector feature allows you to browse general information from schema objects For tables it s also possible to perform maintenance tasks such as ANALYZE OPTIMIZE CHECK and CHECKSUM TABLE To access the inspector right click a schema and select the Schema Inspector Schema Inspector Figure 2 6 Schema Inspector Q Filter objects Columns indexes Triggers Views Stored Procedures Functions Events amp sakila Engine InnoDB InnoDB InnoDB InnoDB InnoDB InnoDB InnoDB InnoDB InnoDB MyISAM InnoDB InnoDB InnoDB InnoDB InnoDB InnoDB Row Format Rows Compact Compact Compact Compact Compact Compact Compact Compact Compact Dynamic Compact Compact Compact Compact Compact Compact Avg Row Length Data Length 200 81 16384 135 81920 16384 49152 16384 1589248 1589248 65536 16384 And choosing Maintenance for a table Cascaded DELETE statements generator Figure 2 7 Schema Inspector Maintenance ve Ea Columns indexes Triggers Views Stored Procedures Functions Events i iaaa Table Maintena
100. format Permitted format values are sql grid tab csv raw_csv and vertical The default is sql import lt import_type gt i lt import_type gt Specify the import format Permitted format values are definitions import only the definitions metadata for the objects in the database list data import only the table data for the tables in the database list and both import the definitions and the data The default is definitions If you attempt to import objects into an existing database the result depends on the import format If the format is definitions or both an error occurs unless drop first 280 is given If the format is data imported table data is added to existing table data new storage engine lt new_engine gt The engine to use for all tables created on the destination server no headers h Input does not contain column headers This option applies only for csv and tab output quiet q Turn off all messages for quiet execution server lt server gt Connection information for the server in the format lt user gt lt passwd gt lt host gt lt port lt socket or lt ogin path gt lt port gt lt socket gt skip lt skip_objects gt Specify objects to skip in the operation as a comma separated list no spaces Permitted values are CREATE_DB DATA EVENTS FUNCTIONS GRANTS PROCEDURES TABLES TRIGGERS and VIEWS skip blobs Do not import BLOB data skip gtid Skip ex
101. from HumanResources Finished reverse engineering of triggers for the HumanResources schema Reverse engineering of triggers for schema HumanResources completed Reverse engineering foreign keys for tables in schema HumanResources Reverse engineering of foreign keys in table HumanResources Department completed Reverse engineering of foreign keys in table HumanResources EmployeePayHistory completed Reverse engineering of foreign keys in table HumanResources JobCandidate completed Second pass of table reverse engineering for schema HumanResources completed Reverse engineering completed Reverse engineer selected schemata finished Post processing of reverse engineered schemata Post processing of reverse engineered schemata done Finished performing tasks Migration Wizard was started Source Objects The discovered objects from the Reverse Engineer Source stage are revealed and made available This includes Table View and Routine objects with only the Table objects being selected by default Figure 11 8 MySQL Workbench migration Source Objects File Edit View Database Plugins Scripting Help Migration Task List Source Objects OVERVIEW overview You may select the objects to be migrated in the lists below All tables will be migrated by default SOURCE amp TARGET Source Selection Target Selection F Migrate Table objects Fetch Schemata List i 7 total 7 selected Y Schemata Selection
102. higher recommended e RAM 4 GB 6 GB or higher recommended e Graphic Accelerators nVidia or ATI with support of OpenGL 2 or higher e Display Resolution 1280x1024 minimum 1920x1200 or higher recommended 4 2 Software Requirements The following operating systems are officially supported e Apple Mac OS X v10 6 1 32 bit 64 bit e Fedora 15 32 bit 64 bit e Microsoft Windows 7 32 bit 64 bit e Oracle Linux 6 32 bit 64 bit Ubuntu 10 04 LTS 32 bit 64 bit 19 Starting MySQL Workbench e Ubuntu 11 04 32 bit 64 bit MySQL Workbench also has the following general requirements Note R On startup the application checks the OpenGL version and chooses between software and hardware rendering To determine which rendering method is being used open the Help menu and choose the System Info item Requirements for Linux The requirements for Linux are embedded within their respective packages Use the platform specific tool for example yum or apt to install the package and their dependencies Requirements for Microsoft Windows e Microsoft NET 4 0 Framework e Microsoft Visual C 2010 Redistributable Package x86 Note R For convenience the Windows libraries are available as the download Dependencies for Compiling in Windows 4 3 Starting MySQL Workbench The procedure for launching MySQL Workbench depends on the platform Generally there are two ways to launch MySQL Workbench either from the comma
103. id SMALLINT 5 jt a staff jd TINYINT 3 l Sr a i F country_id SMALLINT S store _id TINYINT 3 fk_customer_store fk_rental_customer manager _staff id TINYINT 3 3 i fk_city_country address _id SMALLINT 5 customer_id SMALLINT 5 store_id TINYINT 3 address_id SMALLINT S l fk_customer address l Ea A A city jd SMALLINT S i Y F _rental_stafl country_id SMALLINT S i a a a ana 4 fk_staff_store l l i fk paynient rental l d i i l fk_store_dtatt i L i i tk ent_customer fk_address city Lpayment_ I T I I 3 payment_id SMALLINT S lt customer id SMALLINT 5 staff id TINYINT 3 rental_id INT 11 fk_payment_staff staff id TINYINT 3 address_id SMALLINT S5 store_id TINYINT 3 address_id SMALLINT 5 H a a city_id SMALLINT S fk_staff_address C zaa The object notation style used in Figure 8 50 The sakila Database EER Diagram is workbench PKs only This notation shows only primary keys and no other columns which is especially useful where space is at a premium The relationship notation is the default Crow s Foot As the connection lines show each table is related to at least one other table in the database with the exception of the film_text table Some tables have two foreign keys
104. if quoted text is entered the Inserts Editor performs no further checks and assumes that a correctly escaped and quoted sequence has been entered 5 2 features a new Inserts Editor In this case the user enters the string without quoting or escaping and the Inserts Editor takes care of all quoting and escaping as required Note R It is possible to enter a function or other expression into a field Use the prefix func to prevent MySQL Workbench from escaping quotation marks For example for the expression md5 fred MySQL Workbench normally would generate the code md5 fred To prevent this enter the expression as func md5 fred to ensure that the quoting is not escaped 8 7 1 3 9 The Privileges Tab Use the Privileges tab to assign specific roles and privileges to a table You may also assign privileges to a role using the role editor For a discussion of this topic see Section 8 5 5 1 Adding Roles When this tab is first opened all roles that have been created are displayed in the list on the right Move the roles you wish to associate with this table to the Roles list on the left Do this by selecting a role and then clicking the lt button Use the Shift key to select multiple contiguous roles and the Control key to select noncontiguous roles To assign privileges to a role click the role in the Roles list This displays all available privileges in the Assigned Privileges list The privileges that display are
105. implied warranty In no event will the authors be held liable for any damages arising from the use of this software Permission is granted to anyone to use this software for any purpose including commercial applications and to alter it and redistribute it freely subject to the following restrictions 1 The origin of this software must not be misrepresented you must not claim that you wrote the original software If you use this software in a product an acknowledgment in the product documentation would be appreciated but is not required 2 Altered source versions must be plainly marked as such and must not be misrepresented as being the original software 3 This notice may not be removed or altered from any source distribution L Peter Deutsch ghost aladdin com ndependent implementation of MD5 RFC 1321 This code implements the MD5 Algorithm defined in RFC 1321 whose text is available at http www Veer OEO TEC ric 3271 ot xt The code is derived from the text of the RFC including the test suite section A 5 but excluding the rest of Appendix A It does not include any code or documentation that is identified in the RFC as being copyrighted The original and principal author of md5 h is L Peter Deutsch lt ghost aladdin com gt Other authors are noted in the change history that follows in reverse chronological order 2002 04 13 lpd Removed support for non ANSI compilers removed references to Ghostscript c
106. in this product Serwer Wile License for Scintilla and SciTE Copyright 1998 2003 by Neil Hodgson lt neilh scintilla org gt All Rights Reserved Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE Scintilla includes some files copyright Adobe Systems Incorporated Copyright c 2007 Adobe Systems Incorporated Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions The above cop
107. is Catalog Validation validation is available only in the Standard Edition 142 Forward Engineering Figure 8 33 Catalog Validation Forward Engineer to Database Catalog alidati atalog Yalidation Catalog Validation The following tasks will now be executed Please monitor the execution Press Show Logs to see the execution logs Validation Finished Successfully Click Run Validations to validate the catalog Click Next to continue The next page enables you to set options for the database to be created These options are as described in Section 8 7 10 1 1 Creating a Schema 143 Forward Engineering Figure 8 34 Options Opti Sai Set Options for Database to be Created Options E DROP Objects Before Each CREATE Object E Generate DROP SCHEMA E Skip creation of FOREIGN KEYS E Omit Schema Qualifier in Object Names Generate USE statements Generate Separate CREATE INDEX Statements Add SHOW WARNINGS After Every DDL Statement Do Not Create Users Only Create Privileges Generate INSERT Statements for Tables Select the required options and then click Next The next page enables you to select the objects to forward engineer 144 Forward Engineering Figure 8 35 Select Objects to Forward Engineer Options Select Objects to Forward Engineer Select Objects To exclude objects of a specific type from the SQL Export disable the corresponding checkbox Press Show Filte
108. is available only for servers from MySQL 5 1 7 and later Internally the module operates by constructing a SELECT statement for finding matching processes and then sending it to the server Instead of performing the search the module can return the SQL code that performs the query This can be useful if you want to execute the query later or feed it to some other program that processes SQL queries further Constants The following constants correspond to columns in the INFORMATION SCHEMA PROCESSLIST table They indicate which columns to examine when searching for processes matching the search conditions lt mysql utilities command proc ID mysql utilities command proc USER mysql utilities command proc HOST mysql utilities command proc DB mysql utilities command proc COMMAND 246 mysql utilities command proc Search Processes on Servers mysql utilities command proc TIME mysql utilities command proc STATE mysql utilities command proc INFO The following constants indicate actions to perform on processes that match the search conditions mysql utilities command proc KILL_QUERY Kill the process query mysql utilities command proc KILL_CONNECTION Kill the process connection mysql utilities command proc PRINT_PROCESS Print the processes Classes class mysql utilities command proc ProcessGrep matches actions use_regexp False This class searches the INFORMATION_SCHEMA PROCESSLIST tabl
109. is valid only if 1 i st 333 is given force Drop the new user account if it exists before creating the new account Without this option it is an error to try to create an account that already exists include global privileges Include privileges that match base_user as well as base_user host list List all users on the source server With this option a destination server need not be specified quiet q Turn off all messages for quiet execution source lt source gt Connection information for the source server in the format lt users lt passwa gt lt host gt lt port gt lt socket gt Jor lt login path gt lt port gt lt socket verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug version Display version information and exit You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to access all objects in the operation The account used to connect to the source server must have privileges to read the mysql database The account used to connect to the destination server must have privileges to execute CREATE USER and DROP USER if the force 333 option is given and privileges to execute GRANT for all privileges to be granted to the new accounts For the format 333 option
110. know the instance is a clone so some of the values are going to be the same and we use a default root password so that is also known Likewise we specified the data directory and since we are running on a Linux machine we know what the socket path is For Windows machines you can leave the socket value None We pass this dictionary to the copy method dest_values user conn get user passwd t sO Oiler host conn get host port opt new_port unix_socket os path join opt new_data mysql sock In this case a number of options are needed to control how the copy works for example if any objects are skipped For our purposes we want all objects to be copied so we supply only the minimal settings and let the library use the defaults This example shows how you can fine tune the scripts to meet your specific needs without having to specify a lot of additional options in your script We enable the quiet option on so as not to clutter the screen with messages and tell the copy to skip databases that do not exist in case we supply the databases option and provide a database that does not exist options quiet True force True The actual copy of the databases is easy Just call the method and supply the list of databases from mysql utilities command import dbcopy isa dbcopy copy_db conn dest_values db_list options except exception UtilError e print ERROR
111. launches the Server Administration dialog from which you can select the server instance to which you wish to connect A new Admin tab will be launched which displays the Server Status and Configuration Server Administration icon 179 New Server Instance If you have already created server instances you can most quickly launch these by clicking the icon for the Server Instance you wish to access A new Admin tab will be launched which displays Server Status and Configuration For further details see Section 10 7 Server Administration and Configuration 10 2 New Server Instance This action item enables you to create a new server instance A server instance is primarily a combination of connection and configuration details for a specific server that you wish to manage When you Click this item a wizard is launched that enables you to specify the connection and various other configuration parameters After completion of the wizard a new Admin tab is launched which displays Server Status and Configuration For further details see Section 10 6 1 New Server Instance Wizard 10 3 Manage Data Import Export This action item enables you to create a dump file from a database or restore data from a file to a live database Clicking this item launches the Import Export MySQL Data wizard This enables you to select a server instance to connect to For further details see Section 10 7 6 The Data Dump Tab 10
112. main menu You can also open the Workbench Scripting Shell using the Control F3 key combination on Windows and Linux Command F3 on Mac OS X or by clicking the shell button above the EER diagram navigator The Workbench Scripting Shell will then open in a new dialog The following screenshot shows the Workbench Scripting Shell dialog Figure 12 1 The Workbench Scripting Shell Modules List Shell X Snippets GRT Modules v f Codeutils gt f copyAsPHPConnet gt f getPluginInfo anni y C Users philip AppData gt f copyAsPHPQueryAndFetch gt f DbGenericMigration gt f9 DbGenericRE gt f DbMssq Migration gt 8 DbMssqIRE gt f DbMysal gt f DbMySQLFE gt f DbMySQLMigration gt f DbMySQLQuery or C Program Files x86 MySQL gt f DbMySQLRE gt DbPostgresq Migration gt f DbPostgresqIRE gt f DbSql92Migration gt f9 DbSql92RE gt f DbSybaseMigration gt f DbSybaseRE gt f9 Dbutils gt f Forms Function a int copyAsPHPConnect db query Editor editor for modules C Users philip AppData Roaming Arguments editor language Copies PHP code to connect to the active MySQL dy connection to the dipboard s Files Globals Classes Modules 229 The Shell Window 12 5 2 The Shell Window The Workbench Scripting Shell is primarily used for running Python or Lua scripts or typing commands in these languages directly However you can also
113. mainFileName gt custom_report txt lt value gt lt value gt lt data gt Create the new template file This too may best be achieved depending on your requirements by editing an existing template In this example the template file report t xt tp1 is shown here Total number of Schemata SCHEMA_COUNT SCHEMATA SCHEMA_NR Schema SCHEMA_NAME Tables TABLE_COUNT TABLES TABLE_NR_FMT Table TABLE_NAME COLUMNS_LISTING Columns Key Column Name Datatype Not Null Default Comment COLUMNS COLUMN_KEY COLUMN_NAME COLUMN_DATATYPE COLUMN_NOTNULL COLUMN_DEFAULTVALUE COLUMN_COMMENT COLUMNS COLUMNS_LISTING INDICES_LISTING Indices Index Name Columns Primary Unique Type Kind Comment INDICES INDEX_NAME INDICES_COLUMNS INDEX_COLUMN_NAME INDEX_COLUMN_ORDER INDEX_COLUMN_COMMENT INDICES_COLUMNS INDEX_PRIMARY INDEX_UNIQUE INDEX_TYPE INDEX_KIND INDEX_COMMENT INDICES INDICES_LISTING REL_LISTING Relationships Relationship Name Relationship Type Parent Table Child Table Cardinality REL REL_NAME REL_TYPE REL_PARENTTABLE REL_CHILDTABLE REL_CARD REL REL_LISTING TABLES SCHEMATA End of MySQL Workbench Report This template shows details for a
114. may choose any version ever published by the Free Software Foundation 14 If you wish to incorporate parts of the Library into other free 355 GNU Lesser General Public License Version 2 1 February 1999 programs whose distribution conditions are incompatible with these write to the author to ask for permission For software which is copyrighted by the Free Software Foundation write to the Free Software Foundation we sometimes make exceptions for this Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally NO WARRANTY 15 BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE THERE IS NO WARRANTY FOR THE LIBRARY TO THE EXTENT PERMITTED BY APPLICABLE LAW EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND OR OTHER PARTIES PROVIDE THE LIBRARY AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU SHOULD THE LIBRARY PROVE DEFECTIVE YOU ASSUME THE COST OF ALL NECESSARY SERVICING REPAIR OR CORRECTION 16 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR ANY OTHER PARTY WHO MAY MODIFY AND OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE BE LIABLE
115. migrated to utf8_general_ci Migration Wizard was started Pressing Finish will close the migration window The database may now be viewed within the MySQL Workbench SQL editor 5 Migrating from supported databases Note If a MySQL Workbench SQL Editor tab is already opened then the schema list within the Object Browser must be refreshed in order to view the newly imported schema When a supported RDBMS product is being migrated the MySQL Workbench Migration Wizard will automatically convert as much information as it can but you may still be required to manually edit the automatically migrated schema for difficult cases or when the default mapping is not as desired Generally speaking only table information and its data are automatically converted to MySQL Code objects such as views stored procedures and triggers are not But supported RDBMS products will be retrieved and displayed in the wizard You can then manually convert them or save them for converting at a later time The following RDBMS products and versions are currently tested and supported by the MySQL Workbench Migration Wizard although other RDBMS products can also be migrated with Section 11 2 3 Migrating from unsupported generic databases e Microsoft SQL Server 2000 Microsoft SQL Server 2005 Microsoft SQL Server 2008 Microsoft SQL Server 2012 e MySQL Server 4 1 and greater as the source and MySQL Server 5 1 and greater as the target
116. model The actions that are configured to occur would result in t able3 being altered to include the relationship with table4 table4 being created and table5 being dropped in the live database It is possible to reconfigure this though The next example shows how the direction of synchronization can be changed 149 Forward Engineering Figure 8 40 Controlling Synchronization Direction Synchronize Model with Database Connection Options A Model and Database Differences Connect to DBMS ct Schemata f i suis Double click arrows in the list to choose whether to ignore changes update the model with database changes or Model Update Source S mydb mydb J tablet tablet tablez table2 tables table3 tables table a Select Changes to Apply In this case the synchronization direction has been changed so that rather than the default action of table5 being dropped from the live database it will be incorporated into the MySQL Workbench model For convenience the wizard provides three additional buttons to enable synchronization directions to be applied to a group of selected changes The Update Model button causes the selected changes to be applied only to the model itself In the following example table7 would be added to the model 150 Forward Engineering Figure 8 41 Update Model Button Synchronize Model with Database Model and Database Differences Double click arrows in the list
117. mysql connector Execute the search on each of the connections supplied If output is not None the value is treated as a file object and the result of the execution is printed on that stream Note that the output and connector arguments must be supplied as keyword arguments All other arguments are treated as connection specifiers Parameters connections Sequence of connection specifiers to send the search to 247 Manual Pages output File object to use for writing the result connector Connector to use for connecting to the servers 14 4 Manual Pages 14 4 1 MySQL Utilities Overview Brief overview of command line utilities This is a brief overview of the MySQL command line utilities See their respective manual pages for further details and examples mysqlauditadmin e Monitor the audit log Copy rotate and configure the audit log mysqlauditgrep e Search the audit log e Output results to different formats mysqldbcompare e Compare databases on two servers or the same server e Compare definitions and data e Generate a difference report e Generate SQL transformation statements mysqldbcopy Copy databases between servers e Clone databases on the same server e Supports rename mysqldbexport Export metadata and or data from one or more databases e Formats SQL CSV TAB Grid Vertical mysqldbimport e Import metadata and data from one or more files e Reads all formats from
118. mysql utilities command grep USER The following constant is a sequence of all the object types that are available It can be used to generate a version independent list of object types that can be searched for example options and help texts mysql utilities command grep OBJECT_TYPES Classes class mysql utilities command grep ObjectGrep pattern database_pattern None types OBJECT_TYPES check_body False use_regexp False Search MySQL server instances for objects where the name or content for routines triggers or events matches a given pattern sql string Return the SQL code for executing the search in the form of a SELECT statement Returns SQL code for executing the operation specified by the options Return type string execute connections output sys output connector mysql connector Execute the search on each of the connections in turn and print an aggregate of the result as a grid table Parameters connections Sequence of connection specifiers to send the query to e output File object to use for writing the result connector Connector to use for connecting to the servers 14 3 2 mysql utilities command proc Search Processes on Servers This module searches processes on a server and optionally kills either the query or the connection for all matching processes Processes are matched by searching the fields of the INFORMATION _SCHEMA PROCESSLIST table which
119. mysqldbexport mysqldiff Compare object definitions e Generate a difference report mysqldiskusage e Show disk usage for databases 248 MySQL Utilities Overview Brief overview of command line utilities e Generate reports in SQL CSV TAB Grid Vertical mysqlfailover e Provides automatic failover on a replication topology e Uses Global Transaction Identifiers GTID MySQL Server 5 6 5 mysqlindexcheck e Read indexes for one or more tables e Check for redundant and duplicate indexes e Generate reports in SQL CSV TAB Grid Vertical mysqlmetagrep e Search metadata e Regexp database search e Generate SQL statement for search query mysqlprocgrep e Search process information e Generate SQL statement for search e Kill processes that match query mysqlreplicate e Setup replication e Start from beginning current specific binlog pos mysqlrpladmin e Administers the replication topology Allows recovery of the master e Commands include elect failover gtid health start stop and switchover mysqlrplcheck e Check replication configuration e Tests binary logging on master mysqlrplshow e Show slaves attached to master e Can search recursively e Show the replication topology as a graph or list mysqlserverclone e Start a new instance of a running server 249 mysqlauditadmin Allows users to perform maintenance action on the audit log mysqlserverinfo e Show server information Can se
120. ncini anrnniied een taane a aaan einan di aaa i aaki ia napia N d 73 FTA Main TabShe ets suniti R E A T 74 7 7 5 Sidebar MySQL Workbench provides extensive facilities for working directly with SQL code Before working directly with a live server a connection must be created After a connection is established it is possible to execute SQL code directly on the server and manipulate the server using SQL code The starting point for embarking on SQL Development work is the SQL Development area of the Home window which has the following action items e Open Connection to start Querying e New Connection e Edit Table Data Edit SQL Script e Manage Connections The following sections describe each of these action items Note E The SQL Development facility in MySQL Workbench provides the functionality that was formerly available in MySQL Query Browser 7 1 Open Connection to Start Querying Clicking this action item launches the Connect to Database Wizard From this wizard you can select a predefined connection A new SQL Editor tab is launched If you already have created a connection to a database it will appear in this panel as an icon Double clicking the icon directly launches an SQL Editor tab and connects you to the database as defined by the connection To read more about the SQL Editor see Section 7 7 SQL Editor 65 New Connection 7 2 New Connection Clicking the New Connection action item laun
121. not allow a connection without specifying a database name The migration process is similar to other databases See Section 11 5 4 PostgreSQL Type Mapping for information on how the migration wizard migrates types from PostgreSQL to MySQL and Section 11 2 1 A visual guide to performing a database migration for a general migration guide 11 5 4 PostgreSQL Type Mapping Table 11 3 Type mapping Source Type MySQL Type Comment INT INT SMALLINT SMALLINT BIGINT BIGINT SERIAL INT Sets AUTO_INCREMENT in its table definition SMALLSERIAL SMALLINT Sets AUTO_INCREMENT in its table definition BIGSERIAL BIGINT Sets AUTO_INCREMENT in its table definition BIT BIT BOOLEAN TINYINT 1 REAL FLOAT 220 PostgreSQL Type Mapping Source Type MySQL Type Comment DOUBLE PRECISION DOUBLE NUMERIC DECIMAL DECIMAL DECIMAL MONEY DECIMAL 19 2 CHAR CHAR LONGTEXT Depending on its length MySQL Server 5 5 and above can have CHAR columns with a length up to 255 characters Anything larger is migrated as LONGTEXT NATIONAL CHAR LONGTEXT Depending on its length MySQL Server 5 5 CHARACTER and above can have VARCHAR columns with a length up to 65535 characters Anything larger is migrated to one of the TEXT blob types In MySQL character set of strings depend on the column character set instead of the datatype VARCHAR VAR
122. occurs if a prefix matches more than one valid value The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf 328 mysqluc Command line client for running MySQL Utilities EXAMPLES To display the server information for the local server and the settings for mysqid in the configuration file with the output in a vertical list use this command mysqlserverinfo server root pass localhost d format vertical Source on localhost connected KREKKKKKKKKKK KKK KKK KKKKKKEK lee row KREKEKKKKKKKKKKKKKKKKKKKKKK server localhost 3306 version o n il S0 lheg datadir usr local mysql data basedir usr local mysql 5 1 50 osx10 6 x86_64 plugin_dir usr local mysql 5 1 50 o5x10 6 x86_64 1ib plugin config_file etc my cnf binary_log my_log 000068 binianylogmpos 2 l2 3183 relay_log None relay_log_pos None 1 rows Defaults for server localhost 3306 port 3306 basedir usr local mysql datadir usr local mysql data server_id 5 log bin my_log general_log slow_query_log innodb_data_file_path ibdatal 778M ibdata2 50M autoextend done 14 4 20 mysqluc Command line client for running MySQL Utilities This utilit
123. of tests based on a common code base EXAMPLES The following example demonstrates how to invoke mut to execute a subset of the tests using an existing server which is cloned The example displays the test name status and relative time mut server root localhost do tests clone_user width 70 MySQL Utilities Testing MUT Parameters used Display Width 70 Sorted True Force False Test directory S URIE Uciihiedes directory taal oemiae Stacci PORE 3310 Test wildcard clone_user servers Connecting to localhost as user root on port 3306 CONNECTED TEST NAME STATUS TIME main clone_user pass 54 main clone_user_errors pass ae main clone_user_parameters pass Ly Testing completed Friday 03 December 2010 09 50 06 All 3 tests passed 14 7 Appendix 14 7 1 MySQL Utilities FAQ Frequently Asked Questions with answers Questions 14 7 1 1 1 839 Are these utilities present in the community version of MySQL 14 7 1 2 1 339 Can the utilities be used with MyISAM or CSV 14 7 1 3 1 339 Can the frm reader read a frm file without the associated data files 14 7 1 3 2 339 Will the frm reader modify my original frm file 14 7 1 3 3 3839 What is diagnostic mode and why doesn t it produce the same output as the default mode 14 7 1 3 4 339 If the diagnostic mode is only a best effort compilation why use it 14 7 1 3 5 339 Why does the default mode require a server 14 7 1 3
124. option of filtering which objects are imported Each section has a Show Filter button Click this button if you do not want to import all the objects of a specific type 132 Reverse Engineering Figure 8 23 Select Objects Connection Options T Select Objects to Reverse Engineer Connect to DBMS Select Schemata Fetch Object Info Select Objects a V Import MySQL Table Objects 3 Total Objects 3 Selected Place imported objects on a diagram For the Import MySQL Table Objects section if you click the Show Filter button the following page is displayed 133 Reverse Engineering Figure 8 24 Show Filter Connection Options Select Objects to Reverse Engineer Connect to DBMS Fetch Object Info g Import MySQL Table Objects Select Objects V Place imported objects on a diagram This page enables you to select specific tables for import Having selected the desired tables you can optionally hide the filter by clicking the Hide Filter button The other sections such as MySQL Routine Objects have similar filters available Click Execute to continue to the next page The wizard then imports objects displaying the tasks that have been carried out and whether the operation was successful If errors were generated you can click the Show Logs button to see the nature of the errors 134 Reverse Engineering Figure 8 25 Progress Connection Options Reverse Engineering Progre
125. options are described below e String Matching default or Regular Expression Search by matching a string or a PCRE regular expression Ignore Case A case insensitive search Works with both the String Matching and Regular Expression search methods Enabled by default e Match Whole Words If enabled only whole strings are matched For example a search for home would not match home_id Disabled by default 88 Modeling Menus e Wrap Around The search will wrap around to the beginning of the document as otherwise it will only search from the cursor position to the end of the document Enabled by default e And the arrows jump to the discovered search terms and behave according to the Wrap Around option The Standard Edition of MySQL Workbench includes a more advanced Find facility Figure 8 3 The Find Window Find Text In Location Current View C Match Case C Whole Word C Use Regular Expressions C Search in Comments C Search in SQL for Views SPs etc You can search the following locations Entire Model Searches the entire model e Current View Searches the current view only This may be the MySQL Model page All Views Searches the MySQL Model Page and all EER diagrams Database Objects Searches database objects only Selected Figures Searches the currently selected objects This feature works only for EER diagrams Enter the text you wish to search for in the F
126. options become enabled The user can scroll the list up with the up arrow key and down with the down arrow key Use the verbose 294 option to see additional information in the health report and additional messages during failover OPTIONS mysqlfailover accepts the following command line options e help Display a help message and exit e candidates lt candidate slave connections gt Connection information for candidate slave servers for failover in the form lt user gt lt passwa gt lt host gt lt port gt lt socket gt or lt login path gt lt port gt lt socket gt Valid only with failover command List multiple slaves in comma separated list e discover slaves login lt user password gt At startup query master for all registered slaves and use the user name and password specified to connect Supply the user and password in the form lt user gt lt passwa gt or lt ogin path gt For example discover joe secret will use joe as the user and secret as the password for each discovered slave e exec after lt script gt Name of script to execute after failover or switchover Script name may include the path e exec before lt script gt Name of script to execute before failover or switchover Script name may include the path e exec fail check lt script gt Name of script to execute on each interval to invoke failover e exec post failover lt script gt Name of script to execute after
127. optparse import os import sys from mysql utilities import VERSION_FRM from mysql utilities command import dbcopy from mysql utilities command import serverclone from mysql utilities command import userclone from mysql utilities common server import Server from mysql utilities common options import parse_connection from mysql utilities exception import UtilError Constants NAME example copy_server DESCRIPTION copy_server copy an existing server USAGE Sprog server user pass host port socket __new dir lt path gt new id lt server_id gt _ new port lt port gt databases lt db list gt users lt user list gt Setup the command parser parser optparse OptionParser version VERSION_FRM format program os path basename sys argv 0 description DESCRIPTION usage USAGE add_help_option False parser add_option help action help Setup utility specific options Connection information for the source server parser add_option server action store dest server type string default root localhost 3306 help connection information for original server in the form lt user gt lt password gt lt host gt lt port gt lt socket gt Data directory for new instance parser add_option new data action store dest new_data type string help the full path to the location of the data directory for the new instance Port fo
128. or after t2 mysqlmetagrep Gb pattern t2 server mats localhost 4 4 4 4 Connection Object Type Object Name Database 4 4 4 4 Sook Glocaltiost lt 2306 TREGGES Celso test Pooks localhost lt 2306 TABLE 2 test 4 4 4 4 14 4 13 mysqlprocgrep Search Server Process Lists This utility scans the process lists for the servers specified using instances of the server 305 option and selects those that match the conditions specified using the age 304 and mat ch xxx options For a process to match all conditions given must match The utility then either prints the selected processes the default or executes certain actions on them If no age 304 or mat ch xxx options are given the utility selects all processes The mat ch xxx options correspond to the columns in the INFORMATION_SCHEMA PROCESSLIST table For example mat ch command 304 specifies a matching condition for PROCESSLIST COMMAND column values There is no match time option To specify a condition based on process time use age 304 Processes that can be seen and killed are subject to whether the account used to connect to the server has the PROCESS and SUPER privileges Without PROCESS the account cannot se
129. or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE A 7 CURL libcur1 License The following software may be included in this product CURTE Ee ae il Use of any of this software is governed by the terms of the license below COPYRIGHT AND PERMISSION NOTICE Copyright 1996 2009 Daniel Stenberg lt daniel haxx se gt All rights reserved Permission to use copy modify and distribute this software for any purpose with or without fee is hereby granted provided that the above copyright notice and this permission notice appear in all copies THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS
130. other materials provided with the distribution 3 Neither the name of the project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE Floating point exception control Copyright c 1996 The Regents of the University of California All rights reserved Permission to use copy modify and distribute this software for any purpose without fee is hereby granted provided that this en tire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software
131. panel features multiple tabs Startup Configuration Accounts Connections Variables Data Dump and Logs 10 7 Server Administration and Configuration The Administrator functionality in MySQL Workbench is grouped into several tabs Startup Enables you to start and stop the MySQL server and view the startup message log Configuration Enables you to view and edit the MySQL Configuration file my ini or my cnf using GUI controls Accounts Enables you to create user accounts and assign roles and privileges Connections Displays connections to MySQL Server Variables Displays system and status variables Data Dump Import and export of data Logs Displays server log file entries The Administrator also displays system and server status System status includes CPU utilization Memory usage Connection Health For server health the following are displayed Connection Usage Traffic Query Cache Hit Rate Key Efficiency 185 The Startup Tab Figure 10 3 MySQL Workbench Admin Page i Task and Object Browser Server Status MANAGEMENT INFO SYSTEM SERVER HEALTH gt Serer Status _ amp Name mysqld 127 0 0 1 i f Startup Shutdown oe Host 127 0 0 1 Server 5 5 9 E Status and System Variables A Status Running CPU 19 Mem 73 Connection Usage 5 Traffic 7 95 KB s Query Cache Hitrate 0 00 Ki Server Logs CONFIGURATION Host fa Options File localhost 49171 localhost 53528 localhost 5
132. quotes around command list e utildir lt path gt location of utilities e width lt number gt Display width Using the execute option or piping commands to the console may require quotes or double quotes for example on Windows EXAMPLES To launch the console use this command mysqluc The following demonstrates launching the console and running the console command help utilities to see a list of all utilities supported The console will execute the command then exit S mysqluc e help utilities ie aIl esy Description mysqlindexcheck check for duplicate or redundant indexes mysqlrplcheck check replication mysqluserclone clone a MySQL user account to one or more new users mysqldbcompare compare databases for consistency mysqldiff compare object definitions among objects where the difference is how dbl objl differs from db2 o0bj2 mysqldbcopy copy databases from one server to another mysqlreplicate establish replication with a master mysqldbexport export metadata and data from databases mysqldbimport import metadata and data from files mysqlmetagrep search metadata mysqlprocgrep search process information mysqldiskusage show disk usage for databases mysqlserverinfo show server information mysqlserverclone start another instance of a running server The following demonstrates launching the console to run several commands using the execute option to including setting a variable for a server co
133. reflect the adjusted model For instructions on importing a DDL script see Section 8 7 9 1 Reverse Engineering Using a Create Script Select the File Export Forward Engineer SQL ALTER Script menu item to start the Forward Engineer an ALTER Script wizard You will be presented with the first page showing the available options 140 Forward Engineering Figure 8 31 Options Forward Engineer an ALTER Script Opti JEL Forward Engineer ALTER Script Options Pick the SQL script file to be compared with the current model Input File Enter the path for the ALTER script to be created Output File Leave blank to view generated script but not save to a file This first page enables you to select an SQL script and compare it with the model currently in MySQL Workbench The difference between the two models will be used to create an alter script that can be used to modify the target schema to match the model held in MySQL Workbench To view the script generated rather than saving it to a file leave the Output File field empty schema_name table_name Otherwise MySQL Workbench cannot generate Note E The script selected as the Input File must use full schema qualifiers such as a useable alter script Clicking Next brings you to the Review SQL Script page 141 Forward Engineering 8 7 10 2 Figure 8 32 Script Forward Engineer an ALTER Script Options sea Review Generated Script
134. reied dene thd dene Ni AVET AAA E a ened nvennt baie 49 6 1 Workbench Central 0 cccccceee ce eeceeeee cece tees ae aaa teense esse ee aaeaaeeeeeeeeeeeaaaaaeeeeeeeeseeaeaaaaneneeress 50 6 2 WOLKSP ACOs ace a eiae acre eevee a cee eee eee eS 51 6 3 Workbench Application Minimum Window Size 0 ecceeeeeeeeeeeeeeeeeeeeeeaeaaeeteeeeeeeeeaeaaee 51 6 4 Workbench Preferences cccececcceeeee cece eeeeeeeeeeeeeeeeeeeeeeeeseeeeeaeaaeeeeecsaeesaeeaaeeeaaeneeeaned 51 6 4 1 The General Tabs sierra a ie ae A an ae 51 6 4 2 The Administrator Tab nivi coour ewr ee eee tree eee eres ee aa eee ee E EN AENA EKANA aK NVE 53 6 4 3 Th SQL Editor Tabi iai ae aneia a geal aaa ro aE A ai dee 54 6 4 4 The SQL Queries Tab esseesseeenessessseenrersresstsrntrrrersstsnntrretrsessnntnrenrensnennnnt 55 6 4 5 The Model Tabi resene aka etetea seinen aeaaea a aKa i taii weg E OPIA Ka ANINA eiA 57 6 4 6 The Model MySQL Tab ccceeccccceeceeeeeeee esac eae eeeeeeeeaeaa aaa eeeeeeeeaeaaaaaaeeeeeeeeaeaaea 59 6 4 7 The Diagrami TAN eect oE e ATE EONS cate ceag das content ats cate 60 6 4 8 The Appearance Tab sinnani aia iaa aa NEE aa a SNE A aa a 61 7 SQL DEVElOPMENE aaaea heed paves od oraaa a eaaa AARE aa DAAA Ma A ENEE Hea aAA a AE EAE STe EENAA aa a ra aa Eaa 65 7 1 Open Connection to Start Querying c ccc ceeeee cece ee eee eete eter tees ae aaa teeeeeeeeeeeaaaaaeeeeeeeeeeeaea 65 Ten New Connection essene i
135. same machine as this application select localhost Otherwise please specify the TCP IP address or the network name of the remote machine You may also pick an existing database connection localhost Remote Host Address Either IP Address or Hostname Take Parameters from Existing Database Connection Local instance MySQL55 User root Host localhost 3306 4 Next you will set up a connection or select an existing connection to use to connect to the server Assuming that you have not already created a connection you can use the default values here although if your MySQL Server has a password set for the root account you can enter it here by clicking Store in Vault This enables you to connect to the server without needing to enter a password each time It is also possible to use a different account to connect to the server by setting the user name and password here if required 29 Administering a MySQL Server Figure 5 3 Getting Started Tutorial Database Connection Create New Server Instance Profile ost Machine sch Set the Database Connection values Database Connection Connection Name localhost Type a name For the connection Connection Method Standard TCP IP Method to use to connect to the RDBMS Parameters Advanced Hostname localhost Port 3306 Name or IP address of the server host TCP I Username root Name of the user to connect with
136. software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws Except as expressly permitted in 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 any means Reverse engineering disassembly or decompilation of this software unless required by law for interoperability 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 on behalf of the U S Government the following notice is applicable U S GOVERNMENT RIGHTS Programs software databases and related documentation and technical data delivered to U S Government customers are commercial computer software or commercial technical data pursuant to the applicable Federal Acquisition Regulation and agency specific supplemental regulations As such the use duplication disclosure modification and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract and to the extent applicable by the terms of the Government contract the additional rights set forth
137. the recurse 323 option This causes the utility to connect to each slave found and attempt to determine whether it has any slaves If slaves are found the process continues until the slave is found in the list of servers serving as masters a circular topology The graph displays the topology with successive indents A notation is made for circular topologies If you use the recurse 323 option the utility attempts to connect to the slaves using the user name and password provided for the master By default if the connection attempt fails the utility throws an error and stops To change this behavior use the prompt 323 option which permits the utility to prompt for the user name and password for each slave that fails to connect You can also use the num ret ries n 322 option to reattempt a failed connection n times before the utility fails An example graph for a typical topology with relay slaves is shown here Replication Topology Graph localhost 3311 MASTER r lleealinosics 3510 Sian loca llaogsics 332 SLAVE t MASTER T lI calinosicg Soils Sivas MASTER SLAVE and SLAVE MASTER indicate that a server is a master only slave only and both slave and master respectively A circular replication topology is shown like this where lt gt indicates circularity 321 mysqlrplshow Show Slaves for Master Server Replication Topology Graph localhos
138. the object and in the Properties palette set the visible property to False The Layer palette provides an easy way to locate an object such as a relationship that has been set to hidden Open the Layers palette and select the object by double clicking it You can then edit the object and change its visibility setting to Fully Visible 99 The Properties Palette 8 5 12 The Properties Palette The Properties palette is used to display and edit the properties of objects on an EER diagram It is especially useful for editing display objects such as layers and notes All objects except connections have the following properties except as noted color The color accent of the object displayed as a hexadecimal value Change the color of the object by changing this value Only characters that are legal for hexadecimal values may be entered You can also change the color by clicking the button to open a color changing dialog box description Applicable to layers only A means of documenting the purpose of a layer expanded This attribute applies to objects such as tables that can be expanded to show columns indexes and triggers height The height of the object Depending upon the object this property may be read only or read write left The number of pixels from the object to the left side of the canvas locked Whether the object is locked The value for this attribute is either true or false manualSizing Whether the ob
139. the schemata as they are the Migration Wizard will create one database per schema or merge them into a single MySQL database Additional configure options include either remove the schema names the Migration Wizard will handle the possible name collisions that may appear along the way and an option to add the schema name to the database object names as a prefix E Handling Microsoft SQL Server and MySQL structural differences 11 4 Microsoft SQL Server migration Introduction The MySQL Workbench Migration Wizard is tested against the following Microsoft SQL Server versions 2000 2005 2008 and 2012 11 4 1 Preparations 11 4 2 11 4 2 1 11 4 2 2 FreeTDS To be able to migrate from Microsoft SQL Server ensure the following e The source SQL Server instance is running and accepts TCP connections e You know the IP and port of the source SQL server instance If you will be migrating using a Microsoft ODBC driver for SQL Server the default in Windows you will need to know the host and the name of the SQL Server instance e Make sure that the SQL Server is reachable from where you will be running MySQL Workbench More specifically check the firewall settings Make sure that the account you will use has proper privileges to the database that will be migrated Drivers General thoughts on the topic Windows Microsoft Windows XP or newer includes an ODBC driver for Microsoft SQL Server so there are no additi
140. the discover slaves option was specified at startup and new slaves are discovered the health report is refreshed gtid Display the master s list of executed GTIDs contents of the GTID variables GLOBAL GTID_EXECUTED GLOBAL GTID_PURGED and GLOBAL GTID_OWNED Thus the user can toggle through four screens by pressing the c key repeatedly The display will cycle through all four screens restarting after the fourth screen UUID Display universally unique identifiers UUIDs for all servers Log This option is visible only if the 10g 293 option is specified Show the contents of the log file This can be helpful to see at a later time when failover occurred and the actions or messages recorded at the time 291 mysqlfailover Automatic replication health monitoring and failover The user interface is designed to match the size of the terminal window in which it is run A refresh option is provided to permit users to resize their terminal windows or refresh the display at any time However the interface will automatically resize to the terminal window on each interval The interface will display the name of the utility the master s status including binary log file position and filters as well as the date and time of the next interval event The interface will also permit the user to scroll up or down through a list longer than what the terminal window permits When a long list is presented the scroll
141. this case there is little to gain by limiting the free library to free software only so we use the Lesser General Public License In other cases permission to use a particular library in non free programs enables a greater number of people to use a large body of free software For example permission to use the GNU C Library in non free programs enables many more people to use the whole GNU operating system as well as its variant the GNU Linux operating system Although the Lesser General Public License is Less protective of the users freedom it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library The precise terms and conditions for copying distribution and modification follow Pay close attention to the difference between a work based on the library and a work that uses the library The former contains code derived from the library whereas the latter must be combined with the library in order to run GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING DISTRIBUTION AND MODIFICATION 0 This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License also called this License Each licensee is addressed as you A library me
142. times to specify multiple tests skip tests lt prefix gt Exclude all tests that begin with prefix sort Execute tests sorted by suite name either ascending asc or descending desc Default is ascending asc Start port lt port gt The first port to use for spawned servers If you run the entire test suite you may see up to 12 new instances created The default is to use ports 3310 to 3321 start test lt prefix gt Start executing tests that begin with prefix stop test lt prefix gt Stop executing tests at the first test that begins with prefix suite lt name gt Execute the named test suite Use this option multiple times to specify multiple suites testdir lt path gt The path to the test directory utildir lt path gt The location of the utilities verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug To diagnose test execution problems use vvv to display the actual results of test cases and ignore result processing version Display version information and exit width lt number gt Specify the display width The default is 75 characters 337 Appendix NOTES The connection specifier must name a valid account for the server Any test named _template py is skipped This enables the developer to create a base class to import for a collection
143. to choose whether to ignore changes update the model with database changes or vice versa You can also apply an action to multiple selected rows Fetch Object Info Update Source Select Changes to Apply mydb tablet table2 table3 tablet T tables table5 Z tables 4 Ina wa lt I tebe The Ignore button causes the selected changes to be ignored No synchronization will take place for those changes In the following example no changes would take place 151 Forward Engineering Figure 8 42 Ignore Button Synchronize Model with Database Model and Database Differences Double click arrows in the list to choose whether to ignore changes update the model with database changes or vice versa You can also apply an action to multiple selected rows Fetch Object Info Select Changes to Apply The Update Source button causes the selected changes to be applied only to the live database In the following example table6 would be added to the live database and table would be dropped from the live database 152 Forward Engineering Figure 8 43 Update Source Button Synchronize Model with Database Connection Options ps Model and Database Differences Connect to Double click arrows in the list to choose whether to ignore changes update the model with database changes or Fetch Object Info Update Source Select Changes to Apply s8 e Si tablei 7 tablet T tablez table2 T tables table3 T tables t
144. to identify a table quickly something that becomes more important as the number of tables increases Changing the color of a table is also an easy way to identify a table in the Model Navigator panel This panel the uppermost panel on the left side of the page gives a bird s eye view of the entire EER canvas Save your changes to a MySQL Workbench Models file mwb extension by choosing Save from the File menu or by using the keyboard command Control S 8 8 2 Using the Default Schema When you first open MySQL Workbench a default schema mydb appears as the leftmost tab of the Physical Schemata section of MySQL Workbench You can begin designing a database by using this default schema Figure 8 48 The Default Schema Y Physical Schemata mydb Tables a Add Table To change the name of the default schema double click the schema tab This opens a schema editor window docked at the bottom of the application To undock or redock this window double click anywhere in the editor title bar To rename the schema use the field labeled Name After you have renamed the schema a lightning bolt icon appears right aligned in the Name field indicating that other changes are pending Click the Comments field and a dialog box opens asking if you wish to rename all schema occurrences Clicking Yes ensures that your changes are propagated throughout the application Add comments to the database and change the collation if you wish Close the
145. to search for and match Supported values CREATE ALTER DROP TRUNCATE RENAME GRANT REVOKE SELECT INSERT UPDATE DELETE COMMIT SHOW SET CALL PREPARE EXECUTE DEALLOCATE regexp basic regexp G 257 mysqlauditgrep Allows users to search the current or an archived audit log NOTES Indicates that pattern matching will be performed using a regular expression REGEXP from the Python re module By default the simple standard SQL L KE patterns are used for matching This affects how the value specified by the pattern option is interpreted Start date lt START_DATE gt Starting date time to retrieve log entries from the specified date time range If not specified or the value is 0 all entries from the start of the log are displayed Accepted formats yyyy mm ddThh mm ss or yyyy mm dd status lt STATUS gt Commaz separated list of status values or intervals to search for all audit log records with a matching status Status values are non negative integers corresponding to MySQL error codes Status intervals are closed i e include both endpoints and defined simply using a dash between its endpoints For Example 1051 1068 1075 1109 1146 The status option is available as of MySQL Utilities 1 2 4 1 3 3 users lt USERSs u lt USERS gt Commaz separated list of user names to search for their associated log entries For example dan jon john paul philip stefan verbose v Speci
146. to step you through applying your changes This gives you a chance to review the SQL that will be applied to the live server to make the requested changes If this option is deselected the changes will be applied to the server without the wizard being displayed and without giving you a chance to review the changes that will be made 6 4 5 The Model Tab This section provides configuration options that affect the Modeling functionality in MySQL Workbench 57 The Model Tab Figure 6 6 The Model Preferences Workbench Preferences General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance Column Defaults PK Column Name id table PK Column Type INT Column Name etable ecol Column Type YARCHAR 45 Foreign Key Relationship Defaults FKName fk_ stable _ dtable Column Name etable _ ecolumn ON UPDATE NO ACTION v ON DELETE NO ACTION Associative Table Name stable _has_ dtable for n m relationships Use the When Deleting Physical Model Figures in Diagram section to determine the behavior when deleting objects from the EER diagram canvas Choose Ask and whenever you delete an object you will be asked whether you wish to remove the object from an EER diagram only or also from the catalog The Keep Database Object in Catalog is the safest option You also have the option of deleting the object from both the EER diagram and the catalog Note E If you choose the Ask option
147. user types this command and presses ENTER the console will display a list of all of the options for the utility The console provides tab completion for all commands options for utilities and user defined variables Tab completion for commands allows users to specify the starting N characters of a command and 329 mysqluc Command line client for running MySQL Utilities press TAB to complete the command If there are more than one command that matches the prefix and the user presses TAB twice a list of all possible matches is displayed Tab completion for options is similar The user must first type a valid MySQL Utility command then types the first N characters of a command and presses TAB for example verb lt TAB gt In this case the console will complete the option For the cases where an option requires a value the console will complete the option name and append the character Tab completion for options works for both the full name and the alias if available If the user presses TAB twice the console will display a list of matching options Pressing TAB twice immediately after typing the name of a MySQL Utility will display a list of all options for that utility Tab completion for variables works the same as that for options In this case the user must first type the character then press TAB For example if a variable SERVER1 exists when the user types server SER lt TABs the console will complete the S
148. using a consistent convention where the most portable code uses lower case database and table names Or a temporary workaround is to delete the DROP SCHEMA IF EXISTS line from the generated query 148 Forward Engineering MySQL Workbench enables control over the direction of synchronization and which objects to synchronize in a completely flexible way You can choose to synchronize only certain tables enable synchronization to the live database only enable synchronization from the live database to the model only or a combination of directions In effect you have complete control as to whether the synchronization is unidirectional or bidirectional and which objects exactly are subject to synchronization This is all controlled in the Select Changes to Apply page of the synchronization wizard Figure 8 39 Model and Database Differences Synchronize Model with Database Connection Options P dais Model and Database Differences Connect to DBMS Select Schemata p P Double click arrows in the list to choose whether to ignore changes update the model with database changes or Fetch Object Info Update Select Changes to Apply table2 gt tabled INA tables In the preceding example the live database consists of tablel table2 and table3 In MySQL Workbench an additional table tab1e4 has been created along with a relationship between it and table3 Further table5 exists in the live database but not in the
149. utilities to read backtick quoted identifiers as a single argument For example to compare a database with the name weird db name with other weird db name the database pair must be specified using the following syntax in non Windows weird db name other weird db name EXAMPLES Use the following command to compare the emp1 and emp2 databases on the local server and run all tests even if earlier tests fail mysqldbcompare serverl root localhost empl emp2 run all tests serverl on localhost connected Checking databases empl on serverl and emp2 on server2 WARNING Objects in server2 emp2 but not in serverl emp1 TRIGGER trg PROCEDURE pil TABLE t1 VIEW v1 Defn Row Data Type Object Name DARRE Count Check FUNCTION 1 pass TABLE departments pass pass FAIL Data differences found among rows empl departments emp2 departments 1 4 1 4 KREKKKKKKKKK KKK KKK KKKKKKKEK alle row KREKKKKKKKKK KKK KKK KKKKKKEKEK dept_no d002 dept_name dunno ae Gleyeie lena g iP alivewaers Ow St Rows in empl departments not in emp2 departments 265 mysqldbcompare Compare Two Databases and Identify Differences KREKEKKKKKKKKKKKKKKKKKKKEEKEK ale row KEKEKKKKKKKKKKKKKKKKKKKKEKEK dept_no d008 dept_name Research 1 rows Rows in emp2 departments not in empl departments KKEKEKKKKKKKKKKKKKKKKKKKKEEKEK Alife row KREKEKKKKKKKKKKKKKKKKKKKKEEK dept_no d100 dept_name stupid 1 rovs TABLE
150. validation mechanisms port The port to use when connecting to the server The default if no port is supplied is 3306 which is the default port for the MySQL server as well unix_socket The socket to connect to instead of using the host and port parameters Providing the connection parameters as a string requires the string to have the format user passwd host port socket where some values are optional If a connection specification string is provided it is parsed using the options parse_connection function 14 2 3 Introduction to extending the MySQL Utilities Administration and maintenance on the MySQL server can at times be complicated Sometimes tasks require tedious or even repetitive operations that can be time consuming to type and re type For these reasons and more the MySQL Utilities were created to help both beginners and experienced database administrators perform common tasks What are the internals of the MySQL Utilities MySQL Utilities are designed as a collection of easy to use Python scripts that can be combined to provide more powerful features Internally the scripts use the mysql utilities module library to perform its various tasks Since a library of common functions is available it is easy for a database administrator to create scripts for common tasks These utilities are located in the scripts folder of the installation or source tree 239 Introduction to extending the MySQL Utilities
151. verbose V Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit e write command lt file_name gt w lt file_name gt Path name of file in which to write the command used to launch the new server instance EXAMPLES The following command demonstrates how to create a new instance of a running server set the root user password and enable binary logging mkdir source test123 mysqlserverclone server root pass localhost new data Users cbell source test123 new port 3310 root password pass mysqld log bin mysql bin Cloning the MySQL server running on localhost Creating new data directory Configuring new instance oO Cats ince Sicilemtso olsen Setting up empty database and mysql tables Starting new instance of the server Testing connection to new instance Success Setting the root password done 14 4 19 mysqlserverinfo Display Common Diagnostic Information from a Server This utility displays critical information about a server for use in diagnosing problems The information displayed includes the following e Server connection information e Server version number Data directory path name 326 mysqlserverinfo Display Common Diagnostic Information from a Server e Base directory pat
152. will need the ODBC driver installed that corresponds to the database you want to migrate from For example PostgreSQL can be migrated with the psqlodbc ODBC driver Microsoft SQL Server can be migrated using the native Microsoft SQL Server driver on Windows or with FreeTDS on Linux and Mac OS X The following diagram shows the general components involved in an ODBC connection Figure 11 1 MySQL Workbench migration installation diagram SS eee client side se Ean i aN ODBC Driver lt i Manager Other Pg eu Bt come Ss _ MySQL Ss oo workbench E m MySQL B When specifying the source RDBMS you can either use a data source configured externally or provide the individual connection parameters to MySQL Workbench If you already have an ODBC Data Source configured in your system then you can use that in MySQL Workbench 11 1 1 ODBC Libraries Linux Note R This section may be skipped when using a MYSQL Workbench binary that is provided by Oracle An ODBC Driver Manager library must be present Both Windows and Mac OS X provides one i ODBC MySQL Workbench binaries provided by Oracle already include iODBC and no additional action is required If you compile it yourself you must install iODBC or unixODBC iODBC is recommended You can use the iODBC library provided by your distribution pyodbc is the Python module used by MySQL Workbench to interface with ODBC and may be used to migrate ODBC compliant
153. with the same privileges as the original user The new users can be created on the original server or a different server To list users for a server specify the 1 ist 333 option This prints a list of the users on the source no destination is needed To control how to display list output use one of the following values with the format 833 option e grid default Display output in grid or table format like that of the mysql monitor e CSV Display output in comma separated values format tab Display output in tab separated format vertical Display output in single column format like that of the G command for the mysql monitor OPTIONS mysqluserclone accepts the following command line options e help 332 mysqluserclone Clone Existing User to Create New User NOTES Display a help message and exit destination lt destination gt Connection information for the destination server in the format lt users lt passwd gt lt host gt lt port gt lt socket gt or lt login path gt lt port gt lt socket gt dump d Display the GRANT statements to create the account rather than executing them In this case the utility does not connect to the destination server and no dest ination 333 option is needed format lt list_format gt f lt list_format gt Specify the user display format Permitted format values are grid csv tab and vertical The default is grid This option
154. your option any later version This library is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU Lesser General Public License for more details You should have received a copy of the GNU Lesser General Public License along with this library if not write to the Free Software Foundation Inc 51 Franklin Street Fifth Floor Boston MA O2110 1300 USA Also add information on how to contact you by electronic and paper mail You should also get your employer if you work as a programmer or your SCHOO awa taraniyy qutOss sil GinmcmaG OyaediciitmGns cilrcagem cual ats nase tll mm load cura ys E necessary Here is a sample alter the names Yoyodyne Inc hereby disclaims all copyright interest in the 356 HtmlRenderer System Drawing Html library Frob a library for tweaking knobs written by James Random Hacker lt signature of Ty Coon gt 1 April 1990 Ty Coon President of Vice above Mey Gull qeloereey iS jee alte A 13 HtmlRenderer System Drawing Html The following software may be included in this product HtmlRenderer System Drawing Htm1 Copyright c 2009 Jos Manuel Men ndez Poo All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met Redistributions of so
155. 0 c008 325 14 4 19 mysqlserverinfo Display Common Diagnostic Information from a Server 326 14 4 20 mysqluc Command line client for running MySQL Utilities 0 eee 329 14 4 21 mysqluserclone Clone Existing User to Create New User eeeeeeee sees 332 14 5 ParsersS 222 snsivecewecevien ih sneeeeat e E a a E AUE ERAUS DRN OFEA 334 14 5 1 mysql utilities parser Parse MySQL Log Files ccceeeeeeeeeeeeeeeeeeeeaeeaeeeeeeeeeees 334 14 0 Related tols oree aieea niee Eak EE RENEE eKA E E CENIE REEE EERE O AREETA EI ORR EEN EINE ENTENEN 336 14 6 1 mut MySQL Utilities Testing nneseeeeeeeenneseeserenrnesnsessrerrrerrsessnernrernessnernrnrnent 336 TA APPEND spat ceni cece oeer EEEE EEN REEERE N EO E EO E NEE tances 338 14 7 Ac MySQL Utilities FAQ nosier nae ESO TERA 338 14 7 2 MySQL Utilities copy_server py sample cccecececeeeeeeeeeee cess aeaaeeeeeeeeeeeeaeaaaaeeeeeeees 340 This chapter describes the MySQL Utilities for MySQL Workbench a set of Python tools for working with MySQL Server 14 1 Preface 14 1 1 Preface MySQL Utilities is both a set of command line utilities as well as a Python library for making the common tasks easy to accomplish The library is written entirely in Python meaning that it is not necessary to have any other tools or libraries installed to make it work It is currently designed to work with Python v2 6 or later and there is no support
156. 00 8 6 1 The Vertical Toolbar ieee cece cece eeee cena eter ee aa eee AR 100 8 7 Working with Models sisicsieis sietensnnweceentieeresennweed R E EEEE AA A NEER 104 8 7 1 Creating Table Sn iranian a EE E T RR 104 8 7 2 Creating Foreign Key Relationships 0 cccccececeeeeeeeeeeeeeeaeaaeeeeeeeeeeeaeaaeaeenees 115 8 7 3 Creating VIOWS afurisimi serie n eia EE EAEE 119 8 7 4 Creating Routines and Routine Groups essssssssssssessssrrrirerssssrsrnrrrnssssrsrrrrrnene 121 8 7 5 Greating LayelS errr E uivineesnevteststudvieersevedstcaaeies 124 8 7 6 Creating NOTES sruinriuon assia aiaa aE AAA sea EAA aa a aiaa a 125 8 7 7 Creating Text Objects eee ec eee cece cena ea eeeeee sees ee aeaa eee eeeeeeeeaeaaaaeaeeeeeeeeaeaaaaees 126 8 7 8 Creating MAGGS ss szecdivseveeeseuzoeesestieeesvs ex odeaanubuesess eztv bbe NNO E T EAE a 127 8 7 9 Reverse Engineering ccceceeeeeeeeeeeeeeeeeeeeeeeeeeaee ee ENARE RENAA NAAA ERATARA SANEA 128 8 7 10 Forward Enginesting cscce cesscteeecsstieevess cevedeet cus eens bebereantieeeens AAE ANE AA RREKOA 137 8 8 Modeling TUNAS ora E A sagpecasseeeseentaseeeneaaees 156 8 8 1 Importing a Data Definition SQL Script sssssssssesssserrsrsrerssssrrrrrrsrssrenrrrnrrssns 156 8 8 2 Using the Default Schema ccccceceeeeeeeeeeeeeeeeeaeeaeeeeeeeeeeeeaeaaeaneeeeeeeeeaeaaeaees 158 8 8 3 Basie Modeling sersrerissint einat Eana ADS KATETE REAREA AOE ERREA RAAUA EENES REKN
157. 1 Creating Tables 8 7 1 1 Adding Tables to the Physical Schemata Double clicking the Add table icon in the Physical Schemata section of the MySQL Model page adds a table with the default name of table1 If a table with this name already exists the new table is named table2 Adding a new table automatically opens the table editor docked at the bottom of the application For information about using the table editor see Section 8 7 1 3 The MySQL Table Editor Right clicking a table opens a pop up menu with the following items e Cut table_name Copy table_name e Edit Table e Edit in New Window Copy SQL to Clipboard e Copy Insert to Clipboard Copies INSERT statements based on the model s inserts Nothing is copied to the clipboard if the table has no inserts defined Copy Insert Template to Clipboard Copies a generic INSERT statement that is based on the model e Delete table_name If the table editor is not open the Edit Table item opens it If it is already open the selected table replaces the previous one Edit in New Window opens a new table editor tab The cut and copy items are useful for copying tables between different schemata Warning O Use the Delete t able_name item to remove a table from the database There will be no confirmation dialog box Any tables added to the Physical Schemata section also show up in the Catalog palette on the right side of the application They may be add
158. 1 General installation requirements ccceeeeeee cece ee eeeeeeeeeeeeeeeaaeaeeeeeeeeeeeaaaaeeneeeeeeees 200 TAs ODBC Librae Sorenson EE E AT E E 200 T1122 ODBC Divers ssia soinnin ananena aa aTa AKE EO AE ENA EA a AEAEE hie 201 11 2 Migration OVervie Wss sonnerie inaina a Ei a Eaa 201 11 2 1 A visual guide to performing a database migration ccccceeeeeeeeeeeeeeeeeeee aes 202 11 2 2 Migrating from supported databases 0 cccceceeeceeeeeteeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaaes 212 11 2 3 Migrating from unsupported generic databases ccceeeeeeeeeeeeeeeeeeeeeeeaaes 213 3 Conceptual DBMS equivalent cccceccceeeeeeeeeeeee ee aeaaeeeeeeeeeeeeaeaaeeneeeeeeeeeaeaaeaneneeeees 213 11 4 Microsoft SQL Server Migration 0 cccceeeeeceeeeeeeeeee tees ae aa eeeeeeeeeeeeaeaaeaeeeeeeeeeaeaaaaeeees 215 thd Preparan eena T S 215 11 422 DAVOS seriea ioina Ae eea EOE AS KAEA AEREA E ERAR ESAE 215 114 3 Gonnection Setup ereere aaraa oa A E EAA 216 11 4 4 Microsoft SQL Server Type Mapping sssssessssesssrssssssssrrrrrrerssssrrrnrrrresesnerrnne 216 115 PostgreSQL migration siisii a E a EE EE Ea 218 1129 1 Preparations cic sereaassccesebeiedealentieea beet viavea teat benddeabieienapeyodabbacnsbecodialate 218 WA 22 DIVOS orir ce cteaincia ia sedis each seas a eters cn ae ae ee daca Pane eee eee 220 115 3 Connection Setup sisestus ianiai a niii aA E a A aA aeS 220 11 5 4 PostgreSQL Type Mapping
159. 13 gt special_features SET Trailers Comm last_update TIMESTAMP gt gt If the placement of a connection s caption is not suitable you can change its position by dragging it to a different location If you have set a secondary caption its position can also be changed For more information about secondary captions see Section 8 7 2 3 Connection Properties Where the notation style permits Classic for example the cardinality indicators can also be repositioned The relationship notation style in Figure 8 16 The Relationship Connector is the default crow s foot You can change this if you are using a commercial version of MySQL Workbench For more information see Section 8 5 1 5 4 The Relationship Notation Submenu You can select multiple connections by holding down the Control key as you click a connection This can be useful for highlighting specific relationships on an EER diagram 8 7 2 2 The Relationship Editor Double clicking a relationship on the EER diagram canvas opens the relationship editor This has two tabs Relationship and Foreign Key The Relationship Tab In the Relationship tab you can set the caption of a relationship using the Caption field This name displays on the canvas and is also the name used for the constraint itself The default value for this name is k_source_table_destination_table Use the Model menu Menu Options menu item to set a project specif
160. 2 Creating a Foreign Key Select the table tool again and place another table on the canvas Name this table invoice_item Next click the 1 n Non Identifying Relationship tool First click the invoice_item table notice that a red border indicates that this table is selected Next click the invoice table This creates a foreign key in the invoice_item table the table on the many side of the relationship This relationship between the two tables is shown graphically in crow s foot notation 159 Documenting the sakila Database Revert to the default mouse pointer by clicking the arrow at the top of the vertical toolbar Click on the invoice_item table and select the Foreign keys tab Click the Foreign key Name field The referenced table should show in the Referenced Table column and the appropriate column in the Referenced Column column To delete the relationship between two tables click the line joining the tables and then press Control Delete Experiment with the other tools on the vertical toolbar Delete a relationship by selecting the eraser tool and clicking the line joining two tables Create a view add a text object or add a layer Save your changes to a MySQL Workbench Models file mwb extension by choosing Save from the File menu or by using the keyboard command Control S 8 8 4 Documenting the sakila Database This chapter highlights the capabilities of MySQL Workbench as a documentation tool using the
161. 2 168 0 6 using the valid IP address for ubuntu net you must have the ability to do a reverse name lookup to compare the IP 192 168 0 6 and the hostname ubuntu net to determine if they are the same machine The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf 323 mysql rplshow Show Slaves for Master Server EXAMPLES To show the slaves for a master running on port 3311 on the local host use the following command mysqlrplshow master root localhost 3311 discover slaves login root master on localhost connected Finding slaves for master localhost 3311 Replication Topology Graph localhost 3311 MASTER localhost s3310 ELAVIL localhost 3312 SLAVIL As shown in the example you must provide valid login information for the master To show additional information about the IO thread status to confirm if the slaves are really connected to the master use the option verbose 323 mysqlrplshow master root localhost 3311 discover slaves login root verbose master on localhost connected Finding slaves for master localhost 3311 Replication Topology Graph localhost 3311 MASTER gt localhost S310 TIO wes S
162. 306 3333 Server lt server gt Connection information for a server in the format lt users lt passwd gt lt host gt lt port gt lt socket gt or lt ogin path gt lt port gt lt socket gt Use this option multiple times to see information for multiple servers show defaults d Display default settings for mysqid from the local configuration file It uses my_print_defaults to obtain the options show servers Display information about servers running on the local host The utility examines the host process list to determine which servers are running Start S Start the server in read only mode if it is offline With this option you must also give the basedir 827 and datadir 328 options Start timeout Number of seconds to wait for the server to be online when started in read only mode using the start 328 option The default value is 10 seconds The start timeout option is available as of MySQL Utilities 1 2 4 1 3 3 verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug version Display version information and exit For the format 328 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 328 specifies the grid format An error
163. 3529 Users and Privileges localhost 55277 SHOW PROCESSLIST localhost 55278 SECURITY DATA EXPORT RESTORE 3 Data Export and Restore Kill Query Kill Connec WB Admin Opened 10 7 1 The Startup Tab The Startup tab has several purposes e To display database server status e To start up and shut down the server e To display the Startup Message log e To select whether the server starts when the system starts 186 The Configuration Tab Figure 10 4 Administrator Startup Tab la st Wotbec Admin mysald 127 0 0 1 x File Edit View Database Plugins Scripting Community Help Task and Object Browser Startup Shutdown MANAGEMENT Database Server Status Serer Status The database server is started and ready for dient connections To shut the Server down use the Stop Server button dadais Status and System Variables Server Logs If you stop the server you and your applications will not be able to use the Database and all current connections will be closed CONFIGURATION amp Options File 2011 03 01 14 29 41 Workbench will use cmd shell commands to start stop this instance SECURITY 2011 03 01 14 29 49 Status check of service MySQL returned running Users and Privileges 2011 03 01 14 32 47 Status check of service MySQL returned running DATA EXPORT RESTORE 3 Data Export and Restore WB Admin Opened 10 7 2 The Configuration Tab The Configuration ta
164. 50 The sakila Database EER Diagram The Page Setup menu item enables you to set the paper size orientation and margins for printing purposes 86 Modeling Menus The printing options are enabled only if the EER Diagrams tab is selected You have the choice of printing your model directly to your printer printing it as a PDF file or creating a PostScript file For more information see Section 8 9 Printing Note E The printing options are available only in commercial versions of MySQL Workbench Use the Document Properties menu item to set the following properties of your project Name The model name default is MySQL Model e Version The project version number Author The project author Project The project name Created Not editable determined by the MWB file attributes Last Changed Not editable determined by the MWB file attributes Description A description of your project 8 5 1 2 The Edit Menu Use the Edit menu to make changes to objects The text description for several of the menu items changes to reflect the name of the currently selected object This menu has items for cutting copying and pasting These actions can also be performed using the Control X Control C and Control V key combinations Undo a deletion using the Undo Delete object_name item The Control Z key combination can also be used to undo an operation It is also possible to carry out a Redo operation using eit
165. 6 339 Can the frm reader read any frm file 14 7 1 3 7 339 My frm files are tucked away in a restricted folder How do get access to them to run the frm reader without copying or modifying file privileges 338 MySQL Utilities FAQ e 14 7 1 3 8 339 Will the default mode display a 100 accurate CREATE statement Questions and Answers 14 7 1 1 1 Are these utilities present in the community version of MySQL They are included in the community version of MySQL Workbench and available from Launchpad 14 7 1 2 1 Can the utilities be used with MyISAM or CSV Yes There are no storage engine specific limitations in using the utilities There are some features written specifically for InnoDB so those may not apply but in general no utility is storage engine specific For example the mysqidiskusage utility shows exact sizes for MyISAM and InnoDB files but uses estimated sizes for any other storage engine based on number of rows and row size 14 7 1 3 1 Can the frm reader read a frm file without the associated data files Yes The frm reader was designed to read the contents of an frm file without requiring the data files 14 7 1 3 2 Will the frm reader modify my original frm file No it does not modify the original frm file in either default or diagnostic mode 14 7 1 3 3 What is diagnostic mode and why doesn t it produce the same output as the default mode The diagnostic mode does not use a spawned server to read t
166. 9 a int 11 NOT NULL AUTO INCREMENT bn char 30 DEFAULT NULL PRIMARY KEY a ENGINE InnoDB AUTO_INCREMENT 4 DEFAULT CHARSET latinl TABLE util_test t4 CREATE TABLE E4 Te Ine 11 NOL NULI 2A Ine 1I NOL NULE REY MESE ES Ce CONSTRAINT ref t3 FOREIGN KEY c REFERENCES t3 a ENGINE InnoDB DEFAULT CHARSET latinl WANES wheal seas wil all done io Similarly to export the data of the database util_test producing bulk insert statements use this command mysqldbexport server root pass localhost export DATA bulk insert util_test Source on localhost connected USE util_test Exporting data from util_test Data for table util_test tl INSERT INTO util_test t1 VALUES 01 Test Basic database example 02 Test Basic database example 03 Test Basic database example 04 Test Basic database example 05 Test Basic database example 06 Test Basic database example 07 Test Basic database example Date for table util test t2 NSERT INTO util_test t2 VALUES 11 Test Basic database example 12 Test Basic database example 13 Test Basic database example Date for table util test te NSERT INTO util_test t3 VALUES 1 14 test fkeys 2 SS test Ekeys tiy 7 test fkeys Data for table util_test t4 NSERT INTO util_test t4 VALUES 3 2 8 done Ww D If the database to
167. 999 A 16 Libintl License The following software may be included in this product libintl Copyright C 1994 X Consortium Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software 358 Libxml2 License THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE Except as contained in this notice the name of the X Consortium shall not be used in advertising or otherwise to promote the sale use or other dealings in this Software without prior written authorization from the X Consortium FSF changes to this file are in the public domain Copyright 1996 2007 Fr
168. AROWAR 30 Employee Contact INT Employee Logain vaRcHaR 512 Di emoicree Maged INT Latini Genera HumanResources L Employee Tile VARCHAR 100 Humanecources Employee BirthOste DATETIME Latin General Muman esources L Employee Mentalstetus CHAR Z Latint General HumanResaurces Employee Gender CHARL2 HamanResources Employee Hireoate DATETIME i GSoGg8 Source Figs N SoueD Source Colston yw CollstionLatnt_General Cs ASmigratedta utgi Collation Latint_General_CS_ASmigratedta Default value is getdatel so type was change Latind General MumanResources Latin General HumanResources gt Department tatin General Colistion Latint_General_C amp _tSmigratedto utft_g SS35S5S5SSS50S5SSS5SS558 OBJECT MIGRATION Source Objects Y Migration tatint General_ CotationLatnt General CS ASmigrated to utfB_gy Cotation Latini _General_CS_ASmigrated to utf _g CollstionLatnt General _CS_ASmigratedto utg Collation Latia General CS _ASmigrated ta utfB_g Target Creation Options Creste Schemata Create Target Results ri Source coluren type BIT was migrated to TINYINTI GoEoqocqgcq0GRea DATA MIGRATION Dats Transter Setup Bulk Data Transfer REPORT Migration Report z Lock edited SQL Comment cut tide Code and Messages Target Creation Options The schema may be created by either adding it to the target RDBMS creating an SQL script file or both 208 A visual guide t
169. AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE A 9 Dojo Toolkit v1 7 0b1 License The following software may be included in this product DEJO Toolkit waia Ye Gei Copyright c 2005 2006 The Dojo Foundation All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are MEET Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of the Dojo Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
170. B tablespace usage This includes information about the shared InnoDB tablespace as well as idb files for InnoDB tables with their own tablespace logs l Display general query log error log and slow query log usage no headers h Do not display column headers This option applies only for csv and tab output quiet q Suppress informational messages relaylog r Display relay log usage server lt server gt Connection information for the server in the format lt user gt lt passwad gt lt host gt lt port lt socket or lt ogin path gt lt port gt lt socket gt verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug version Display version information and exit 288 mysqldiskusage Show Database Disk Usage NOTES For the format 288 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 288 specifies the grid format An error occurs if a prefix matches more than one valid value You must provide connection parameters user host password and so forth for an account that has the appropriate privileges for all objects accessed during the operation The path to the MySQL client tools should be included in the PATH environment variable in or
171. BMS and reverse engineered This is an automated and informational step that reports related errors and or general log information View the logs and then press Next to continue 205 A visual guide to performing a database migration Figure 11 7 MySQL Workbench migration Reverse Engineer Source Migration Task List Reverse Engineer Source OVERVIEW overview Selected schema metadata will now be fetched from the source RDBMS and reverse engineered so that its structure can be determined SOURCE amp TARGET Source Selection Target Selection Fetch Schemata List Y Schemata Selection OBJECT MIGRATION Source Objects Migration Manual Editing Target Creation Options Create Schemata Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report Y Connect to source DBMS Reverse engineer selected schemata Y Post processing of reverse engineered schemata Finished performing tasks Click Next gt to continue Message Log Reverse engineering 2 routines from HumanResources Reverse engineering procedure HumanResources uspUpdateEmployeePersonalinfo Reverse engineering procedure HumanResources uspUpdateEmployeeHirelnfo Finished reverse engineering of procedures for the HumanResources schema Finished reverse engineering of functions for the HumanResources schema Reverse engineering of routines for schema HumanResources completed Reverse engineering 0 triggers
172. CHAR Depending on its length MySQL Server 5 5 MEDIUMTEXT and above can have VARCHAR columns with a LONGTEXT length up to 65535 characters Anything larger is migrated to one of the TEXT blob types NATIONAL VARCHAR Depending on its length MySQL Server 5 5 CHARACTER MEDIUMTEXT and above can have VARCHAR columns with a VARYING LONGTEXT length up to 65535 characters Anything larger is migrated to one of the TEXT blob types In MySQL character set of strings depend on the column character set instead of the datatype DATE DATE TIME TIME TIMESTAMP DATETIME INTERVAL TIME BYTEA LONGBLOB TEXT LONGTEXT CIDR VARCHAR 43 INET VARCHAR 43 MACADDR VARCHAR 17 UUID VARCHAR 36 XML LONGTEXT JSON LONGTEXT TSVECTOR LONGTEXT TSQUERY LONGTEXT ARRAY LONGTEXT POINT VARCHAR LINE VARCHAR LSEG VARCHAR BOX VARCHAR PATH VARCHAR POLYGON VARCHAR 221 MySQL migration Source Type MySQL Type Comment CIRCLE VARCHAR TXID_SNAPSHOT VARCHAR 11 6 MySQL migration Introduction Notes about copying MySQL and what you can do with it 11 7 Using the MySQL Workbench Migration Wizard Introduction and general usage notes 11 7 1 Connecting to the databases A connection is made to the source and target database servers Source Connection Setup The Source Connection offers the MySQL Microsoft SQL Server and Generic RDBMS database system options This selection determines the available Param
173. Checking InnoDB compatibility pass Checking storage engines compatibility pass Checking lower_case_table_names settings pass Checking slave delay seconds behind master pass one As shown in the example you must provide valid login information for both the master and the slave To perform the same command but also display the contents of the master information file on the slave and the values of SHOW SLAVE STATUS as well as additional details use this command mysqlrplcheck master root host1 3310 slave root host2 3311 show slave status vy master on hostl connected slave on host2 connected Test Description Status Checking for binary logging on master pass Are there binlog exceptions pass Replication user exists pass Checking server_id values pass master id 10 slave id 11 Is slave connected to master pass Check master information file pass Master information file Master_Log_File clone bin 000001 Read_Master_Log_Pos 482 Master_Host hostl Master_User rpl Master_Password XXXX Master Port 3310 Connect_Retry 60 Master_SSL_Allowed 0 Master_SSL_CA_File Master_SSL_CA_Path Master_5S5L_ Cert Master_SSL_Cipher Master_SSL_Key Master_SSL_Verify_Server_Cert 0 Checking InnoDB compatibility pass Checking storage engines compatibility pass Checking lower_case_table_names settings pass Master lower_case_table_names 2 Slave lower_case_tab
174. Connect to Target Database Perform Checks in Target Create Schemata and Objects OBJECT MIGRATION Y Source Objects Migration Manual Editing Target Creation Options Finished performing tasks Click Next gt to continue Message Log Starting Connect to Target Database DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Connect to Target Database done Perform Checks in Target Validating for existing schemas on target MySQL Server Perform Checks in Target done Create Schemata and Objects Migration Report Create Target Results The generated objects are listed here along with the error messages if any exist The migration code may also be viewed and edited here To make changes select an object edit the query code and press Apply Repeat this process for each object that will be edited And then press Recreate Objects to save the results 209 A visual guide to performing a database migration Note E The Recreate Objects operation is required to save any changes here It will then execute the previous migration step Create Schemata with the modified code and then continue the migration process This also means that the previously saved schema will be dropped Figure 11 14 MySQL Workbench migration Create Target Results N Migration Xx File Edit View Database Plugins Scripting Help Migration Task List Create Target Results Q Overview Scripts to cre
175. Data Import Restore INSTANCE B Startup Shutdown A Server Logs amp Options File SCHEMAS Q Filter objects gt sakila gt test Object Info Session Object info Session Schema sakila Schema sakila You can select schemas and or tables to perform client side searches for user specified strings and patterns To access this new search feature right click select a schema or a table in the left sidebar and select Search Table Daita This screenshot demonstrates the search feature along with an example search Multiple tables were selected and searched in this example Context Sensitive help for the SQL Editor Figure 2 4 Table search functionality 00090 MySQL Workbench My Local example com DB sakila aa e alea air Tn Management Schemas SCHEMAS wt 4 Enter text to search in tables selected in the schema tree Q Filter objects A text search will be done on the selected tables using SELECT Note that this can be very slow since it will search all columns from all tables y amp sakila v Tables Search for Text jennifer StartSearch aa Select Rows Limit 1000 b address F Max matches per table 100 Max total matches 100000 p category Copy to Clipboard gt gt E city Send to SQL Editor gt as of all types 2 Alter 15 Tables Table Key Column Dat
176. Default Schema The schema that will be used as default schem You can now click Next 5 The connection will now be tested You should see that the connection was successful If not click Back and check that you have entered the information required 30 Administering a MySQL Server Figure 5 4 Getting Started Tutorial Connection Test Create New Server Instance Profile Testing the Database Connection Database Connection Test DB Connection The database connection information is being tested This might take a Few moments depending on your network connection amp Open Database Connection amp Get Server Version 5 5 16 Get Server OS Windows Database connection tested successfully If the connection test was successful click Next 6 Optionally you may configure a method for remote management if a Remote Host was specified Setting these options enables MySQL Workbench to determine the location of configuration files and the correct start and stop commands to use for the server SSH login based management and Native Windows remote management types are available The Operating System and MySQL Installation Type are configured for the SSH login variant 31 Administering a MySQL Server Figure 5 5 Getting Started Tutorial Management and OS Create New Server Instance Profile ost Machine aih Specify remote management type and target operation system Connection 3 Connectio
177. E a peur LICanse sierciirpresiineeinu in kE rens E eeek ESAE AREE ENNEA REENE KE EE TAREA ENEE ES A 8 DockPanel S it LICS E aisivicscedesdsndiniactadvcvaneeiestvacaaadvad sabbtdaniadadeadsnneaiiaaibelvedadnadeanesuctadaiieas A 9 Dojo Toolkit v1 7 0b1 License eee cece cece eee e cece eee te ee ee ee ee ee aa aa ee eeeeeeeeeeaaaaeneeeeseeeeaeaaeaees A 10 GLib License for MySQL Workbench 0 ccceceeeeeeeee cece eee eeeeeeeeeeeeaeaaeeneeeeeeeeeaeaaeaneneeeess PVA IZ ICS INS E Gass canna ahanta canis EEN A E E EE AEN E E E TE A 12 GNU Lesser General Public License Version 2 1 February 1999 ccccceecceceseeeeeeeeeeeees A 13 HtmlRenderer System Drawing Html cceceeeeeeeeeeeeeee cece ee aaeaeeeeeeeeeeeeaaeaeeeeeeeeeeeaaaaeeeees AVA ODBC LICENSE ronnen sale cchacbissbacanaadesnbavedai olan todas vats tadebiaaeassadiiaad doin eate adage AAS LIBDIGONV LIGENSE siciavaiecavanseivctersvenstavdvevebavaccuavenduaiehedaednesasieveds A ataa EA ELNren aa ea braiei a ANG MADINGMIC CISC a n deaneveves A 17 LIDXMI2Z LICENSE oo cece cc ce ccce cece cece cece rieien ndre a nanena Nea E Uar EEEn Narie ANB TEIDZIP LICENSE 62522 secs ebsz sakes see ceaileceediel dis cectebee cic dt ca acecdiag dinceg is bareedennncbabecredac din deatvacrents A 19 Lua liblua LICENSE assesses cece ee eee teeter ee den ionien i ee diaaa a eaa aiea ii e deabia A20 P ramMikoLICenNsSe rrenari a E E E A ERN All PORE O N E a E a E AEA Retl
178. E USE R OTHER DEALINGS IN THE SOFTWARE COO Ew ixman v0 17 4 and lower he following is the standard copyright y most contributors and is currently the agreed upon canonical cense though a modification is currently iscussion Copyright holders of new code his license statement where possible and naneco ehi SESE Gi e A Omar aG under should use append their 362 PyCrypto License Copyright 1987 1988 1989 1998 The Open Group Copyright 1987 1988 1989 Digital Equipment Corporation Copyright 1999 2004 2008 Keith Packard Caor teine OOO SwE oere Copyright 2000 Keith Packard member of The XFree86 Project Inc Copyright 2004 2005 2007 2008 Red Hat Inc Copyright 2004 Nicholas Miell Copyright 2005 Lars Knoll amp Zack Rusin Trolitech Copyright 2005 Trolltech AS Copyright 2007 Luca Barbato Copyright 2008 Aaron Plattner NVIDIA Corporation Copyright 2008 Rodrigo Kumpera Copyright 2008 AndrA TupinambA Copyright 2008 Mozilla Corporation Copyright 2008 Frederic Plourde Copyright 2009 Sun Microsystems Inc Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnis
179. EMATA In the preceding snippet the section start and end are indicated by the SCHEMATA and SCHEMATA markers When MySQL Workbench processes the template it notes the section and iterates it until the variable data for SCHEMA_NAME in the corresponding data dictionary is exhausted For example if the model being processed contains two schemata the output for the section might resemble the following Schema Airlines Schema Airports 167 Customizing DBDoc Model Reporting Templates Data Dictionaries It is important to understand the relationship between sections and data dictionaries in more detail In a data dictionary the key for a variable is the variable name a marker The variable value is the variable s data The entry for a section in a data dictionary is different For a section entry in a data dictionary the key is the section name the marker However the value associated with the key is a list of data dictionaries In MySQL Workbench each section is usually associated with a data dictionary You can think of a section as activating its associated dictionary or dictionaries When a template is processed data dictionaries are loaded in a hierarchical pattern forming a tree of data dictionaries This is illustrated by the following table Table 8 1 Data Dictionaries Tree Data Dictionary Loads Data Dictionary MAIN SCHEMATA SCHEMATA TABLES COLUMNS Detailed is true
180. ER 159 8 8 4 Documenting the sakila Database uesseesssseerrressrrnneenrrresnnnneennteusnnnneennens 160 8 9 PANINO eaei ea RASORE N EE 162 89 1 Printing Options isit ienaa e E a ai 162 8 10 MySQL Workbench Schema Validation Plugins Commercial Version 0000 162 8 10 1 General Validation 200 0 cece cece cece cence eee ee cree a a TEA aaa 162 8 10 2 MySQL Specific Validation cccccccecceeeeeeeeeeeeaeeaeeeeeeeeeeeeaeaaeeteeseeeeeeaeaaeeaes 163 8 11 The DBDoc Model Reporting Dialog Window Commercial Version eeeeeees 163 8 12 Customizing DBDoc Model Reporting Templates cccccceeeeeeeeeeeeeeeaeeeeeeeeeeeeeeeaea 166 8 12 1 Supported Template Markers ccccccceceeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaaaaeeeeeeeeeeeaaa 169 8 12 2 Creating a Custom Template ccccccceeeeeeeeee ee ae ae eeeeeeeeeeeeaeaaeeneeeeeeeeeaeaaeaees 173 9 Generating code OVErVICW 0 ee ccce cece ceee cece cena ee eeeeee eect cece eaaa ea tn sees ee aeaaaadaeeeeeeseaeaaaaaeeeeeeeeeaeaaaaaes 177 9 1 Generating SQL QUeMES sissescascict ceesinsdvessdastedessnaodiaseisvedea a aE a aAA AAAA AA AAA ADEA 177 9 2 Generating PHP CODE sssiaeresie nia i a a a a E aE aias 177 10 Server AdMINISAtWON isisisi anione aa EAEE AE EEEE AAEE E 179 10 1 Server Administration caccetss teactenessacencdsgdenderiasedan naceaaeencectadsdavencevnaveteedgeeinasrnaveesdeibeines 179 10 2 New Server Instance ogis
181. ERVER data audit log SELECT FROM INFORMATION_SCHEMA PLUGINS mysqlauditgrep Allows users to search the current or an archived audit log 4 4 4 4 STATUS TIMESTAMP NAME SQLTEXT CONNECTION_ID 4 4 4 4 4 20t2 gt 09 27 Tis 33339 Query SHED sessronsantocommit OF 7 2012 09 27T13 33 39 Query SET session autocommit OFF 8 0 2027 09 2700 216i On Query Smi Qlgessilon cwreocommwie Omt 3 0 202 09 209m Zio 0 Query NishlCGsessronsaucoconm Gmr 1 4 4 4 4 To display the audit log entries of specific query types use the following command shell gt mysqlauditgrep query type show SET SERVER data audit log 4 4 4 4 STATUS TIMESTAMP NAME SOLTEXT CONNECT ION_ 4 4 4 4 4 0 AMDLZ 09 2 JIS S33 359 Query SET NAMES latinl COLLATE latinl_swedish_ci T 0 AWLZ 09
182. ERVER variable name For cases where there are multiple variables pressing TAB twice will display a list of all matches to the first N characters Pressing TAB twice after typing only the character will display a list of all variables Note the console does not require typing the mysql prefix for the utility For example if the user types disku lt TABs gt the console will complete the command with diskusage Executing utilities is accomplished by typing the complete command and pressing ENTER The user does not have to type python or provide the py file extension The console will add these if needed The user can also run commands using the option execute 331 The value for this option is a semi colon separated list of commands to execute These can be base commands or MySQL Utility commands The console will execute each command and display the output All commands to be run by the console must appear inside a quoted string and separated by semi colons Commands outside of the quoted string will be treated as arguments for the mysqluc utility itself and thus ignored for execution Note if there is an error in the console or related code the console will stop executing commands at the point of failure Commands may also be piped into the console using a mechanism like echo lt commands gt mysqluc The console also allows users to set user defined variables for commonly used values in options The synt
183. EY DepartmentID COMMENT Lookup table containing the departments within tt Output Messages DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report Migration Wizard was started Data Transfer Setup The next steps involve transferring data from the source RDBMS to the target MySQL database The setup screen includes the following options Data Copy e Online copy of table data to target RDBMS This default will copy the data to the target RDBMS e Create a batch file to copy the data at another time The data may also be dumped to a file that can be executed at a later time or be used as a backup Options Truncate target tables before copying data In case the target database already exists this will delete said data e Worker tasks The default value is 2 This is the number of tasks database connections used while copying the data e Enable debug output for table copy Shows debugging information 210 A visual guide to performing a database migration Figure 11 15 MySQL Workbench migration Data Transfer Setup Migration Task List Data Transfer Setup OVERVIEW Overview Select options for the copy of the migrated schema tables in the target MySQL server and dick Next gt to execute SOURCE amp TARGET Data Copy Source Selection Target Selection 7 Online copy of table data to target RDBMS Fetch Schemata List Y Schemata Selection Y Rever
184. E_CHECKS 0 SET OLD_FOREIGN_KE Y_CHECKS FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS 0 SET OLD_SQL_MODE SQL_MODE SQLMODE TRADITIONAL CREATE SCHEMA IF NOT EXISTS mydb DEFAULT CHARACTER SET latint COLLATE latint_swedish_ci USE mydb Table mydb tablet CREATE TABLE IF NOT EXISTS mydb tablet idtablel INT NOT NULL PRIMARY KEY idtable1 ENGINE InnoDB Table mydb table2 CREATE TABLE IF NOT EXISTS mydb table2 idtablel INT NOT NULL idtable2 INT NOT NULL idtable INT NOT NULL table1_idtable1 INT NULL PRIMARY KEY idtable2 idtable1 idtable3 INDEX fk_table2_table1 table1_idtablel ASC CONSTRAINT tk_table2_table1 FOREIGN KEY table1_idtable1 REFERENCES mydb table1 idtable1 ON DELETE NO ACTION Save to Other File Copy to Clipboard You may return to the previous page using the Back button The Finish button saves the script file and exits You can then use the saved script to create a database 8 7 10 1 2 Altering a Schema The menu item for altering a schema Forward Engineer SQL ALTER Script is used for updating a database that has been redesigned within MySQL Workbench Typically this option is used when the SQL script of a database has been imported into MySQL Workbench and changed and then you want to create a script that can be run against the database to alter it to
185. Engineer Source Before starting check the following preparation steps The Migration Wizard uses ODBC to connect to the source database You must have an ODBC driver for the source database installed and configured as Workbench does not bundle any such drivers For MySQL connections the native dient library is used OBJECT MIGRATION Source Objects Migration Manual Editing Target Creation Options Create Schemata Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report Ensure you can connect to both source and target RDBMS servers Make sure you have privileges to read schema information and data from the source database and create objects and inserting data in the target MySQL server The max_allowed_packet option in the target MySQL server must be enough to fit the largest field value to be copied from source especially BLOBs and large TEXT fields The wizard supports migrating from specific database systems but a generic RDBMS support is also provided The generic support is capable of migrating tables from many RDBMS that can be connected to using ODBC although certain type mappings may not be performed correctly A manual mapping step is provided for reviewing and fixing any migration problems that could occur 202 A visual guide to performing a database migration It describes the prerequisites and requirements that should be unders
186. FOREIGN_KEYS Detailed is true INDICES Detailed is true TABLES REL_LISTING INDICES_LISTING COLUMNS_LISTING TABLE_COMMENT_LISTING DDL_LISTING COLUMNS _LISTING COLUMNS Detailed is false REL_LISTING REL Detailed is false INDICES_ LISTING INDICES Detailed is false The root of the tree is the main dictionary Additional dictionaries are loaded from the root to form the dictionary tree in the main dictionary If a variable is not found in the main dictionary which can be thought of as associated with the default or main section no data is Note R If a template has no sections any variables used in the template are looked up generated in the output file for that marker Evaluation of variables The tree structure of the data dictionaries is important with respect to variable evaluation As variables are defined in data dictionaries their associated values have meaning only when that particular data dictionary is active and that means when the section associated with that data dictionary is active When a variable lookup occurs the system checks the data dictionary associated with the current section If the variable value can be found there the replacement is made However if the variable s value is not found in the current data dictionary the parent data dictionary is checked for the variable s value and so on up the tree until the main data dictionary or root is reached Suppose that we want to display t
187. GENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE A 12 GNU Lesser General Public License Version 2 1 February 1999 The following applies to all products licensed under the GNU Lesser General Public License Version 2 1 You may not use the identified files except in compliance with the GNU Lesser General Public License Version 2 1 the License You may obtain a copy of the License at http www gnu org licenses lgpl 2 1 html A copy of the license is also reproduced below Unless required by applicable law or agreed to in writing software distributed 349 GNU Lesser General Public License Version 2 1 February 1999 under the License is distributed on an AS IS BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied See the License for the specific language governing permissions and limitations under the License GNU LESSER GENERAL PUBLIC LICENSE Version 2 1 February 1999 Copyright C 1991 1999 Free Software Foundation Inc Gil Wigeuoilletbskiny Sieseeyere Iesiieelo Wiles Boston MA OIG SiGil USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed This is the first released version of the Lesser GPL It also counts as the successor of the GNU Library Public License version 2 hence the version number 2 1 Preamble The licenses for most softw
188. HE FONT SOFTWARE IS PROVIDED AS IS WARRANTY OF ANY KIND EXPRESS OR IMPLIED WITHOUT INCLUDING BUT NOT LIMITED TO ANY WAR TP ILI DS SS MOUS JAC RAREICULAR I gt Ole COMING IME VAIESINIE NO EVENT SHALL BITSTREAM O TRADEMARK OR OTHER RIGHT RANTIES OF MERCHANTABILITY URPOSE AND NONINFRINGEMENT IN R THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY INCLUDING ANY GENERAL SPECIAL INDIRECT INCIDENTAL 345 Boost Library License OR CONSEQUENTIAL DAMAGES WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE Except as contained in this notice the names of Gnome the Gnome Foundation and Bitstream Inc shall not be used in advertising or otherwise to promote the sale use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc respectively For further information contact fonts at gnome dot org A 4 Boost Library License The following software may be included in this product Boost C Libraries Use of any of this software is governed by the terms of the license below Boost Software License Version 1 0 August 17th 2003 Permission is hereby granted free of charge to any person or organization obtaining a copy of the software and accompanying documentation covered by this license the Sof
189. IDs perform best slave election and report best slave to use in the event a switchover or failover is required Best slave election is simply the first slave to meet the prerequisites GTIDs are supported in version 5 6 5 and higher This command requires the options master 313 and either slaves 313 or discover slaves login 312 failover This command is available to only those servers supporting GTIDs Conduct failover to the best slave The command will test each candidate slave listed for the prerequisites Once a candidate slave is elected it is made a slave of each of the other slaves thereby collecting any transactions executed on other slaves but not the candidate In this way the candidate becomes the most up to date slave This command requires the slaves 313 option The discover slaves login 312 option is not allowed because for failover the master is presumed to be offline or otherwise unreachable so there is no way to discover the slaves The master 313 option is ignored for this command gtid This command is available to only those servers supporting GTIDs It displays the contents of the GTID variables GLOBAL GTID_ EXECUTED GLOBAL GTID_PURGED and GLOBAL GTID_OWNED The command also displays universally unique identifiers UUIDs for all servers This command requires one of the following combinations master 313 and slaves 313 or master 313 and discover slaves login 312 he
190. IL2Z LO Owl 335342 2 None tester2 r 0 Ouakte ZO U2 AO iL0 aril eA Ss 22 2 None tester2 r 4 4 4 4 4 4 4 To display the audit log entries for a specific date time range use the following command shell gt mysqlauditgrep start date 2012 09 27T13 33 47 end date 2012 09 28 SERVER data audit log i i l l l l l l AMLASOS 2 TIS AVIAZ OS S AVIAZ OS 2 TS AVILAZ OS S 20172 OS 2 TIS 4 s a A CONNECTION_ID SOLTEXT 7 None 7 Wf COMMIT i None 8 None To display the audit log entries matching a specific SQL L KE pattern use the following command shell gt mysqlauditgrep pattern 4 4 ZO OOS 2a sales AVIA 09 2 TS ZOMAS OOS Zem AVIA O9 ZsseiL Al T Se ee EE E ak Pe SS oo AO PAGE SO eS NAME Query Query Query Query ERVER data audit log session session session session autocommit autocommit autocommit autocommit 4 CONNECTION_ID 4 I 8 2 Le 4 To display the audit log entries matching a specific REGEXP pattern use the following command shell gt mysqlauditgrep pattern 259 regexp S
191. INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE A 30 VSQLite License The following software may be included in this product VSQLite VSQLite virtuosic bytes SQLite3 C wrapper Copyright c 2006 Vinzenz Feenstra vinzenz feenstra virtuosic bytes com All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission HIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS ND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE RE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE TABLE FOR ANY DIRECT
192. IO thread status of each slave is also displayed Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug If you use vwv the output will contain the state of the IO and SQL threads for each slave e version Display version information and exit The login user must have the REPLICATE SLAVE and REPLICATE CLIENT privileges to successfully execute this utility Specifically the login user must have appropriate permissions to execute SHOW SLAVE STATUS SHOW MASTER STATUS and SHOW SLAVE HOSTS For the format 322 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 322 specifies the grid format An error occurs if a prefix matches more than one valid value Mixing IP and hostnames is not recommended The replication specific utilities will attempt to compare hostnames and IP addresses as aliases for checking slave connectivity to the master However if your installation does not support reverse name lookup the comparison could fail Without the ability to do a reverse name lookup the replication utilities could report a false negative that the slave is not connected to the master For example if you setup replication using MASTER_HOST ubuntu net on the slave and later connect to the slave with mysqlrplcheck and have the master specified as master 19
193. L Workbench download page for the latest packages The procedure for installing on Linux depends on which Linux distribution you are using Installing DEB packages On Ubuntu and other systems that use the Debian package scheme you can install MySQL Workbench using a command such as shell gt sudo dpkg i package deb package deb is the MySQL Workbench package name for example mysql workbench oss version_i386 deb where version is the MySQL Workbench version number Note R You may be warned that certain libraries are not available depending on what you already have installed Install the required libraries and then install the MySQL Workbench package again Installing RPM packages On Red Hat based systems and other systems that use the RPM package format MySQL Workbench can be installed by a command such as shell gt sudo rpm i package rpm package rpm is the MySQL Workbench package name for example mysql workbench oss version 1fc10 x86_64 rpm where version is the MySQL Workbench version number 4 3 5 Launching MySQL Workbench on Linux 4 3 6 After MySQL Workbench has been installed it can be launched by selecting Applications Programming MySQL Workbench from the main menu MySQL Workbench can also be launched from the command line on Linux Type the command shell gt usr bin mysql workbench help This will display the available command line options mysql workbench lt options gt lt model file gt
194. L Workbench from Linux x64 then you need a Linux x64 ODBC driver for your RDBMS In Mac OS X MySQL Workbench is built as a 32 bit application so you need the 32 bit drivers 11 2 Migration Overview The Migration Wizard performs the following steps when migrating a database to MySQL 1 Connects to the source RDBMS and retrieves a list of available databases schemas 2 Reverse engineers selected database schemas into a internal representation specific to the source RDBMS This step will also perform the renaming of objects schemas depending on the type of object name mapping method that is chosen 3 Automatically migrates the source RDBMS objects into MySQL specific objects a Target schema objects are created b Target table objects are created i Columns for each table are copied A Datatypes are mapped to MySQL datatypes B Default values are mapped to a MySQL supported default value if possible 201 A visual guide to performing a database migration ii Indexes are converted iii Primary Keys are converted iv Triggers are copied and commented out if the source is not MySQL c Foreign Keys for all tables of all schemas are converted d View objects are copied and commented out if the source is not MySQL e Stored Procedure and Function objects are copied and commented out if the source is not MySQL 4 Provides an opportunity to review the changes for editing and correcting errors in the migrated objec
195. LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE Select kqueue The select and contains the following notice for the kqueue interface Copyright c 2000 Doug White 2006 James Knight 2007 Christian Heimes All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions AIS mets 1 Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer 2 Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution HIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS CAS IS AND NY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE MPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE RE DISCLAIMED IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE OR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL AMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS R SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION OWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT IABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING
196. MEDIUMTEXT LONGTEXT NTEXT VARCHAR Depending on its length MEDIUMTEXT LONGTEXT IMAGE TINYBLOB Depending on its length MEDIUMBLOB LONGBLOB SQL_VARIANT not migrated There is not specific support for this datatype TABLE not migrated There is not specific support for this datatype 217 PostgreSQL migration Source Type MySQL Type Comment HIERARCHYID not migrated There is not specific support for this datatype UNIQUEIDENTIFIER VARCHAR 64 A unique flag set in MySQL There is not specific support for inserting unique identifier values SYSNAME VARCHAR 160 XML TEXT 11 5 PostgreSQL migration 11 5 1 11 5 1 1 11 5 1 2 Native support for PostgreSQL 8 x and 9 x was added in MySQL Workbench 5 2 44 MySQL Workbench versions prior to this would migrate PostgreSQL using the generic migration support Preparations Before proceeding you will need the following Follow the installation guide for installing iODBC on your system For more information see Section 11 1 General installation requirements Access to a running PostgreSQL instance with privileges to the database you want to migrate otherwise known as the source database The Migration Wizard officially supports PostgreSQL 8 0 and above although older versions may work Access to a running MySQL Server instance with privileges to the database you want to migrate The Migration Wizard officially supports MySQL 5 0
197. MENT and delayed key update behaviors apply only to My 1SAM tables Row Options Section To set the row format choose the desired row format from the list For more information about the different row formats that are available see My ISAM Table Storage Formats These options are e Default e Dynamic Fixed 113 Creating Tables 8 7 1 3 8 e Compressed e Redundant Compact When you expect a table to be particularly large use the Avg Row Min Rows and Max Rows options to enable the MySQL server to better accommodate your data See CREATE TABLE Syntax for more information on how to use these options Storage Options Section The Storage Options section is available only for My1SAM tables Use it to configure a custom path to the table storage and data files This can help improve server performance by locating different tables on different hard drives Merge Table Options Section Use the Merge Table Options section to configure MERGE tables To create a MERGE table select MERGE as your storage engine and then specify the My ISAM tables you wish to merge in the Union Tables dialog You may specify the action the server should take when users attempt to perform INSERT statements on the merge table You may also select the Merge Method by selecting from the list For more information about MERGE tables see The MERGE Storage Engine The Inserts Tab Use the Inserts tab to in
198. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT NCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE 348 GLib License for MySQL Workbench POSSIBILITY OF SUCH DAMAGE A 10 GLib License for MySQL Workbench The following software may be included in this product GLib You are receiving a copy of the GLib library in both source and object code in the following folder C Program Files x86 MySQL MySQLWorkbench 5 2 on Windows and MySQLWorkbench app Contents Frameworks on Mac OS X The terms of the Oracle license do NOT apply to the Ghib library it is licensed under the following license separately from the Oracle programs you receive If you do not wish to install this library you may go to the folder C Program Files x86 MySQL MySQL Workbench 5 2 and remove or replace the libglib 2 0 0 dll libgmodule 2 0 0 dl1l1 libgobject 2 0 0 d1ll and libgthread 2 0 0 dll files if present on Windows or go to the folder MySQLWorkbench app Contents Frameworks and remo
199. MySQL Utilities Pa 3 Database Migration MySQL Bug Reporter AN Workbench Blogs Models Planet MySQL m oau amp Workbench Forums Scripting Shell SQL Editor closed Unified SQL Editor and Administration interface In the new user interface the Server Administration functionality such as start stop server managing user accounts etc is now accessible directly from the SQL Editor interface located near where the schema information can be browsed and queries executed The image below contains three screenshots of the Schema window in the SQL Editor The first is from MySQL Workbench 5 2 the second is MySQL Workbench 6 0 with the management tab collapsed and the third shows what the merged management tab looks like Toggle the merged and tabbed views by clicking the new merge button next to the refresh button Table data search Figure 2 3 Comparing the SQL Editor interface for Workbench 5 2 and 6 0 0090 SQL Editor My Local example cor My Local example com DB sakile SQL gt SQL gt y S elal 63 6 6 SCHEMAS 2 Q Search objects P test Objectinfo Session Schema sakila Table data search 000 elal 63 6 amp 64 ESE A elal EA d _ My Local example com DB sakila MANAGEMENT J sa ion SCHEMAS gt Server Status Q Filter objects Client Connections 5 amp sakila amp Users and Privileges gt test E Status and System Variables S Data Export
200. MySQL Workbench 5 2 MySQL Workbench 5 2 Abstract This is the archived MySQL Workbench 5 2 Reference Manual It documents both MySQL Workbench SE and MySQL Workbench OSS editions 5 2 through 5 2 47 If you have not yet installed MySQL Workbench OSS please download your free copy from the download site MySQL Workbench 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 08 16 revision 35980 Table of Contents Preface and Legal Notices cece ce ceceeece ee eeee E T eae ee E E E T O ix 1 MySQL Workbench Introduction 0 cccceeee ee eeeeeeeeeeeeee ee eee eeeeeeee ee aaaaaeteeeeeeeeeaeaaaeneeeeeeseeaeaaaaees 1 2 What is new in MySQL Workbench 6 0 cccceeeeeeee cece ee eeeeeeeeeeee ee aaeaeeeeeeeeeeeaaeaeeeeeeeeeeeaaaaeenees 3 3 MySQL Workbench Editions cccecececee eee eeeeee ee ee sees ee cae teen tees sees aaaaeeeeeeeeeeeeaaaaeaeeeeeeeeeeaeaaeaees 17 4 Installing and Launching MySQL Workbench 0 ccceeeeeeeeeeeeeeeeeee ee aaeateeeeeeeeeeeaaeaeeeeeeeeeeeeaas 19 4 1 Hardware Requirements ccccceeeee ee eeee cece ence cece sees seen aa ee sess aa eeeeseaaeeeessaaeeeessaeeeeeeaaees 19 4 2 Software Requirements ccccceceeeeeeeeee ee ee eneeeeeeeeeeeeaaeaeeeeeeeeee saad eeeeeeeeeeaaaaeeeees
201. NO RMS Ster siesiemiss lonimile s ims ilo 00 54 4 4 5 5 5 5 5 s353 Q quit R refresh H health G GTID Lists U UUIDs L log entries Up Down scroll 14 4 11 mysqlindexcheck Identify Potentially Redundant Table Indexes This utility reads the indexes for one or more tables and identifies duplicate and potentially redundant indexes To check all tables in a database specify only the database name To check a specific table name the table in db table format It is possible to mix database and table names You can scan tables in any database except the internal databases mysql INFORMATION_SCHEMA and performance_schema Depending on the index type the utility applies the following rules to compare indexes designated as idx_a and idx_b e BTREE idx_b is redundant to idx_a if and only if the first n columns in idx_b also appear in idx_a Order and uniqueness count e HASH idx_a and idx_b are duplicates if and only if they contain the same columns in the same order Uniqueness counts e SPATIAL idx_a and idx_b are duplicates if and only if they contain the same column only one column is permitted e FULLTEXT 297 mysqlindexcheck Identify Potentially Redundant Table Indexes idx_b is redundant to idx_a if and only if all columns in idx_b are included in i dx_a Order counts To see DROP statements to drop redundant indexes specify the show drops 298
202. NT Mumankescare Department Name NaME 200 HumanRescare Department GroupName NAME L00 HumanResosrc ij Department gt MocifiedDate_ OATETIME HuranResoure L Emoloyee EroloyeelD INT HuranReseare Employee NationsiBN NVARCHAR IO MuranRescare L Employee Conactio INT HumanRescere Employee LaginID NVARCHAR S12 HumanResosre Z Employee Managem NT Humannesosre L Emoloyee Tale NWARCHAR 109 HumenReseure ij Emolovee BirthOate DATETIME Murankescore L Employee Mantalstetus NCHAR Z Hurankescere Employee Gender NcHARI2 HumanResowe L Employee HireDate DATETIME HuranResoure L Employee SwaviedFieg FLAGI HomanResources L Employee SeariedFag TINYINT HumanResowre Emolovee Vacationours SMALLINT Humanerources Employee Vacationtiosrs SMALLINT Minantasoere juj freloyee Sickieavetp SMALLINT a m d Employee SickLeaveto SMALLINT i You can rename target schemas and tables and change column defnvtons by dicing them once selected SOURCE amp TARGET Vew Colan Meppings S Source Selection Target Selection amp Fetch Schemata Uist Y Schemata Selection S Reverse Engineer Source i TargetColmn Target Type a Migration Message 5 Target Schema Target Tabie rumantesources I Deportment P DeparmertiD SMALLINT Depetment gt Name VARCHAR 102 S GroupName VARCHAR 105 HamanResources L Oepatment o MactiedDate TIMESTAMP HumanResources ij Employee P EroloyeelD INT Employee NationslBN V
203. NT S address YARCHAR 50 address2 YVARCHAR SO district YARCHAR 20 city_id SMALLINT S postal_code VARCHAR 10 phone ARCHAR 20 last_update TIMESTAMP v PRIMARY idx_fk_city_id gt As shown in the preceding diagram the primary key is indicated by a key icon and indexed fields are indicated by a different colored diamond icon Click the arrow to the right of the table name to toggle the display of the fields Toggle the display of indexes and triggers in the same way Right clicking a table opens a pop up menu with the following items e Cut table_name Copy table_name e Edit Table e Edit in New Window e Copy SQL to Clipboard Copy Insert to Clipboard e Delete table_name With the exception of the deletion item these menu items function as described in Section 8 7 1 1 Adding Tables to the Physical Schemata The behavior of the delete option is determined by your MySQL Workbench options settings For more information see Section 6 4 5 The Model Tab 8 7 1 3 The MySQL Table Editor The MySQL Table Editor is a component that enables the creation and modification of tables You can add or modify a table s columns or indexes change the engine add foreign keys or alter the table s name The MySQL Table Editor can be accessed in several ways and most commonly by right clicking on a table name within the Object Viewer and choosing ALTER TABLE This will open a
204. Navigator shows the total area of an EER diagram A black rectangular outline indicates the view port onto the visible area of the canvas To change the view port of an EER diagram left click this black outline and drag it to the desired location You can zoom in on selected areas of an EER diagram by using the slider tool at the bottom of this window The dimensions of the view port change as you zoom in and out If the slider tool has the focus you can also zoom using the arrow keys The default size of the Model Navigator is two pages To change this use the Model menu Diagram Size menu item Figure 8 6 The Model Navigator Palette a 9 0 v 98 The Catalog Tree Palette 8 5 10 The Catalog Tree Palette The Catalog Tree palette shows all the schemata that are present in the Physical Schemata section of the MySQL Model page Expand the view of the objects contained in a specific schema by clicking the button to the left of the schema name This displays the following folder icons e Tables e Views e Routine Groups Expand each of these in turn by clicking the button to the left of the folder icon Selecting an object in this palette displays its properties in the Properties palette which can be found in the lower left corner of the page The Catalog Tree palette is primarily used to drag and drop objects onto an EER diagram canvas Note E On Linux there is a quirk in the GTK tree control where a simple click alwa
205. None for db in serverl get_all_databases db_list append db 0 None else ico Clo aia ej closiro _Co oy sjodlakie 1 3 db_list append db None Get list of all users from the server print Getting users user_list if opt users_to_copy is None users serverl exec_query SELECT user host FROM mysql user WHERE user root and user for user in users user_list append user 0 user 1 else OM user ain Cie Uses COSCO Spia O user_list append user Build options options new_data opt new_data new_port opt new_port new_id opt new_id ryoot pass Selo Olen mysqld_options IEE repont host localhost report port s opt new_port Clone the server print Cloning server instance EEV 341 MySQL Utilities copy_server py sample 342 Appendix A Third Party Licenses Table of Contents A 1 NET Flat TabControl License 20 0 cc cc ccccccccccccececeeeeecceeece ceca eeeeceeeeeaeeeeeeeeseeeseeeeeeneeeeeeaeeeaeees A2 ANTER LIGGNSC 00 desaseaisatadtovaueh ratsttacentsanss poaadaidensateaanaivabadeotausaapegudsadeniteebaretigandenrsieas a A 3 Bitstream Vera LICENSE ponore raran aeaaaee a a an aa ai a e A a a AA Daar EEE AA Boost Library License ouricniismniioriir io ese chee E R A A A D CAO LICENSE minre a a a aa a aae A 6 CTemplate Google Template System License nsssessesesrsessesserstrrisrssssrrrrrrtnsssnsrrrrenent A 7 CUR
206. OL Weel SLAVE llocalinesicss3I2 10 wes SOL wee SLAVEJ To show the full replication topology of a master running on the local host use the following command mysqlrplshow master root localhost 3311 recurse discover slaves login root master on localhost connected Finding slaves for master localhost 3311 Replication Topology Graph localhost 3311 MASTER T leeelliaosicg SSO R FAVE lhe lings s Sse SLAVE MASTER T LOCEIlanosesSSils STAVIT To show the full replication topology of a master running on the local host prompting for the user name and password for slaves that do not have the same user name and password credentials as the master use the following command S mysqlrplshow recurse prompt num retries 1 master root localhost 3331 discover slaves login root Server localhost 3331 is running on localhost master on localhost connected Finding slaves for master localhost 3331 Seuvermlocalnostsicss2 a SmrlnnanGmonmlocallhositr master on localhost FAILED Connection to localhost 3332 has failed Please enter the following information to connect to this server User name root Password master on localhost connected Finding slaves for master localhost 3332 Server localhost 3333 is running on localhost master on localhost FAILED Connection tolocalhos t eH has failed Please enter the fo
207. OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE Except as contained in this notice the name of a copyright holder shall not 347 DockPanel Suite License be used in advertising or otherwise to promote the sale use or other dealings in this Software without prior written authorization of the copyright holder A 8 DockPanel Suite License The following software may be included in this product DockPanel Suite The MIT License Copyright c 2007 Weifen Luo email weifenluo yahoo com Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED
208. OT NULL DEFAULT Db CHAR 64 CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT User CHAR 16 CHARACTER SET utf8 COLLATE utf8 _bin NOT NULL DEFAULT Table_name CHAR 64 CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT Column_name CHAR 64 CHARACTER SET utf COLLATE utf8_bin NOT NULL DEFAULT Timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT TIMESTAMP Column_priv SET Select Insert Update References CHARACTER SET utf8 NOT NULL DEFAULT PRIMARY KEY Host Db User Table_name Column_name ENGINE MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_bin COMMENT Column privileges Click Next to continue if you are satisfied with the generated script The next step of the process is to connect to a MySQL server in order to create the new database schema This page enables you to use a previously stored connection or enter the connection parameters 146 Forward Engineering Figure 8 37 Set Parameters for Connecting to a DBMS Options ome Set parameters for connecting to a DBMS Select Objects review SQL Sa E Stored Connection sae cir Connection Options Connection Method Standard TCP IP y Method to use to connect to the RDBMS Name or IP address of the server host TCP Name of the user to connect with The user s password The schema that will be used as default sche
209. Options 4 4 Variable_name Value 4 4 audit_log_buffer_size 1048576 audit_log_file audit log anarchic loe se Ihnen OFF aud eeo ipo liey ALL audit_log_rotate_on_size 28672 audit_log_strategy ASYNCHRONOUS 4 4 To perform a copy of a audit log file to another location use the following command shell gt mysqlauditadmin audit log name SERVER data audit log 13486539046497235 copy copy to BACKUP Audit_Logs To copy a audit log file from a remote server location to the current location user password will be prompted use the following command shell gt mysqlauditadmin audit log name audit log 13486539046497235 copy remote login user host copy to 14 4 3 mysqlauditgrep Allows users to search the current or an archived audit log This utility allows you to search the current or archived audit logs allowing you to display data from the audit log file according to the defined search criterion It also allows you to output the results in different formats namely GRID default TAB CSV VERTICAL and RAW the original XML format This utility allows you to search and filter the returned audit log records by users users 258 date and time ranges start date 258 and end date 257 SQL query types query type 257 logged event and record types e
210. PE Variable COLUMNS if detailed Whether the column is a user type INDICES LISTING Section TABLES Marks the start and end of an INDICES LISTING section the INDICES_LISTING data dictionary becomes active in this section INDICES Section INDICES_ LISTING Marks the start and end of an INDICES section the INDICES data dictionary becomes active in this section INDEX_NAME Variable INDICES The index name INDEX_PRIMARY Variable INDICES Whether this is a primary key INDEX_UNIQUE Variable INDICES Whether this is a unique index INDEX_TYPE Variable INDICES The index type for example PRIMARY INDEX_KIND Variable INDICES The index kind INDEX_COMMENT Variable INDICES The index comment INDEX_ID Variable INDICES The index ID INDEX_COLUMNS Section INDICES Marks the start and end of an INDEX_COLUMNS section the INDEX_COLUMNS data dictionary becomes active in this section INDEX_COLUMN_NAME Variable INDEX COLUMNS The index column name INDEX_COLUMN_ORDER Variable INDEX COLUMNS The index column order for example ascending descending INDEX_COLUMN_COMMENTVariable INDEX_COLUMNS The index comment INDEX_KEY_BLOCK_SIZE Variable INDEX_ COLUMNS if The index key block size detailed REL_LISTING Section TABLES Marks the start and end of a REL LISTING section the REL_LISTING data dictionary becomes active in this section REL Section REL_LISTING Marks the start and end of a REL section th
211. Parse MySQL Log Files This module provides classes for parsing MySQL log files Currently Slow Query Log and General Query Log are supported Classes class mysql utilities parser GeneralQueryLog stream This class parses the MySQL General Query Log Instances are iterable but the class does not provide multiple independent iterators For example to read the log and print the entries gt gt gt general_log open var lib mysql mysql log gt gt gt log GeneralQueryLog general_log eee for entry in log print entry Parameters stream file type a valid file type for example the result of the built in Python function open version Returns Version of the MySQL server that produced the log Return type tuple program 334 mysql utilities parser Parse MySQL Log Files Returns Full path of the MySQL server executable Return type str port Returns TCP IP port on which the MySQL server was listening Return type int socket Returns Full path of the MySQL server Unix socket Return type str start_datetime Returns Date and time of the first read log entry Return type datetime datetime lastseen_datetime Returns Date and time of the last read log entry Return type datetime datetime class mysql utilities parser SlowQueryLog stream This class parses the MySQL Slow Que
212. Release v Workbench i i Read about all changes in this MySQL Workbench release woa Doc MySQL Bug Metta Planet MySQL Workbench Scripting She MySQL Utilities Library Reporter m Workspace SQL Development Data Modeling Server Administration Connect to existing databases and run a MA Create and manage models forward amp Configure your database server setup SQL Queries SQL scripts edit data and reverse engineer compare and manage database objects user accounts browse status variables synchronize schemas report and server logs F Open Connection to Start Querying Open Existing EER Model Server Administration wi amp im localhost model mysqid localhost at 3 User root Host localhost 3306 Last modified Tue Sep 6 10 55 20 2011 N Local Type MacOS X amp Big Iron Server Ry Home_Media amp New Connection Ee New Server Instance ri Edit Table Data i Create New EER Model Pe Manage Import Export s Edit SQL Script Create EER Model From Existing Database Manage Security Bs 6 Manage Connections Create EER Model From SQL Script g Manage Server Instances o gt A Ready You can launch any of the utilities listed by typing the name of the command To find out what options are available use the option or read the appropriate manual page The utilities are designed to work on MySQL systems with grants enabled but can also operate on servers started with the skip grant tables startup option However
213. Removing MySQL Workbench After Installation Using the Installer Package 1 To uninstall MySQL Workbench open the Control Panel and Choose Add or Remove Programs Find the MySQL Workbench entry and choose the Remove button This will remove MySQL Workbench 2 Any modules added to the c SPROGRAMFILES MySQL MySQL Workbench version modules directory will not be deleted Note E If you installed MySQL Workbench using the Installer package it is not possible to remove MySQL Workbench from the command line Although you can manually remove some of the components there is no command line option for removing MySQL Workbench Removing the MySQL Workbench directory manually will not remove all the files belonging to MySQL Workbench Removing MySQL Workbench After Installation from a Zip File To remove MySQL Workbench just delete the MySQL Workbench directory want to keep them make sure you copy those modules to a different directory Note R If you installed any additional modules within the modules directory and you before deleting the MySQL Workbench directory 22 Installing MySQL Workbench on Linux 4 3 4 Installing MySQL Workbench on Linux There are binary distributions of MySQL Workbench available for several variants of Linux including Fedora Oracle Linux and Ubuntu In addition to the binary distributions it is also possible to download the MySQL Workbench source code as a tar gz or RPM package Check the MySQ
214. S AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD 372 Python License TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT ABILITY AND FITNESS IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE test_epoll The test_epoll contains the following notice Copyright c 2001 2006 Twisted Matrix Laboratories Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
215. SS version Use this dialog window to set the options for creating documentation of your database models 163 The DBDoc Model Reporting Dialog Window Commercial Version Figure 8 51 The DBDoc Model Reporting Main Wizard E DBDoc Model Reporting Generate a Report for the Current Model HTML Basic Frames detailed HTML report using frames For printing HTML Basic Sinale Page use a single page HTML report template HTML Detailed Frames Text Basic Template Style Vibrant Vibrant colors Basic Options Title Model Report Title used for the report Output Path documentstolder report_ date time Path where the report should be written to If the report uses multiple files e g HTML the path will be created as a folder otherwise as a file The following variables will be substituted Linux Mac desktopfolder documentsfolder Zdate Ztime Zyear month monthname day Content Output Table Columns Output Table Indices Output Foreign Keys Output References from Foreign Keys Cancel Generate You can choose from four available templates HTML Basic Frames Model documentation in HTML format that makes use of frames HTML Basic Single Page Single Page HTML documentation not using frames HTML Detailed Frames Detailed HTML documentation using frames Text Basic Text file documentation When you click a template a preview image disp
216. Section end The last two are the most commonly used in MySQL Workbench templates and these important markers are briefly described in the following sections Variables The use of variables in the templates is straightforward Any variables denoted by markers in the template file are replaced by their corresponding data prior to the output file being generated The mapping between variables and their corresponding data is stored by MySQL Workbench in what is known as a data dictionary In the data dictionary the variable name is the key and the variable s corresponding data is the value The data dictionaries are built by MySQL Workbench and filled with the data contained in the model being processed By way of example the following code snippet shows part of a template file Total number of Schemata SCHEMA_COUNT In the generated output file the variable SCHEMA_COUNT is replaced by the number of schemata in the model Total number of Schemata 2 A variable can appear as many times as required in the template file Sections Sections are used to perform iteration in the templates When MySQL Workbench exchanges the variables in a section for data it does so iteratively using all data in the data dictionary in which the variable is defined MySQL Workbench builds the data dictionaries according to the model currently being processed Consider the following code snippet SCHEMATA Schema SCHEMA NAME SCH
217. Server e Keep schemata as they are Catalog Schema Table gt Schema Table This will create multiple databases one per schema e Only one schema Catalog Schema Table gt Catalog Table Merges each schema into a single database e Only one schema keep current schema names as a prefix Catalog Schema Table gt Catalog Schema_table Preserves the schema name as a prefix Figure 11 6 MySQL Workbench migration Schemata Selection SOURCE amp TARGET Source Selection Target Selection Fetch Schemata List Schemata Selection Reverse Engineer Source OBJECT MIGRATION Source Objects Migration Select the schemata you want to migrate Catalog Schema Purchasing Sales TJ AdventureWorks dbo HumanResources E Person 3 Production Purchasing 8 Sales J msdb amp dbo Manual Editing Target Creation Options 1 schemata selected Create Schemata Schema Name Mapping Method Choose how the reverse engineered schemata and objects should be mapped Keep schemata as they are Catalog Schema Table gt Schema Table Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer Only one schema Catalog Schema Table gt Catalog Table REPORT Only one schema keep current schema names as a prefix Catalog Schema Table gt Catalog Schema _Table Migration Report Reverse Engineer Source The source metadata is fetched from the source RD
218. Server Instances wid World Instance Name Wor Connection System Profile MySQL Connection Pick a preset connection to the MySQL server instance The connection will be used for basic administration tasks such as managing users and viewing schema objects Connection world root 127 0 0 1 3306 lt Standard TCP IP gt v MySQL Server Version Connect and Check SSH Shell Connection mysql ssh ssh_private_key Crew Coe oae orep ereo The System Profile tab of the wizard enables you to specify server specific information This is achieved primarily through selecting a Profile Template A Profile Template contains standard information used in managing the server instance The following Profile Templates are available e Fedora Linux MySQL Package Fedora Linux Vendor Package FreeBSD MySQL Package e Generic Linux MySQL tar package e Mac OS X MySQL Package e OpenSolaris MySQL Package e RHEL MySQL Package e SLES MySQL Package 183 Manage Server Instances Dialog e Ubuntu Linux MySQL Package Ubuntu Linux Vendor Package e Windows MySQL 5 0 Installer Package e Windows MySQL 5 1 Installer Package e Windows MySQL zip package e Custom After you select a profile a number of default parameters will be set including commands used to start and stop MySQL commands to check server status and the location of the my ini or my cnf configuration file Figure 10 2
219. Shell Dots in class names are changed to underscores in their Python counterparts For example db mysql Table becomes db_mysql_Table in Python The Application Objects Tree GRT Tree As mentioned previously Workbench document data is stored in an object hierarchy This hierarchy is known as the GRT Tree The GRT Tree can be accessed and modified from supported external scripting languages such as Python Care should be taken when modifying the GRT Tree to prevent a 225 Modules mistake from leading to corruption of the document Backups should be made before manipulating the tree Read only access to the tree is the safest approach and is sufficient in most cases The main nodes in the Application Object Tree Table 12 1 The main nodes in the Application Object Tree Node Description wb registry Application data such as plugin registry list of editors and options wb customData A generic dictionary for data you can use to store your own data This dictionary is saved and reloaded with Workbench and is global not document specific wb options Contains some default options that are used by Workbench wb rdobmsMgmt Internal registry of supported RDBMS modules known data types wb doc The currently loaded model document wb doc physicalModels 0 The currently loaded model object containing the database catalog and diagrams wb doc physicalModels 0 catalog The dat
220. T SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE Modified by Jack Jansen CWI July 1995 Use binascii module to do the actual line by line conversion between ascii and binary This results in a 1000 fold speedup The C version is still 5 times faster though Arguments more compliant with Python standard XML Remote Procedure Calls The xmlrpclib module contains the following notice The XML RPC client interface is Copyright c 1999 2002 by Secret Labs AB Copyright c 1999 2002 by Fredrik Lundh By obtaining using and or copying this software and or its associated documentation you agree that you have read understood and will comply with the following terms and conditions Permission to use copy modify and distribute this software and its associated documentation for any purpose and without fee is hereby granted provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission SECRET LAB
221. TUS on the master 7 Are the InnoDB configurations compatible plugin vs native 8 Are the storage engines compatible have same on slave as master 9 Are the lower_case_tables_names settings compatible Warn if there are settings for lowercase uppercase table names that can cause problems See Bug 59240 10 Is the slave behind the master The utility runs each test in turn unless there is a fatal error preventing further testing such as a loss of connection to the servers Each test can complete with one of the following states pass the prerequisites are met fail the prerequisites were met but one or more errors occurred or there are exceptions to consider or warn the test found some unusual settings that should be examined further but may not be in error Use the verbose 319 option to see additional information such as server IDs lower_case_table_name settings and the contents of the master information file on the slave To see the values from the SHOW SLAVE STATUS statement use the show slav status 819 option OPTIONS mysqlrplcheck accepts the following command line options e help Display a help message and exit e master lt source gt Connection information for the master server in the format lt user gt lt passwa gt lt host gt lt port lt socket gt Jor lt ogin path gt lt port gt lt socket gt e master info file lt file gt The name of the master in
222. TY RIGHTS 5 CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 6 1 FOR ANY INCIDENTAL SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING DISTRIBUTING OR OTHERWISE USING PYTHON 1 6 1 OR ANY DERIVATIVE THEREOF EVEN IF ADVISED OF THE POSSIBILITY THEREOF 6 This License Agreement will automatically terminate upon a material breach of its terms and conditions 7 This License Agreement shall be governed by the federal intellectual property law of the United States including without limitation the federal copyright law and to the extent such U S federal law does not apply by the law of the Commonwealth of Virginva excluding Virginia s conflict of law provisions Notwithstanding the foregoing with regard to derivative works based on Python 1 6 1 that incorporate non separable material that was previously distributed under the GNU General Public License GPL the law of the Commonwealth of Virginia shall govern this License Agreement only as to issues arising under or with respect to Paragraphs 4 5 and 7 of this License Agreement Nothing in this License Agreement shall be deemed to create any relationship of agency partnership or joint venture between CNRI and Licensee This License Agreement does not grant permission to use CNRI trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee or any third party 8 By clicking on the ACCEPT button w
223. T_TIMESTAMP Available for TIMESTAMP data types Default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP Available for TIMESTAMP data types To add a column click the Column Name field in an empty row and enter an appropriate value Select a data type from the Datatype list Select the column property check boxes as required according to 107 Creating Tables the list of column properties below and also read the CREATE TABLE documentation for information about what these options mean e PK PRIMARY KEY NN NOT NULL e UQ UNIQUE INDEX BIN BINARY e UN UNSIGNED e ZF ZEROFILL Al AUTO_INCREMENT To change the name data type default value or comment of a column double click the value you wish to change The content then becomes editable You can also add column comments to the Column Comment field It is also possible to set the column collation using the list in the Column Details panel To the left of the column name is an icon that indicates whether the column is a member of the primary key If the icon is a small key that column belongs to the primary key otherwise the icon is a blue diamond or a white diamond A blue diamond indicates the column has NN set To add or remove a column from the primary key double click the icon You can also add a primary key by checking the PRIMARY KEY check box inthe Column Details section of the table editor If you wish to create a composite primary key you can s
224. The Columns Tab Columns Column Name Datatype PK NN UQ BIN UN Z AI Default customer_id SMALLINT S VV v v store_id TINYINT 3 v 7 first_name VARCHAR 45 v gt last name VARCHAR 45 v email VARCHAR 50 NULL address_id SMALLINT S v vi gt active TINYINT 1 y T gt create_date DATETIME v gt last_update TIMESTAMP v CURRENT_TIMESTA Column Name Data Type Collation Table Default Default Comments a vV Primary Key V Not Null vJ Unique V Binary v Unsigned v Zero Fill ial Auto Increment Columns Indexes ForeignKeys Triggers Partitioning Options Right click a row under the Column Name column to open a pop up menu with the following items e Move Up Move the selected column up e Move Down Move the selected column down e Copy Copies the column for a model Added in MySQL Workbench 5 2 45 e Cut Copies and then deletes the column for a model Added in MySQL Workbench 5 2 45 e Paste Pastes the column If a column with the same name already exists then _copy1 is appended to the column name Added in MySQL Workbench 5 2 45 Delete Selected Columns Select multiple contiguous columns by right clicking and pressing the Shift key Use the Control key to select noncontiguous columns Refresh Update all information in the Columns tab e Clear Default Clear the assigned default value Default NULL Set the column default value to NULL e Default 0 Set the column default value to 0 Default CURREN
225. The main report details e table_details_list html A Schema overview along with details of columns indexes and foreign keys for each schema e table_element_details html The details for every element of the table top html The top frame of the report e view_details html List of all columns and indexes for the schema Choosing the Text Basic option creates a directory containing one text file You can click index html to view a report The following screenshot shows the HTML Detailed Frames report being displayed Figure 8 52 The DBDoc Model Report Model Report Mozilla Firefox fe E x File Edit Yiew History Bookmarks Tools Help lt X m aA A B file C Documents and Settings Tony Bedford My Documents MySQL Workbench Report Detailedjindex html vw gt X Google A L Most Visited gt Getting Started Ww Latest Headlines O Customize Links B Free Hotmail k Windows Marketplace E Windows Media B Windows eS sur MySQL Workbench Detailed Model Report Schema Overview Schema world Schema mydb gt DDL script Full Details CREATE SCHEMA IF NOT EXISTS world DEFAULT CHARACTER SET latinl Schema Tables 1 MyNiceTable Table cit Schema world gt an 7 Full Details gt Columns pote manlou esta Key Column Name Datatype Not Null Default Comment oe Pk D INT 11 Yes country countrylanguage Name CHAR 35 Yes CountryCode CHAR 3 Yes District CHAR 20 Yes Population INT 11 Yes o Indi
226. Using SSH Key SSH Public Key Path C Documents and Settings The Test Application Data sshjid_rsa Check that everything is in order then click Next 8 If a Windows server is used then the Windows configuration parameters must be set 33 Administering a MySQL Server Figure 5 7 Getting Started Tutorial Windows Management Create New Server Instance Profile ost Machine sca Set Windows configuration parameters for this machine onnection 3 Connection Windows management requires a user account on this machine which has the required privileges to query system status and to control services For configuration file manipulation read write access to the file is needed Select the service to manage From the list below It will also help to find the configuration file MySQL55 Running Start mode Auto v Windows Management Path to Configuration File C Documents and Settings All Users 4pplication Data MySQL MySQL Server Check that everything is in order then click Next 9 The wizard will now check that it is able to access the MySQL Server configuration file and access the start and stop commands 34 Administering a MySQL Server Figure 5 8 Getting Started Tutorial Test Host Settings Create New Server Instance Profile Testing Host Machine Settings onnection Test DB Connection The connection to the host machine is being tested This might take a Few moments de
227. Window Size 0 ccceeeeeeeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaaaaeeteeeeeeees 6 4 Workbench Preferences ccccccsecseesecceeeeeeeeseeeeeeeeneesneneeseeseeseeseeeseneeeeeneeeeeaeeeseneeeaeneegaeaes 6 4 1 The Generalihab aarstieadiae din aes teeta Mae iaatien DH aad eee baa oo hail ace 6 4 2 The Administrator Tab ccccccccccscc a a a ea A ae akra o a ta eek Pirai 6 4 3 The SQL Edit t Tabiran a a eae E Dee a 6 4 4 The SQL QuerieS Talo e T ra a a a Ar a A Eea A ara ai Eri a eien 6 4 52 The MOdEl taD t aa E usd A N a a a a a a a ai 6 4 6 The Model MySQL Tab 0 ccccccsceccceceeeeeeeeeeeeeeeeeeeeeeeseeeeeeeaeeeeeeeseeeeeeesseeeeeaaeeeeeaaanees 6 427 The Diagram Tab eroties eiiie id eee veel ad die ENEE IEE Sav ced dee ee 6 4 8 The Appearance Talo ccc ceeeeeeeeeeeee cece nner cece E E S EEE AE When MySQL Workbench first starts it presents the Home window which has two main sections e Workbench Central e Workspace Note E MySQL Workbench 5 2 introduced the Home window MySQL Workbench 5 1 displays the MySQL Model workspace rather than the Home window Note that 5 1 does not support the SQL Editor and Server Administration functionality of 5 2 The two sections can be seen in the following screenshot For more information see the following sections 49 Workbench Central Figure 6 1 The Home Window IN dg ere en A Workbench Read about all changes in this MySQL Workbench releas
228. Workbench Y Workbench Central Welcome to MySQL Workbench 2 D fw What s New in This Release ae sien MySQL Utilities Database Migration dice Bug kbench Read about all changes in this MySQL Workbench release Blogs m Workspace SQL Development Data Modeling Server Administration Connect to existing databases and run A Create and manage models forward amp Configure your database server setup reverse engineer compare and user accounts browse status variables SQL Queries SQL scripts edit data and manage database objects e synchronize schemas report and server logs g Open Connection to Start Querying er Open Existing EER Model E Server Administration My Local example com DB R sakila_full My Local example com DB WE User root Host 127 0 0 1 3306 p s Last modified Tue Jun 4 14 06 28 2013 ED Local Type Go example com live e My Addressbook My Addressbook ES Ga GE Hello World R Hello World amp New Connection E New Server Instance heed rane D Create New EER Model De eee cee erro Edit SQL Script Create EER Model From Existing Database Manage Security x Create EER Model From SQL Script Gd Manage Server Instances Manage Connections Unified SQL Editor and Administration interface Figure 2 2 Home Screen Workbench 6 0 e080 MySQL Workbench MySQL Connections Shortcuts My Local example com DB C pas MySQL Doc Library root we 1270 013306 for
229. _file size data mysql bin 000076 125 data mysql bin 000077 125 data mysql bin 000078 556 data mysql bin 000079 168398223 data mysql bin index 76 Total size of binary logs 168 399 105 bytes or 160 00 MB 289 mysqlfailover Automatic replication health monitoring and failover Server is not an active slave no relay log information InnoDB tablespace information InnoDB_file size type specificaton data ib_logfile0 5242880 log file data ib_logfilel 5242880 log file data ibdatal 220200960 shared tablespace ibdatal 210M data ibdata2 10485760 shared tablespace ibdata2 10M autoextend data employees departments ibd 114688 file tablespace data employees dept_emp ibd 30408704 file tablespace data employees dept_manager ibd 131072 file tablespace data employees employees ibd 23068672 file tablespace data employees salaries ibd 146800640 file tablespace data employees titles ibd 41943040 file tablespace Total size of InnoDB files 494 125 056 bytes or 471 00 MB done 14 4 10 mysql failover Automatic replication health monitoring and failover This utility permits users to perform replication health monitoring and automatic failover on a replication topology consisting of a master and its slaves The utility is designed to run interactively or continuously refreshing the health information at periodic intervals Its primary mission is to monitor the master for failure and when
230. a gt film Table Maintenance actor 1 rows matched 4 first_name JENNIFER 2 fimaag Drop 15 Tables customer 1 rows matched gt E film_catef Truncate 15 Tables 6 first_name JENNIFER gt film_text a Refresh All gt rental gt staff gt Session 2 rows matched in 15 searched tables Searching finished al Context Sensitive help for the SQL Editor Select a keyword or function in your query and after a delay it will show formatted help information from the MySQL Server equivalent to using the help command from the command line MySQL Client Schema Inspector Figure 2 5 Context Sensitive Help we o r e uB FFRAOCB COR esaw Q Filter objects vi sakila vy Dp Tables gt I actor gt D address SHALT tT EE ale RESULT rete BUFFER_RESULT gt E category SQL_CACHE SQL_NO_CACHE gt i oy 5Q1_CALC_FOUNO 1 Select_expr a select_expr gt D country FROM table references at par on lis gt E customer WHERE where_condition gt i film iaooe BY cOl_name expr t gt E film actor lee Irma ohgie HI ottur reo t gt E film_category ORDER BY col_name expr gt i filmtext position oie gt i inventory LIMIT roftsee ro count gt f language row_count OFFSET offset PROCEDURE gt E payment procedure_name argument_ uso CINTO OUTFILE file gt i rental eenah Set barsak name gt i staff export ns INTO Sanrerce
231. a quick hands on introduction to using MySQL Workbench to generate code for later use for either in or outside of MySQL Workbench 9 1 Generating SQL queries MySQL Workbench can be used to generate SQL most typically as either INSERT or SELECT queries Below are the most common methods to generated SQL statements in MySQL Workbench e Right clicking on a table or column name within the schema view will offer many different SQL generating options For example right clicking on a table name will allow creating SELECT A11 INSERT UPDATE DELETE and CREATE queries And with the option to either send these queries to the system s clipboard or to the SQL Editor window Right clicking on a field within a cell in the SQL Editor offers the Copy Row Content and Copy Field Content options and includes the option to leave the chosen values unquoted All of the MySQL Workbench Export options include the option to export as SQL 9 2 Generating PHP code MySQL Workbench can be used to generate PHP code with the bundled PHP plugin by using the Plugins Utilities Copy as PHP Code menu option Below is an example scenario for how to create PHP code It is a SELECT statement and optionally uses SET to set variables SQL variables will generate PHP variables in the code which will then be bounded to the statement before execution 1 Generate or type in the desired SQL
232. a schemata list and a color chart list Use these lists to select the appropriate schema and color accent for the new routine group Make sure that you associate the new routine group with a database The color of your routine group can be changed later using the Properties palette Create a routine group by clicking anywhere on the EER Diagram canvas This creates a new routine group with the default name routines1 To revert to the default mouse pointer click the arrow icon at the top of the vertical toolbar Right clicking a routine group opens a pop up menu With the exception of the delete option and rename options these menu options function as described in Section 8 7 4 2 1 Adding Routine Groups to the Physical Schemata There is no rename option and the behavior of the delete option is determined by your MySQL Workbench options settings For more information see Section 6 4 5 The Model Tab The Routine Group Editor To invoke the routine group editor double click a routine group object on the EER Diagram canvas or double click a routine group in the Physical Schemata section on the MySQL Model page This opens the routine group editor docked at the bottom of the application Double clicking the title bar undocks the editor Do the same to redock it Any number of routine groups may be open at the same time Each additional routine group appears as a tab at the top of the routine editor Routine group and Privileges tabs ap
233. abase catalog for the model Contains the list of schemata whb doc physicalModels 0 catalog schemata List of schemata in the model Individual schema can be accessed as a list schemata 0 schemata 1 wb doc physicalModels 0 catalog schemata 0 tables views routines Lists of tables views routines in the schema whb doc physicalModels 0 diagrams List of EER diagrams in the model wb doc physicalModels 0 diagrams 0 figures layers connections List of figures layers connections relationships in the diagram 12 2 Modules In the GRT Modules are libraries containing a list of functions that are exported for use by code in other modules scripts or Workbench itself Modules can currently be written in C Lua or Python but the data types used for arguments and the return value must be GRT types GRT modules are similar to Python modules but are imported from the built in grt module instead of directly from an external file The list of modules loaded into the grt module is obtained from grt modules Modules can be imported in Python using statements such as from grt modules import WbModel To export functions as a module from Python code you must carry out the following steps 1 The source file must be located in the user modules folder This path is displayed in the Workbench Scripting Shell with the label Looking for user plugins in It is also possible to in
234. abase objects so there is no confirmation dialog box when they are deleted 8 7 8 2 The Image Editor 8 7 8 2 1 To invoke the image editor double click an image object on an EER Diagram canvas This opens the image editor docked at the bottom of the application Double clicking the image editor tab undocks the editor Double click the title bar to redock it Any number of images may be open at the same time Each additional image appears as a tab at the top of the image editor The Image Tab Use the Image tab of the image editor to perform the following tasks 127 Reverse Engineering Rename the image using the Name text box e Browse for an image using the Browse button 8 7 9 Reverse Engineering With MySQL Workbench you can reverse engineer a database using a MySQL create script or you can connect to a live MySQL server and import a single database or a number of databases All versions of MySQL Workbench can reverse engineer using a MySQL DDL script Only commercial versions of MySQL Workbench can reverse engineer a database directly from a MySQL server 8 7 9 1 Reverse Engineering Using a Create Script To reverse engineer using a create script choose the File Import Reverse Engineer MySQL Create Script menu items This opens a file open dialog box with the default file type set to an SQL script file a file with the extension sql You can create a data definition DDL script by executing the mysqldump db
235. able Note R To quickly enter the name of a table view or column double click the item in the Schemata Palette The item name will be inserted into the SQL Query panel 7 7 4 Main Tabsheets The main tabsheets area contains several tabs e Output and History Tabsheet e Results Tabsheets e Live Editing Tabsheet Figure 7 8 SQL Editor Main Tabsheets Overview Output History Snippets Result 1 X The following sections describe each of these in more detail 7 7 4 1 Output and History Tabsheet The Output and History tabsheet is located at the bottom of MySQL Workbench and can be toggled on or off It contains a select box that includes Action Output Text Output and History options 74 Main Tabsheets The Action Output tabsheet displays a summary of the communication between the script and the server The messages displayed can be information or errors Each message displays the time the action that was carried out and the response from the server This output is useful for troubleshooting scripts The Text Output tabsheet will display a textual representation of the query as displayed using the MySQL Console Use Query Execute All or Selection to Text to send output to this tabsheet The History tabsheet provides a history of SQL operations carried out The time and SQL code for each operation is recorded To view the SQL executed click the time and the SQL code executed will be displayed in the SQL colum
236. able 275 option The name of each file is composed of the database and table names followed by the file format For example the following command produces files named db1 table_name csv mysqldbexport server root serverl 3306 format csv dbl export data By default the operation uses a consistent snapshot to read the source databases To change the locking mode use the locking 275 option with a locking type value Use a value of no locks to turn off locking altogether or lock all to use only table locks The default value is snapshot Additionally the utility uses WRITE locks to lock the destination tables during the copy You can include replication statements for exporting data among a master and slave or between slaves The rp1 275 option permits you to select from the following replication statements to include in the export master Include the CHANGE MASTER statement to start a new slave with the current server acting as the master This places the appropriate STOP and START slave statements in the export whereby the STOP SLAVE statement is placed at the start of the export and the CHANGE MASTER followed by the START SLAVE statements are placed after the export stream slave Include the CHANGE MASTER statement to start a new slave using the current server s master information This places the appropriate STOP and START slave statements in the export whereby the STOP SLAVE statement is placed at the start of t
237. able4 T tables tables T tables gt INA awa gt I table It is also possible to control individual changes by clicking the arrows Clicking an arrow causes it to change between the three available synchronization directions from model to source from source to model or bidirectionally In the following example t able6 will be created in the live database and table will be created in the model 153 Forward Engineering Figure 8 44 Click Arrows to Change Direction of Synchronization Synchronize Model with Database Connection Options a et Model and Database Differences Connect to DBMS Select Schemata P Se Double click arrows in the list to choose whether to ignore changes update the model with database changes or Fetch Object Info Select Changes to Apply MIE mydb tablet T tablez table2 tables table3 T tables T tables 8 7 10 4 Creating a Catalog Diff Report This facility enables you to create a report detailing the differences between your MySQL Workbench model and a live database or script Choose Database Generate Catalog Diff Report from the main menu to run the Compare and Report Differences in Catalogs wizard The first step in the wizard is to specify which catalogs to compare For example you may wish to compare your live database against your current MySQL Workbench model 154 Forward Engineering Figure 8 45 Catalog Sources Compare and Report Differences in Catalogs
238. ache OE I E lec 296 mysqlindexcheck Identify Potentially Redundant Table Indexes UUTOS 4 4 4 4 4 4 host pore I role state gtid_mode health 4 4 ltecailinosic S332 MASTER WF ON OK tecallinosic 3383 Sivas Ue ON OK lecaillinosic S334 Sila UE ON IOK 4 4 4 4 4 4 Q quit R refresh H health G GTID Lists U UUIDs L log entries If the user presses the l key and the 1og 293 option was specified the interface will show the entries in the log file Note example truncated for space allowance MySQL Replication Monitor and Failover Utility Failover Mode auto Next Interval Mon Mar 19 16 06 13 2012 Master Information Binary Log File Position Binlog Do_DB Binlog Ignore _Ds mysel OO OOO eee GTID Executed Set 2A67DE00 2DA1 11R2 A711 00764F2BE90F 1 7 Log File 4 4 Date Entry 4 4 2002 0s oe SS osc PME ENO mHaivkovcinmconsolemsica needs sac 2012 03 19 15 55 33 PM INFO Failover mode auto aaga 2012 03 19 15 55 33 PM INFO Getting health for master localhos ZOUZ OS3 18 Wessss wi IN
239. acility still operates and performs whatever part of its purpose remains meaningful For example a function in a library to compute square roots has a purpose that is entirely well defined independent of the application Therefore Subsection 2d requires that any application supplied function or table used by this function must be optional if the application does not supply it the square root function must still compute square roots hese requirements apply to the modified work as a whole If dentifiable sections of that work are not derived from the Library nd can be reasonably considered independent and separate works in hemselves then this License and its terms do not apply to those ections when you distribute them as separate works But when you istribute the same sections as part of a whole which is a work based n the Library the distribution of the whole must be on the terms of his License whose permissions for other licensees extend to the ntire whole and thus to each and every part regardless of who wrote Le GO Ch GO ees co Thus it is not the intent of this section to claim rights or contest your rights to work written entirely by you rather the intent is to exercise the right to control the distribution of derivative or collective works based on the Library In addition mere aggregation of another work not based on the Library with the Library or with a work based on the Library on a volume of a
240. aeaaea 84 8 3 Create EER Model from Existing Database ccceceeeeeeeeeeeeeeeeeeeeeeeeaeaaeteeeeeeeeeaeaaea 84 MySQL Workbench 5 2 8 4 Create EER Model from SQL Script 00 ceceeeeeee ee eeeeeeeeeeeee ee aaeaeeeeeeeeeeeeaaaaaeeeeeeeeeeeaaa 84 So MOCGIECION soror rere n E T 85 8 5 Modeling MOnuS scsccccssieubcesecieecensiaid dvaeiad eenndeie idea ett ceed alvedeaet iw etnies ue bie eendiereies 86 oo Te 010 Geena ern ene ner eer rece mer ar ener ene eee aero emer cert ere ere 95 8 5 3 EER Diagramo ooti AS SSA RAR S ENS A 96 8 5 4 The Physical Schemata Panel cccccseeeeeeeeeeeeeeaaeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeeaes 96 8 5 5 The Schema Privileges Panel cccceceaeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeseaaaaaaneeeeeeeeeaaa 96 8 5 6 The SQAL Scoripts Panel scrirorosirraki onea E a 98 85 7 The Model Noles Panel sorceress nonen RSNA 98 898 The History Palete sonnia a n cadtacactausa pibeadenetveaneacteeass 98 8 5 9 The Model Navigator Panelis ienesis nienean anana EAE KAANE AIS KEANE REAS 98 8 5 10 The Catalog Tree Palette 2 0 0 0 ceceeeeeeeeeee esac aa eeteeeeeeeeeaeaaeaeeeeeeeeeaeaaaaeeeeeees 99 8 5 11 The Layers Palette cciilciecstctennca setceecentegercdieleuessteseetebanteee caddy deecis viwewdeiaseerenantiees 99 8 5 12 The Properties Palette cece ce ceceeeee ee nseni ana E 100 8 6 EER Diagram EGO iiccissiieicaiian Haak eta EAE KARA VOTE ES ARRETEERITAKSE eed 1
241. ally started in GNOME desktops but normally is not in KDE and others The gnome keyring daemon can be used for password storage in MySQL Workbench on non GNOME platforms but must be started manually 7 6 2 Standard TCP IP Connection This connection method enables MySQL Workbench to connect to MySQL Server using TCP IP Parameters tab Hostname The host name or IP address of the MySQL server Username User name to use for the connection Password Optional password for the account used If you enter no password here you will be prompted to enter the password when MySQL Workbench attempts to establish the connection MySQL Workbench can store the password in a vault see Section 7 6 1 The Password Storage Vault Port The TCP IP port on which the MySQL server is listening the default is 3306 Default Schema When the connection to the server is established this is the schema that will be used by default It becomes the default schema for use in other parts of MySQL Workbench Advanced tab More parameters can be set for the connection by using the Advanced tab Figure 7 2 Manage DB Connections Advanced Tab ME Wianage DB Connections isan OEE SE Stored Connections Connection Name Big Iron Server Type a name for the connection v Local instance Ays0155 Connection Method Standard TCP IP Method to use to connect to the RDBMS Big Iron Server A localhost Parameters Advanced Use compression
242. alth Display the replication health of the topology By default this includes the host name port role MASTER or SLAVE of the server state of the server UP is connected WARN not connected but can ping DOWN not connected and cannot ping the GTID_MODE and health state This command requires one of the following combinations e master 813 and slaves 313 e master 813 and discover slaves login 812 The master health state is based on the following if GTID_MODE ON the server must have binary log enabled and there must exist a user with the REPLICATE SLAVE privilege The slave health state is based on the following the O_ THREAD and SQL_THREADS must be running it must be connected to the master there are no errors the slave delay for non gtid enabled scenarios is not more than the threshold provided by the max position 313 and the slave is reading the correct master log file and slave delay is not more than the seconds behind 313 threshold option reset Execute the STOP SLAVE and RESET SLAVE commands on all slaves This command requires the slaves 313 option The discover slaves login 312 option is not allowed because it might not provide the expected result excluding slaves with the IO thread stopped Optionally the master 313 option can also be used and in this case the utility will perform an additional check to verify if the specified slaves are associated i e replication c
243. ample you may use it to group all your views Click the layer tool and use it to draw a rectangle on the canvas Change to the standard mouse pointer tool and pick up any objects you would like to place on the newly created layer To change the size of a layer first select it by clicking it When a layer is selected small rectangles appear at each corner and in the middle of each side Adjust the size by dragging any of these rectangles You can also make changes to a layer by selecting the layer and changing properties in the Properties panel Using the Properties panel is the only way to change the name of a layer To activate the layer tool from the keyboard use the L key For more information about layers see Section 8 7 5 Creating Layers 8 6 1 5 The Text Tool The text tool is the square icon with a capital N in the top left corner Use this tool to place text objects on the EER diagram canvas Click the tool then click the desired location on the canvas After a text object has been dropped on the canvas the mouse pointer reverts to its default To add text to a text object right click the text object and choose Edit Note or Edit in New Window from the pop up menu You can manipulate the properties of a text object by selecting it and then changing its properties in the Properties panel To activate the text tool from the keyboard use the N key For more information about text objects see Section 8 7 7 Cr
244. andidate slave prerequisites Waiting for slaves to catch up to old master Stopping slaves Performing STOP on all slaves Demoting old master to be a slave to the new master Switching slaves to new master Starting all slaves Performing START on all slaves Checking slaves for errors Switchover complete eC Once If the replication health report is generated on the topology following the above command it will display the old master as a slave as shown below Replication Topology Health 4 4 4 4 4 4 host port rore state gtid_mode health 4 4 4 4 4 4 localhost 13332 MASTER UP ON Oke localhost 3331 SLAVE UP ON OR localhost 3333 SLAVE tie ON IROK localhost 3334 SLAVE UP ON OR 4 4 4 4 4 4 You can use the discover slaves feature if and only if all slaves report their host and port to the master A sample command to generate a replication health report with discovery is shown below Note that the option discover slaves login 312 cannot be used in conjunction with the slaves 813 option mysqlrpladmin master root localhost 3332 discover slaves login root health Discovering slaves for master at localhost 3332 Discovering slave at localhost 3331
245. ans a collection of software functions and or data prepared so as to be conveniently linked with application programs which use some of those functions and data to form executables The Library below refers to any such software library or work which has been distributed under these terms A work based on the Library means either the Library or any derivative work under copyright law that ds to say a work containing the Library or a portion of it either verbatim or with modifications and or translated straightforwardly into another language Hereinafter translation is included without limitation in the term modification Source code for a work means the preferred form of the work for making modifications to it For a library complete source code means all the source code for all modules it contains plus any associated interface definition files plus the scripts used to control 351 GNU Lesser General Public License Version 2 1 February 1999 compilation and installation of the library Activities other than copying distribution and modification are not covered by this License they are outside its scope The act of running a program using the Library is not restricted and output from such a program is covered only if its contents constitute a work based on the Library independent of the use of the Library in a tool for writing it Whether that is true depends on what the Library does and what the program that uses t
246. any form software or printed matter contains proprietary information that is the exclusive property of Oracle Your access to and use of this material is subject to the terms and conditions of your Oracle Software License and Service Agreement which has been executed and with which you agree to comply This document and information contained herein may not be disclosed copied reproduced or distributed to anyone outside Oracle without prior written consent of Oracle or as specifically provided below This document is not part of your license agreement nor can it be incorporated into any contractual agreement with Oracle or its subsidiaries or affiliates This documentation is NOT distributed under a GPL license Use of this documentation is subject to the following terms Legal Notices You may create a printed copy of this documentation solely for your own personal use Conversion to other formats is allowed as long as the actual content is not altered or edited in any way You shall not publish or distribute this documentation in any form or on any media except if you distribute the documentation in a manner similar to how Oracle disseminates it that is electronically for download on a Web site with the software or on a CD ROM or similar medium provided however that the documentation is disseminated together with the software on the same medium Any other use such as any dissemination of printed copies or use of this documentation in wh
247. arch for running servers on a host e Access online or offline servers mysqluserclone Clone a user account to the same or different server e Show user grants mysqluc Command line client for running MySQL Utilities e Allows a persistent connection to a MySQL Server e Tab completion for utility names and options Allows calling the commands with shorter names such as using serverinfo instead of mysqlserverinfo e mut e Tests for all utilities e Similar to MTR e Comparative and value result support e Tests written as Python classes 14 4 2 mysqlauditadmin Allows users to perform maintenance action on the audit log This utility allow you to maintain the audit log allowing you to monitor the audit log file growth and control its rotation Rotation refers to the action of replacing the current audit log file by a new one for continuous use renaming with a timestamp extension and copying the previously used audit log file to a defined location This utility allows you to view and modify a subset of audit log control variables display the audit log file status perform on demand rotation of the log file and copy files to other locations These features enable you to easily monitor the audit log file growth and control its rotation automatically based on the defined file size threshold or manually by a on demand command The available actions include the following 1 copy This command copies the audit log specifie
248. arching it is necessary to anchor the expression to the beginning of the string if you want to match the beginning of the string To specify how to display output use one of the following values with the format 302 option grid default Display output in grid or table format like that of the mysql monitor e CsV Display output in comma separated values format tab Display output in tab separated format vertical Display output in single column format like that of the G command for the mysq1 monitor SQL Simple Patterns The simple patterns defined by the SQL standard consist of a string of characters with two characters that have special meaning percent matches zero or more characters and _ underscore matches exactly one character For example e mats Match any string that starts with mats e Skindahl Match any string containing the word kindahl 300 mysqlmetagrep Search Database Object Definitions Match any string consisting of one or more characters POSIX Regular Expressions POSIX regular expressions are more powerful than the simple patterns defined in the SQL standard A regular expression is a string of characters optionally containing characters with special meaning Match any character e A Match the beginning of a string Match the end of a string axy Match a x or y gt a f Match any character in the range a to f that is a b c d e or f axy
249. are are designed to take away your freedom to share and change it By contrast the GNU General Public Licenses are intended to guarantee your freedom to share and change free software to make sure the software is free for all its users This license the Lesser General Public License applies to some specially designated software packages typically libraries of the Free Software Foundation and other authors who decide to use it You can use it too but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case based on the explanations below When we speak of free software we are referring to freedom of use not price Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software and charge for this service if you wish that you receive source code or can get it if you want it that you can change the software and use pieces of it in new free programs and that you are informed that you can do these things To protect your rights we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it For example if you distribute copies of the library whether gratis or for a fee you must give the recipien
250. art from a binary log file Start replication from the first event in a specific master binary log file To do this use the master log file 307 option Start from a specific event Start replication from specific event coordinates specific binary log file and position To do this use the master log file 807 and master log pos 307 options mysqlreplicate accepts the following command line options help Display a help message and exit master lt master gt Connection information for the master server in the format lt user gt lt passwa gt lt host lt port lt socket gt or lt login path gt lt port gt lt socket gt master log file lt master_log_file gt Begin replication from the beginning of this master log file master log pos lt master_log_pos gt Begin replication from this position in the master log file This option is not valid unless master log file 807 is given pedantic p Fail if both servers do not have the same set of storage engines the same default storage engine and the same InnoDB storage engine rpl user lt replication_user gt The user and password for the replication user in the format lt user gt lt passworad gt or lt login path gt The default is rp1 rpl slave lt slave gt Connection information for the slave server in the format lt user gt lt passwa gt lt host gt lt port gt lt socket gt or lt logi
251. as the default schema by right clicking the schema and selecting the Set As Default Schema menu item This executes a USE schema_name statement so that subsequent statements without schema qualifiers are executed against this schema This setting applies only to the query session To set a default schema for multiple MySQL Workbench sessions you must set the default schema for the stored connection From the Home screen click Manage Connections then in the Manage DB Connection dialog set the desired default schema on the Parameters tab A useful feature that was introduced in MySQL Workbench 5 2 9 is the ability to rapidly enter table view or column names into the SQL Statement area Double clicking a table view or column name in the schemata explorer inserts the name into the SQL Query area This reduces typing significantly when entering SQL statements containing references to several tables views or columns 80 Sidebar The Object Browser also features a context menu which can be displayed by right clicking an object For example right clicking a table displays the following menu items Select Rows Limit 1000 Pulls up to 1000 rows of table data from the live server into a Results tabsheet Edit Table Data Pulls table data from the live server into a named tabsheet and enables editing Data can be saved directly to the live server Copy to Clipboard There are various submenus each of which copies information to the clip
252. ase Execution Completed Successfully Fetch finished Review the displayed information to make sure that the connection did not generate errors then click Next The next page displays the schemata available on the server Click the check box or check boxes for any schemata you wish to process 130 Reverse Engineering Figure 8 21 Select Schemata Connection Options i I t t Engi Connect to DBMS Select Schemata g Select the Schemata to be Processed E dvdcollection E informationschema E mydb E mysql E test V world After you have selected the desired schemata click the Next button to continue The wizard then displays the tasks it carried out and summarizes the results of the operation 131 Reverse Engineering Figure 8 22 Retrieve Object Information Connection Options Retrieve Object Information Connect to DBMS Select Schemata The following tasks will now be executed Please monitor the execution Press Show Logs to see the execution logs Fetch Object Info amp Retrieve Objects from Selected Schemata Check Results Retrieval Completed Successfully Review the results before clicking Next to continue The next page is the Select Objects page It has a section for each object type present in the schema tables views routines and so forth This page is of special interest if you do not wish to import all the objects from the existing database It gives you the
253. ase a template consists of two files a template file which has a tp1 extension and a special file info xml The info xml file has important metadata about the template A third file is optional which is the preview image file This preview file provides a thumbnail image illustrating the appearance of the generated report One of the easiest ways to create a custom template is to make a copy of any existing template For example the following procedure describes how to make a custom template based on the Text Basic template 1 Navigate to the folder where the templates are stored Assuming that MySQL Workbench has been installed into the default location on Windows this would be C Program Files MySQL MySOL Workbench 5 0 SE modules data wb_model_reporting 2 Copy the Text_Basic tpl folder The copy can be given any suitable name for example Custom Basic tpl 3 Edit the info xml1 file to reflect your custom template The unedited file in this case is shown here lt xml version 1 0 gt 173 Creating a Custom Template lt data gt lt value type object struct name workbench model reporting TemplateInfo id BD6879ED 814C 4CA3 A8 69 98 64F83B88DF struct checksum 0xb46b524d gt lt value type string key description gt A basic TEXT report listing schemata and objects lt value gt lt value type string key name gt HIML Basic Frame Report lt value gt lt value type list content type objec
254. assword_dictionary_file i validate_password dictionary file amp Data Export ES Data Import Restore validate_password_length 8 validate_password required password length validate_password_mixed_case_count validate_password required number of uppercase lowercase characters F validate_password_number_count validate_password required number of digit characters E validate_password_policy_number validate_password password policy validate_password_special_char_count validate_password required number of special characters m Configuration File C PROGRA 1 MySQL ENTERP 1 Monitor mysql my ini As of MySQL Workbench 5 2 45 the Password Validation Plugin available as of MySQL Server 5 6 6 is supported in Workbench For information about what these settings mean see The Password Validation Plugin 10 7 3 The Accounts Tab The Accounts tab has two subtabs e Server Access Management e Schema Privileges Server Access Management enables you to list existing user accounts You can also add and delete accounts You can allocate administrative roles and also set account limits Schema Privileges enables you to set specific privileges on a user basis 189 The Accounts Tab Figure 10 7 Administrator Accounts Tab i T MYSQL Workbench sar Admin mysqld 127 0 0 1 X File Edit View Database Plugins Scripting Community Help Task and Object Browser
255. ate the target schema were executed No data has been migrated yet Review the creation report below for errors or warnings If there are any errors you can manually fix the scripts and dick Recreate Objects to retry SOURCE amp TARGET the schema creation or return to the Manual Editing page to correct them there and retry the target creation Y Source Selection Object Result SQL CREATE Script for Selected Object z j 1 CREATE TABLE IF NOT EXISTS HumanResources Departm Trae Sekon Preamble Script executed successfully 2 DepartmentID SMALLINT NOT NULL AUTO_INCREMENT COI Fetch Schemata List AdventureWorks HumanResour Script executed successfully 3 Name VARCHAR 100 NOT NULL COMMENT Name of the de Schemata Selection Mp HumanResources Department JScript executed successfully 4 GroupName VARCHAR i00 NOT NULL COMMENT Name of a ue SS lees L Humankesources Employes Script executed successfully 5 ModifiedDate TIMESTAMP NOT NULL DEFAULT CURRENT_TI 7 Humanresources mployeetdd G Script executed successfully gt OBJECT MIGRATION m HumanResources EmployeeDe g Script executed successfully w Object HumanResources EmployeePay Script executed successfully DEES HES T HumanResources JobCandidate Script executed successfully Y Migration C Humanresources Shift Script executed successfully Y Manual Editing re Postamble Script executed successfully Target Creation Options Create Schemata 4 PRIMARY K
256. ation topology consisting of a master and its slaves The utility is designed to make it easy to recover from planned maintenance of the master or from an event that takes the master offline unexpectedly The act of taking the master offline intentionally and switching control to another slave is called switchover In this case there is no loss of transactions as the master is locked and all slaves are 309 mysql rpladmin Administration utility for MySQL replication allowed to catch up to the master Once the slaves have read all events from the master the master is shutdown and control switched to a slave in this case called a candidate slave Recovering from the loss of a downed master is more traumatic and since there is no way to know what transactions the master may have failed to send the new master called a candidate slave must be the slave that is most up to date How this is determined depends on the version of the server see below However it can result in the loss of some transactions that were executed on the downed master but not sent The utility accepts a list of slaves to be considered the candidate slave If no slave is found to meet the requirements the operation will search the list of known slaves The utility also provides a number of useful commands for managing a replication topology including the following elect This command is available to only those servers supporting global transaction identifiers GT
257. aults file SERVER my cn Audit 2012 09 277T13 33 11 5 5 29 log x86_64 Linux To display the audit log entries of specific users use the following command shell gt mysqlauditgrep users testerl tester2 SERVER data audit log To display the audit log file statistics run the following command shell gt mysqlauditgrep users testerl tester2 SERVER data audit log 4 4 4 4 4 4 STATUS SERVER_ID NAME TIMESTAMP CONNECTION_ID HOST USER P 4 4 4 4 4 4 4 0 Connect 2012 09 2er 26250 9 localhost Foot t 0 Query 20120928E ZG 9 None root t 0 Pang 2012 09 2er 26250 9 None root t 0 Query 20120 2 eo ZG 0 9 None root t 0 Query 2012 SUIS 2 om ZG 0 9 None root t 0 Ping 2012 09 Zer 26250 9 None root t 0 Query Z2OILZ O9 Z VW il ik e262 S10 9 None root t 0 Onit 201270972 gm NEZ 6S0 9 None root t 0 Connect 2002 10 107 15255755 1 localhost tester2 r 0 Query AQI2 LO iLO Wil 355 3 55 i None tester2 r 0 Query AQVI2 LO LOTS s 563 10 1 None tester2 r 1046 Query AQI2 LO LOTS 357 326 1 None tester2 r 1046 Query AQI2 LO LOT 3573 36 i None tester2 r 0 Query AQI2 O10 Wis 3573 Sil i None tester2 r 0 Curt 202 10 10T Ss 37259 i None tester2 r 0 Connect AVI Z LO LOWiL 7s 35342 2 localhost tester2 r 0 Query AQV
258. automatically be created after a database is reverse engineered which will result in relationship lines being drawn in the EER diagram Algorithm The basic algorithm for this task would be as follows for each table in the schema for each column in the table 231 Tutorial Writing Plugins look for another table whose name and primary key name match the current column name if such a table is found add a foreign key referencing it As iterating the complete table list to find a match can be slow for models with a large number of tables it is necessary to optimize by pre computing all possible foreign key names in a given schema import grt def auto_create_fks schema fk_name_format table s_ pk s possible _fks create the list of possible foreign keys from the list of tables for table in schema tables if table primaryKey format_args table table name pk table primaryKey name fkname fk_name_format format_args possible _fks fkname table go through all tables in schema this time to find columns that may be a fk for table in schema tables for column in table columns if possible_fks has_key column name ref_table possible_fks column name if ref_table primaryKey formattedType column type continue fk table createForeignKey column name _fk fk referencedTable ref_table k columns append column fk referencedColumn append ref_table primaryKey print Created forei
259. ax is simply set VARNAME VALUE The user can see a list of all variables by entering the show variables command To use the values of these variables in utility commands the user must prefix the value with a For example server SERVER1 will substitute the value of the SERVER1 user defined variable when the utility is executed Note user defined variables have a session lifetime They are not saved from one execution to another of the users console User defined variables may also be set by passing them as arguments to the mysqluc command For example to set the SERVER1 variable and launch the console the user can launch the console using this command mysqluc SERVER1 root localhost The user can provide any number of user defined variables but they must contain a value and no spaces around the character Once the console is launched the user can see all variables using the show variables command OPTIONS e version show program s version number and exit e help 330 mysqluc Command line client for running MySQL Utilities NOTES show the program s help page e verbose vV control how much information is displayed For example v verbose vv more verbose vvv debug e quiet suppress all informational messages e execute lt commandss gt e lt commands gt Execute commands and exit Multiple commands are separated with semi colons Note some platforms may require double
260. ay the audit log entries of specific event types use the following command shell gt mysqlauditgrep event type Ping Connect SERVER data audit log 4 4 4 4 4 4 4 STATUS NAME TIMESTAMP CONNECTION_ID HOST USER PRIV_USER TP 4 4 4 4 4 0 Connect AQI2 O9 27TISe33339 7 localhost root root 127 0 0 Ping 20 IZ 0S 27 Ti 2232239 7 None None None None 0 Ping 20012 VSo27 Tiss 32239 y None None None None 0 Ping 20 IZ VS 27 Ties 32239 7 None None None None 0 Ping 2002 So27T1 3232239 a None None None None 0 Connect AQI2Z O9 2 7 TIS e33339 8 loeellinosic root root 27 0 0 Ping 202 So27 T1323 2239 8 None None None None 0 Ping 2002 VS 27 Tiss 32 239 8 None None None None 0 Ping 20 2 0S 27 Tiss A 7 None None None None 0 Connect AQI2 O9 29 Will s 26850 9 loa llinosic root tester 27 0 0 Ping 201 2 09 26T 26250 9 None None None None 0 Ping 201 2 09 28T 26250 9 None None None None 0 Connect 2QI2 O9 2 0 2O50 0 localhost root root 27 0 0 Ping 201 2 09 28T 26250 0 None None None None 0 Ping 2012 09 267 26250 0 None None None None 0 Ping 201 2 0S 26T 26250 0 None None None None 0 Ping 20122509 28 TIME 26250 0 None None None None 0 Ping 2012 08 28 Tiils2e250 0 None None None None 0 Connect AQI2Z 1O WO WIS 35S 355 1 localhost tes
261. b enables you to edit the my ini or my cn configuration file by selecting check boxes and other GUI controls This tab also features a number of subtabs which provide access to various sub sections within the configuration file The subtabs are e General e MyISAM e InnoDB e Performance e Log Files e Replication e Networking 187 The Configuration Tab e Security Advanced General Tab Figure 10 5 Administrator Configuration General Tab Admin mysqld localhost X MANAGEMENT Server Status B startup Shutdown E Status and System Variables A Server Logs CONFIGURATION SECURITY Users and Privileges DATA EXPORT RESTORE amp Data Export amp Data Import Restore WB Admin Opened _Fna_ Replication InnoDB MyISAM Performance Security Advanced have_rtree_keys have_ssl have_symlink profiling profiling_history_size storage_engine Memory usage binlog_cache_size host_cache_size query_alloc_block_size v sort_buffer_size Availability of the zlib compression library Availability of the cryptQ system call Whether mysqld supports dynamic loading of plugins Whether mysqld supports spatial data types Whether mysqld supports SSL connections Whether statement profiling capability is available Whether mysqld support
262. base e tab Input is formatted in tab separated format e vertical Display output in single column format like that of the G command for the mysq1 monitor To indicate that input in csv or tab format does not contain column headers specify the no headers 281 option To turn off all feedback information specify the quiet 281 option By default the utility creates each table on the destination server using the same storage engine as the original table To override this and specify the storage engine to use for all tables created on the destination server use the new storage engine 281 option If the destination server supports the new engine all tables use that engine To specify the storage engine to use for tables for which the destination server does not support the original storage engine on the source server use the default storage engine 280 option The new storage engine 281 option takes precedence over default storage engine 280 if both are given If the new storage engine 281 or default storage engine 280 option is given and the destination server does not support the specified storage engine a warning is issued and the server s default storage engine setting is used instead You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to access all objects in the operation For details see NOTES If you attempt to imp
263. be exported does not contain only InnoDB tables and you want to ensure data integrity of the exported data by locking the tables during the read step add a locking lock all 275 option to the command mysqldbexport server root pass localhost export DATA bulk insert util_test locking lock all Source on localhost connected USE weil test Exporting data from util_test Data for table util test tl INSERT INTO util_test t1 VALUES 01 Test Basic database example 02 Test Basic database example 03 Test Basic database example 04 Test Basic database example 05 Test Basic database example 06 Test Basic database example 277 mysqldbexport Export Object Definitions or Data from a Database 07 Test Basic database example Data for table util_test t2 NSERT INTO util_test t2 VALUES 11 Test Basic database example 12 Test Basic database example 13 Test Basic database example Data for table util test 42 NSERT INTO util_test t3 VALUES Gl Vale este fEkeys 5 27 ViILS este Ekeys G Wie test tevin Data for table util_test t4 NSERT INTO util_test t4 VALUES 2p 2 z doner To export a database and include the replication commands to use the current server as the master for example to start a new slave using the current server as the master use the following command mysqldbexport server root localhost 3311 uti
264. be specified as any unambiguous prefix of a valid value For example format g 281 specifies the grid format An error occurs if a prefix matches more than one valid value When importing data and including the GTID commands you may encounter an error similar to GTID_PURGED can only be set when GTID_EXECUTED is empty This occurs because the destination server is not in a clean replication state To aleviate this problem you can issue a RESET MASTER command on the destination prior to executing the import The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To import the metadata from the ut il_test database to the server on the local host using a file in CSV format use this command U mysqldbimport server root localhost import definitions format csv data csv Source on localhost connected Importing definitions from data csv done Similarly to import the data from the ut i1_test database to the server on the local host importing the data using bulk insert statements use this command ny mysqldbimport server root localhost import data bulk inserl format csyv data csy Source on localhost connected Impo
265. board e Name short Copies the table name e Name long Copies the qualified table name in the form schema table e Column Names Copies qualified column names the form table column1 table s Column2 ca ss Select All Statement Copies a statement to select all columns in this form SELECT Beale k eolunniir table Fi ecolunni2 FROM schema table e Insert Statement Copies an INSERT statement to insert all columns e Update Statement Copies an UPDATE statement to update all columns e Delete Statement Copies a DELETE statement in the form DELETE FROM world country WHERE lt where_condition gt Send to SQL Editor Provides functionality similar to Copy to Clipboard However this item inserts the SQL code directly into the SQL Query panel where it can be edited further as required Alter Table Displays the table editor loaded with the details of the table Create Table Launches a dialog to enable you to create a new table Drop Table Drops the table All data in the table will be lost if this operation is carried out Refresh All Refreshes all schemata in the explorer by resynchronizing with the server Right clicking an empty area inside the object browser displays the following menu items Create Schema Enables you to create a new schema on the connected server You can apply your changes to synchronize with the live server by clicking the Apply button Refresh All Synchron
266. c design capabilities of MySQL Workbench is touched upon in Section 8 8 3 Basic Modeling Both these tutorials show the database design capabilities of MySQL Workbench Importing an SQL data definition script is probably the quickest way to familiarize yourself with MySQL Workbench this tutorial makes use of the sakila database and emphasizes the use of MySQL Workbench as a documentation tool Examples taken from the sakila database are used throughout the documentation so doing this tutorial can be very helpful in understanding MySQL Workbench 8 8 1 Importing a Data Definition SQL Script For this tutorial use the sakila database script which you can find by visiting the http dev mysql com doc page selecting the Other Docs tab and looking in the Example Databases section 156 Importing a Data Definition SQL Script After downloading the file extract it to a convenient location Open MySQL Workbench and find the Reverse Engineer MySQL Create Script menu item by first choosing File and then Import Find and import the sakila schema sql file This is the script that contains the data definition statements for the sakila database The file filter for the file open dialog window defaults to sql so you should be able to view only files with the sqi extension If the file was successfully imported the application s status bar reads Import MySQL Create Script done To view the newly imported script expand the Physical S
267. can also be adjusted for each ALTER TABLE operation Options include None Shared and Exclusive see the online DDL documentation for more information Added in MySQL Workbench 5 2 46 Query Results Limit Rows Queries can sometimes return an excessive number of rows which can heavily load the connection and take time to display in MySQL Workbench To prevent this you can set a more moderate value here This limit is defined by the Limit Rows Count option Limit Rows Count Specify the maximum number of result rows to return Defaults to 1000 Max Field Value Length to Display To avoid display problems due to excessive field length it is possible to set the maximum field length to display in bytes Defaults to 256 Treat BINARY VARBINARY as non binary character string Binary byte string values are not displayed by default in the results grid but are instead marked as BLOB values These can then be viewed or edited with the BLOB editor Nonbinary character string values are displayed in the results grid and can be edited in the grid cell or using the BLOB editor If this option is turned on data truncation may result Binary byte string values may contain null bytes as part of their valid data whereas for nonbinary character strings a null byte terminates the string Confirm Data Changes In the SQL Editor if you edit table data and then click the Applying changes to data button MySQL Workbench launches a wizard
268. categories are User Scripts User Modules and User Libraries 230 Tutorial Writing Plugins The Globals Tab At the top of the window is a list that is used to select the starting point or root of the GRT Globals tree displayed beneath it By default this starting point is the root of the tree that is You can expand or collapse the GRT Globals tree as desired The GRT Globals tree is the structure in which MySQL Workbench stores document data Clicking any item results in its name and value being displayed in the panel below the tree The Classes Tab A class is a user defined data type formed by combining primitive data types integers doubles strings dicts lists and objects This tab shows the definitions of the classes used by the objects in the Modules tab Clicking a class causes a brief description of the class to be displayed in a panel below the classes explorer When the Classes tab is selected the list displays the following items Group by Name Group by the object name Group by Hierarchy Group by inheritance e Group by Package Group by functionality The default view for this tab is Group By Name This view shows all the different objects arranged alphabetically Click the icon or double click a package to show the properties of the struct If you switch to the hierarchical view you will see Grt Ob ject the parent object from which all other objects are derived The Modules Tab The Modu
269. cations folder You may then Eject and throw away this disk image L MYSQL Workbench Drag the MySQL Workbench icon onto the Applications icon as instructed MySQL Workbench is now installed You can now launch MySQL Workbench from the Applications folder 4 3 8 Launching MySQL Workbench on Mac OS X To launch MySQL Workbench on Mac OS X open the Applications folder in the Finder then double click MySQL Workbench It is also possible to start MySQL Workbench from the command line shell gt open MySQLWorkbench app model_file A model file must be specified 24 Uninstalling MySQL Workbench on Mac OS X 4 3 9 Uninstalling MySQL Workbench on Mac OS X To uninstall MySQL Workbench for Mac OS X locate MySQL Workbench in the Applications folder right click and select Move to Trash 25 26 Chapter 5 Getting Started Tutorial Table of Contents 5 1 Administering a MySQL Server cccccecececeeeeeeeeeee tees ae eaeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeeeeeeseeeeaeaaeaees 27 5 2 Creating a M de l ea aar kde neadea cc liad ar aa enaka eaae cidade EEEa o hahaaa beaten cats raaa AEE 39 5 3 Adding Data to Your Database argie ivii eraa n REE NANE AESA KA AA EEE AVEREA NT A 44 This tutorial provides a quick hands on introduction to using MySQL Workbench for beginners If you have used MySQL Workbench before you can safely skip this tutorial This tutorial uses a locally installed MySQL Server If you on
270. cause MySQL Workbench appends id to the table name as the default for the initial field Change the name to movie_id and keep the Datatype as INT Then be sure PK PRIMARY KEY NN NOT NULL and Al AUTO_INCREMENT are all checked Add two additional columns using the same method as described above Column Name Data Type Column Properties movie_title VARCHAR 45 NN release_date DATE YYYY MM DD None 41 Creating a Model Figure 5 15 Getting Started Tutorial Columns MySQL Model x File Edit view Arange Medel Database Plugins Scripting Community Help I E E ir ee ea rescregteon Edar gt Aad Dagom Y Physical Schemata 8 mydb 8 dvd_collection Tables VARCHAR 45S release_date oae DECMAL 10 Bec oecmao User Types E L d Now you can obtain a visual representation of this schema so far From the main menu select Model Create Diagram from Catalog Objects The EER Diagram will be created and displayed Figure 5 16 Getting Started Tutorial EER Diagram _ Fse Esr view Arrange Medel Database Fisgias Scripting Commenty Help ET AAS Brds Eye Dagan E O Rovne Grows 3 dvd_cotection p Tables Views PF aeons ole B Rovtine Grows P movie jd NT 3 movie tte VARCHAR 45 release_date DATE gt emery 3T xl el cl i a 42 Creating a Model 10 1 _ 12 13 14 15 16 17
271. ces Index Name Columns Primary Unique Type Kind Comment PRIMARY Yes No PRIMARY DDL script CREATE TABLE IF NOT EXISTS world city ID INT 11 NOT NULL AUTO_INCREMENT Name CHAR 35 NOT NULL DEFAULT CountryCode CHAR 3 NOT NULL DEFAULT District CHAR Z0 NOT NULL DEFAULT Population INT 11 NOT NULL DEFAULT O PRIMARY KEY ID ENGINE MyISAM AUTO_INCREMENT 4080 s DUBAIT CUANACTUN CPT Intini Done If you wish to create custom templates please refer to Section 8 12 Customizing DBDoc Model Reporting Templates 8 12 Customizing DBDoc Model Reporting Templates This section provides an overview of creating and modifying DBDoc Model Reporting templates as used by MySQL Workbench The MySQL Workbench DBDoc Model Reporting system is based on the Google Template System This discussion does not attempt to explain the Google Template System in detail For a useful overview of how the Google Template System works see the Google document How To Use the Google Template System 166 Customizing DBDoc Model Reporting Templates These text files are processed by the template system built into MySQL Workbench and the markers replaced by actual data The output files are then generated It is these output files typically HTML or text that are then viewed by the user Markers can be of six types Template Include Comment Set delimiter Pragma Variable Section start and
272. ch interval The utility permits the user to specify an external script to execute before and after the switchover and failover commands The user can specify these with the xec before 292 and exec after 292 options The return code of the script is used to determine success thus each script must report 0 Success to be considered successful If a script returns a value other than 0 the result code is presented in an error message The utility also permits the user to specify a script to be used for detecting a downed master or an application level event to trigger failover This can be specified using the exec fail check 292 option The return code for the script is used to invoke failover A return code of 0 indicates failover should not take place A return code other than 0 indicates failover should take place This is checked at the start of each interval if a script is supplied The timeout option is not used in this case and the script is run once at the start of each interval The utility permits the user to log all actions taken during the commands The 10g 293 option requires a valid path and file name of the file to use for logging operations The log is active only when this option is specified The option 1og age 293 specifies the age in days that log entries are kept The default is seven 7 days Older entries are automatically deleted from the log file but only if the log 293 option is specified The
273. chemata section by double clicking the arrow on the left of the Physical Schemata title bar Select the tab labeled sakila You may also wish to remove the default schema tab mydb Select this tab then click the button on the upper right in the Physical Schemata panel To view all the objects in the sakila schema you may need to expand the Physical Schemata window Move the mouse pointer anywhere over the gray area that defines the lower edge of the Physical Schemata window Hold down the right mouse button and move the mouse to adjust the size of the window After you have expanded the window all the objects in the sakila database should be visible Tables appear at the top followed by views and then routines There are no routine groups in this schema but you should see the Routine Groups section and an Add Group icon For a complete description of importing a MySQL create script see Section 8 7 9 1 Reverse Engineering Using a Create Script 8 8 1 1 Adding an EER Diagram To create an EER diagram for the sakila database first add an EER diagram by double clicking the Add Diagram icon in the EER Diagrams panel to create and open anew EER Diagram editor The EER Diagram canvas is where object modeling takes place To add a table to the canvas select the Catalog tab in the middle panel on the right side of the application to display any schemata that appear in the MySQL Model tab Find the sakila schema and expand the
274. ches the Manage DB Connections wizard This wizard enables you to create a new connection Note that the wizard when launched from here does not display existing connections it only enables you to create a new connection To read more about creating and managing connections see Section 7 6 Manage DB Connections Dialog 7 3 Edit Table Data Clicking this action item launches the Edit Table Data wizard which enables you to edit table data This is a two stage wizard The first stage enables you to select a Stored Connection The second stage enables you to select the Schema and Table you want to edit After the wizard is completed an SQL Editor tab is launched which displays a data grid that enables you to interactively edit table data as required To read more about the SQL Editor see Section 7 7 SQL Editor 7 4 Edit SQL Script Clicking this action item launches the Edit SQL Script wizard This is a two stage wizard The first stage enables you to select a Stored Connection The second stage enables you to select an SQL Script file and optionally have the script executed after it is opened After the wizard is completed an SQL Editor tab will be launched with the script displayed If you selected to run the script MySQL Workbench runs the script and displays the results Working with large data sets The Edit SQL Script wizard is not well suited for executing large dump files and instead the Server Administra
275. cking this action item launches a file browser You can then select the model file you wish to load A new MySQL Model tab will then be created and your model displayed If you have already created one or more model files each will appear in this panel as an icon Double clicking the item of the model you wish to load creates a new MySQL Model tab and displays your model If you already have created a connection to a database it will appear in this panel as an icon Double clicking the icon directly launches an SQL Editor tab and connects you to the database as defined by the connection To read more about modeling see Section 8 5 Model Editor 8 2 Create New EER Model Clicking this action item launches a new MySQL Model tab with a blank model ready for you to work on To read more about modeling see Section 8 5 Model Editor 8 3 Create EER Model from Existing Database This action item enables you to create an EER Model from an existing live database Clicking this action item launches the Reverse Engineer Database This is a multi stage wizard that enables you to select a connection to a live server and select the schema and objects you wish to reverse engineer into your new model This is a convenient way to see how an existing database is structured For further information about reverse engineering see Section 8 7 9 2 Reverse Engineering a Live Database 8 4 Create EER Model from SQL Script This
276. color chart list Use this list to select the color accent for the new text object The color of your text object can be changed later using the Properties palette Create a text object by clicking anywhere on the EER Diagram canvas This creates a new text object with the default name text 1 To revert to the default mouse pointer click the arrow icon at the top of the vertical toolbar Right clicking a text object opens a pop up menu These menu options are identical to the options for other objects However since a text object is not a database object there is no confirmation dialog box when you delete a text object 8 7 7 2 The Text Object Editor To invoke the text object editor double click a text object on the EER Diagram canvas This opens the editor docked at the bottom of the application Double clicking the text object table undocks the editor 126 Creating Images 8 7 7 2 1 Double click the title bar to redock it Any number of text objects may be open at the same time Each additional text objects appears as a tab at the top of the text editor Use the editor to change the name of a text object or its contents Modifying a Text Object Using the Properties Palette When you select a text object on the EER Diagram canvas its properties are displayed in the Properties palette Most of the properties accessible from the Properties palette apply to the appearance of a view on the EER Diagram canvas For a list of pro
277. con in the MySQL Model area to create EER diagrams When you add an EER diagram a new tab appears below the toolbar Use this tab to navigate to the newly created EER diagram For further discussion of EER Diagrams see Section 8 6 EER Diagram Editor 8 5 4 The Physical Schemata Panel The Physical Schemata panel of the MySQL Model page shows the active schemata and the objects that they contain Expand and contract the Physical Schemata section by double clicking the arrow on the left of the Physical Schemata title bar When the Physical Schemata section is expanded it displays all currently loaded schemata Each schema shows as a tab To select a specific schema click its tab When MySQL Workbench is first opened a default schema mydb is selected You can start working with this schema or you can load a new MySQL Workbench Model file models use the mwb extension There are a variety of ways to add schema to the Physical Schemata panel You can open an MWB file reverse engineer a MySQL create script or if you are using a commercial version of MySQL Workbench you can reverse engineer a database by connecting to a MySQL server You can also add a new schema by clicking the button on the top right of the Physical Schemata panel To remove a schema click its tab and use the button found to the immediate left of the button To the left of these buttons are three buttons that control how database object icons are displayed
278. ction will not be propagated to the DDL It is just a logical connection drawn on a diagram This is used for example when drawing My I sA tables with a visual relationship but with no foreign keys 118 Creating Views name The name used to identify the connection on the EER Diagram canvas Note that this is not the name of the foreign key referredMandatory Whether the referred entity is mandatory e startCaptionxOffs The start of the X offset of the caption e startCaptionyoOffs The start of the Y offset of the caption In most cases you can change the properties of a relationship using the relationship editor rather than the Properties palette If you make a relationship invisible by hiding it using the relationship editor s Visibility Settings and then close the relationship editor you will no longer be able to select the relationship to bring up its relationship editor To make the relationship visible again you must expand the table object relating to the relationship in the Layers palette and select the relationship object To edit the selected object right click it then select Edit Object You can then set the Visibility Settings to Fully Visible The relationship will then be visible in the EER Diagram window 8 7 3 Creating Views You can add views to a database either from the Physical Schemata section of the MySQL Model page or from the EER Diagram 8 7 3 1 Adding Views to the Physical Schemata To ad
279. d a view double clicking the Add View icon in the Physical Schemata section of the MySQL Model page The default name of the view is view1 If a view with this name already exists the new view is named view2 Adding a new view automatically opens the view editor docked at the bottom of the application For information about using the view editor see Section 8 7 3 3 The View Editor Right clicking a view opens a pop up menu with the following items e Cut view_name As of MySQL Workbench 5 2 45 the view_name is only cut from the EER canvas Before it was also removed from the schema e Copy view_name e Paste e Edit View e Edit in New Window e Copy SQL to Clipboard e Delete view_name deletes from both the EER canvas and schema e Remove view_name deletes from the EER canvas but not the schema This option exists as of MySQL Workbench 5 2 45 If the table editor is not open the Edit View item opens it If it is already open the selected table replaces the previous one Edit in New Window opens a new view editor tab The cut and copy items are useful for copying views between different schemata Copy SQL to Clipboard copies the CREATE VIEW statement to the clipboard 119 Creating Views Warning O Use the Delete view_name item to remove a view from the database There will be no confirmation dialog box Any views added to the Physical Schemata section also show up in the Catalog
280. d by audit log name 251 to the destination path specified by copy to 251 The remote login 251 option can be used to copy log files from a remote location Note the destination path must be locally accessible by the current user 2 policy The policy command is used to change the audit logging policy The accepted values are the following which are set using the value 252 option 250 mysqlauditadmin Allows users to perform maintenance action on the audit log OPTIONS Note R The server 251 option is also required to execute this command ALL log all events NONE log nothing LOGINS only log login events QUERIES only log query events DEFAULT sets the default log policy rotate_on_size This command sets the file size threshold for automatic rotation of the audit log the audit_log_rotate_on_size variable The value is set using the value 252 option and must be in the range 0 4294967295 This command also requires the server 251 option to be specified Note if the variable is set with a value that is not a multiple of 4096 then it is truncated to the nearest multiple rotate This command is used to perform an on demand audit log rotation and only requires the server 251 option to be passed Note this command has no effect if the audit log file size is smaller than 4096 which is the minimum value allowed that is greater than 0 for the audit_log_rotate_on_size var
281. d lays it out in nicely indented fashion UPCASE Keywords Converts keywords to uppercase in the currently selected query in the query tab lowercase Keywords Converts keywords to lowercase in the currently selected query in the query tab Indent Lines Indents the lines selected in the query tab Unindent Lines Unindents the lines selected in the query tab Un Comment Selection Comments the lines currently selected in the query tab If the lines are already commented this operation removes the comments Auto complete Triggers the auto completion wizard This is enabled and triggered by default and can be disabled with Preferences SQL Editor Automatically Start Code Completion Auto completion will list functions keywords schema names table names and column names Note R This feature was added in MySQL Workbench 5 2 41 7 7 2 Toolbar The toolbar features buttons in two locations in the main toolbar and within the SQL Editor itself The SQL Editor buttons are described below 72 SQL Query Panel Figure 7 6 SQL Editor Toolbar Gul FfacB Bviawt From left to right these buttons are Open a SQL Script File Loads a saved SQL script to be ready for execution The script is displayed in the SQL Query area Save SQL Script to File Saves the currently loaded SQL script to a file specified by the user Execute SQL Script Executes the selected portion of the query or the entire query if nothing is
282. d master is performed as follows If the connection to the master is lost wait ping 313 seconds and check again If the master connection is lost and the master cannot be pinged or reconnected the failover event occurs For all commands that require specifying multiple servers the options require a comma separated list of connection parameters in the following form where the password port and socket are optional SSS SS passwd Cs mose he pore SS soeken a Eor SG ocima peen ee pere S S lt Seeker The utility permits users to discover slaves connected to the master In order to use the discover slaves feature all slaves must use the report host and report port startup variables to specify the correct hostname and ip port of the slave If these are missing or report the incorrect information the slaves health may not be reported correctly or the slave may not be listed at all The discover slaves feature ignores any slaves it cannot connect to or with the IO thread stopped i e not connected to the master The utility permits the user to demote a master to a slave during the switchover operation The demote master 312 option tells the utility to once the new master is established make the old master a slave of the new master This permits rotation of the master role among a set of servers The utility permits the user to specify an external script to execute before and after the switchover and fail
283. d to as the destination U mysqldbcopy source root localhost 3311 destination root localhost 3312 test123 rpl slave rpl user rpl Source on localhost connected Destination on localhost connected Source on localhost connected Stopping slave Copying database test123 Copying DTABLAMEeSstl2 se cll Copying data for TABLE test123 tl Connecting to the current server s master Starting slave done 14 4 6 mysqldbexport Export Object Definitions or Data from a Database This utility exports metadata object definitions or data or both from one or more databases By default the export includes only definitions mysqldbexport differs from mysqldump in that it can produce output in a variety of formats to make your data extraction transport much easier It permits you to export your data in the format most suitable to an external tool another MySQL server or other use without the need to reformat the data To exclude specific objects by name use the exclude 274 option with a name in db obj format or you can supply a search pattern For example exclude db1 trig1 274 excludes the single trigger and exclude trig_ 274 excludes all objects from all databases having a name that begins with trig and has a following character To skip objects by type use the skip 275 option with a list of the objects to skip This enables you to extract a particular set of objects say for
284. databases such as PostgreSQL and DB2 In Windows and Mac OS X it is included with Workbench In Linux binaries provided by Oracle also include pyodbc If you re using a self compiled binary make sure you have the latest version and that it is compiled against the ODBC manager library that you chose whether it is iODBC or unixODBC As of version 3 0 6 pyodbc will compile against unixODBC by default If you are compiling against iODBC then you must perform the following steps 1 Install the development files for iODBC Usually you just need to install the 1 ibiodbc devel or libiodbc2 dev package provided by your distribution 2 Inthe pyodbc source directory edit the setup py file and around line 157 replace the following line settings libraries append odbc with settings libraries append iodbc 200 ODBC Drivers 3 Execute the following command as the root user CFLAGS iodbc config cflags LDFLAGS iodbc config libs python setup py install 11 1 2 ODBC Drivers For each RDBMS you need its corresponding ODBC driver which must also be installed on the same machine that MySQL Workbench is running on This driver is usually provided by the RDBMS manufacturer but in some cases they can also be provided by third party vendors or open source projects Operating systems usually provide a graphical interface to help set up ODBC drivers and data sources Use that to install the driver i e make the ODBC Manager s
285. de range of software distributed through that system in reliance on consistent application of that system it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License 12 If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries so that distribution is permitted only in or among countries not thus excluded In such case this License incorporates the limitation as if written in the body of this License 13 The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present version but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later version you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number you
286. de the registration check by using the force 292 option Mixing IP and hostnames is not recommended The replication specific utilities will attempt to compare hostnames and IP addresses as aliases for checking slave connectivity to the master However if your installation does not support reverse name lookup the comparison could fail Without the ability to do a reverse name lookup the replication utilities could report a false negative that the slave is not connected to the master For example if you setup replication using MASTER_HOST ubuntu net on the slave and later connect to the slave with mysqlrplcheck and have the master specified as master 192 168 0 6 using the valid IP address for ubuntu net you must have the ability to do a reverse name lookup to compare the IP 192 168 0 6 and the hostname ubuntu net to determine if they are the same machine Similarly in order to avoid issues mixing local IP 127 0 0 1 with localhost all the addresses 127 0 0 1 will be internally converted to localhost by the utility Nevertheless It is best to use the actual hostname of the master when connecting or setting up replication The utility will check to see if the slaves are using the option master info repository TABLE If they are not the utility will stop with an error The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths
287. de this and specify the storage engine to use for all tables created on the destination server use the new storage engine 269 option If the destination server supports the new engine all tables use that engine To specify the storage engine to use for tables for which the destination server does not support the original storage engine on the source server use the default storage engine 269 option The new storage engine 269 option takes precedence over default storage engine 269 if both are given If the new storage engine 269 or default storage engine 269 option is given and the destination server does not support the specified storage engine a warning is issued and the server s default storage engine setting is used instead By default the operation uses a consistent snapshot to read the source databases To change the locking mode use the 1locking 269 option with a locking type value Use a value of no locks to turn off locking altogether or lock all to use only table locks The default value is snapshot Additionally the utility uses WRITE locks to lock the destination tables during the copy You can include replication statements for copying data among a master and slave or between slaves The rp1 269 option permits you to select from the following replication statements to include in the export master Include the CHANGE MASTER statement to start a new slave with the current server acting as t
288. der to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To show only the disk space usage for the employees and test databases in grid format the default use this command mysqldiskusage server root localhost employees test Source on localhost connected Database totals 4 4 db_name ioral test 4 096 Total database disk usage 205 983 744 bytes or 196 00 MB done To see all disk usage for the server in CSV format use this command mysqldiskusage server root localhost format csv a vv Source on localhost connected Database totals db_name db_dir_size data_size misc_files total case ll 0 0 0 0 dos 0 00 0 ao 0500p 0 dol 0 00 0 backupmeesite NOAM ini 1 S0 3 OAT employees 242519463 205979648 242519463 448499111 mysql 867211 657669 191720 649389 t1 9849 1024 8825 9849 test 56162 4096 52066 56162 wba l testa 19625 2048 Lisi 19625 ied Tessie lo LISA 0 LISA Wy well test ic 19623 2048 17575 19623 Total database disk usage 449 490 516 bytes or 428 00 MB Log information The general_log is turned off on the server The slow_query_log is turned off on the server binary log information Current binary log file mysql bin 000076 log
289. dialog The Model Overview panel has several sections e EER Diagrams e Physical Schemata 85 Modeling Menus e Schema Privileges SQL Scripts e Model Notes For each of these sections add objects to a project by clicking the appropriate add object icon You may also rename edit cut copy or delete objects on this page by right clicking to open a pop up menu The following sections further discuss the MySQL Model page 8 5 1 Modeling Menus Some menu items are not available in the OSS version of this application and are available only in the Standard Edition This is indicated where applicable 8 5 1 1 The File Menu Use the File menu to open a project begin a new project or save a project Choosing New Model opens the default schema mydb Choosing Open Model opens a file dialog box with the default file type set to MySQL Workbench Models mwb extension To display a list of recently opened MWB files choose the Open Recent menu item The keyboard shortcut to create a new project is Control N and the command to open an existing project is Control O To close the currently active MySQL Model or EER Diagram tab use the Close Tab menu item You can also do this from the keyboard by pressing Control W To reopen the MySQL Model tab see Section 8 5 1 3 The View Menu To reopen an EER Diagram tab double click the EER Diagram icon inthe EER Diagrams section of the MySQL Model page Use the Save Model o
290. do so subject to the following conditions The above copyright notice and this permission notice hall be included in all copies or substantial portions the Software on HE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF NY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED O THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A ARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT HALL THE DANIEL VEILLARD BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE PH gp law tel Except as contained in this notice the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale use or other dealings in this Software without prior written authorization from him 359 Libzip License A 18 Libzip License The following software may be included in this product ia ss Copyright C 1999 2008 Dieter Baron and Thomas Klausner The authors can be contacted at lt libzip nih at gt Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions cs SING ites 1 Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer 2 Redistributions in binary form must reproduce the above copyright notice this
291. e Big Iron Server Type a name for the connection v sedate Ea Connection Method Standard TCP IP v Method to use to connect to the RDBMS Big Iron Server poe Se localhost Parameters Advanced Hostname 127 0 0 1 Port 3306 Name or IP address of the server host TCP IP port Username root Name of the user to connect with Password Store in Vault J Clear The user s password Default Schema The schema that will be used as default schema New l Delete l Duplicate Move Up Move Down Test Connection Click New to create a new connection Once created the connection can be selected from the Stored Connections list You can then set various parameters for the connection including the following Connection Name The name used to refer to this connection This connection can then be selected from a list in other wizards requiring a connection Connection Method The methods available are Standard TCP IP Local Socket Pipe and Standard TCP IP over SSH After you select a connection method the fields available in the Parameters tab and the Advanced tab of the dialog changes accordingly More details about these options and parameters are available in the following sections After all parameters have been set as required you can click the Test Connection button to test the connection to the live server After you are satisfied that the connection works as expected you can close the wizard by clicking the Close
292. e MySQLDoc MySQLBug Workbench PlanetMySQL Workbench Library Reporter Team Blog Forums Workspace SQL Development Data Modeling 0 Server Administration Connect to existing databases and run Create and manage models forward amp Configure your database server setup SQL Queries SQL scripts edit data and reverse engineer compare and user accounts browse status variables manage database objects synchronize schemas report and server logs p G Open Connection to Start Querying Open Existing EER Model ie Server Administration gt a te localhost Li sakila E mysqld2 localhost a 9 User root Host localhost 3306 Local Type Windows Sample Last modified Mon Sep 20 13 52 51 2010 ia New Connection F New Server Instance Ei Edit Table Data m Create New EER Model al Manage Import Export z gt Edit SQL Script Create EER Model From Existing Database Manage Security aj gs 6 Manage Connections E gt Create EER Model From SQL Script g Manage Server Instances u 6 1 Workbench Central Workbench Central enables you to keep up to date with MySQL Workbench news events and resources You can read the developer blogs find out what s new in the release access the forums check for updates and file a bug report Workbench Central includes the following facilities What s new A list of bug fixes and changes MySQL Doc Library Built in documentation MySQL Bug Reporter Links to the MySQL bug syst
293. e for MySQL Workbench 343 NET Flat TabControl License Section A 11 Glitz License Section A 12 GNU Lesser General Public License Version 2 1 February 1999 Section A 13 HtmlRenderer System Drawing Html Section A 14 iODBC License Section A 15 Libiconv License Section A 16 Libintl License Section A 17 Libxml2 License Section A 18 Libzip License Section A 19 Lua liblua License Section A 20 Paramiko License Section A 21 PCRE License Section A 22 Pixman License Section A 23 PyCrypto License Section A 24 PyODBC License Section A 25 Python License Section A 26 Scintilla License Section A 27 ScintillaNET License Section A 28 TinyXML License Section A 29 TreeViewAdv for NET License Section A 30 VSQLite License e Section A 31 zlib License A 1 NET Flat TabControl License The following software may be included in this product NET Flat TabControl Use of any of this software is governed by the terms of the license below It is free Public domain Oscar Londono A 2 ANTLR License The following software may be included in this product ANTLR This product was build using ANTLR which was provided to Oracle under the following terms Copyright c 2010 Terence Parr All rights reserved Redistribution and use in source and binar
294. e Executed Select Objects Review SQL Script SET OLD_UNIQUE_CHECKS UNIQUE_CHECKS UNIQUE_CHECKS 0 SET OLD_FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS 0 SET OLD_SQL_MODE SQL_MODE SQL_MODE TRADITIONAL CREATE SCHEMA IF NOT EXISTS dvd_collection USE dvd_collection Table dvd_collection movies CREATE TABLE IF NOT EXISTS dvd_collection movies movie_id INT NOT NULL AUTO_INCREMENT title VARCHAR 45 NOT NULL release_date DATE NULL PRIMARY KEY movie_id ENGINE InnoDB SET FOREIGN_KEY_CHECKS OLD_FOREIGN_KEY_CHECKS SET UNIQUE_CHECKS OLD_UNIQUE_CHECKS Save to File Copy to Clipboard 20 Select the connection you created earlier Big Iron Server Click Execute Check the messages for any errors then click Close to exit the wizard 21 Ensure that the script ran without error on the server then click Close As a simple test that the script worked launch the MySQL Command Line Client mysql Enter SHOW DATABASES and identify your schema Enter USE dvd_collection to select your schema Now enter SHOW TABLES Enter SELECT FROM movies this will return the empty set as you have not yet entered any data into your database Note that it is possible to use MySQL Workbench to carry out such checks and you will see how to do this later but the MySQL Command Line Client has been used here as you have probably used it previously
295. e REL data dictionary becomes active in this section REL_NAME Variable REL FOREIGN_KEYS The relationship name 172 Creating a Custom Template REL_PARENTTABLE Marker text Type Data Dictionary or Parent Corresponding data Dictionary REL_TYPE REL FOREIGN_KEYS The relationship type REL FOREIGN_KEYS The relationship parent table REL_CHILDTABLE REL FOREIGN_KEYS The relationship child table REL_CARD REL FOREIGN_KEYS The relationship cardinality FOREIGN_KEY_ID FOREIGN_KEYS REL SCHEMATA Foreign key ID Marks the start and end of a FOREIGN_KEYS section the FOREIGN_KEYS data dictionary becomes active in this section FK_DELETE_RULE FOREIGN_KEYS The foreign key delete rule FK_UPDATE_RULE FOREIGN_KEYS The foreign key update rule FK_MANDATORY TABLE_COMMENT_LISTING Section FOREIGN_KEYS Whether the foreign key is mandatory TABLES Marks the start and end of a TABLE_COMMENT LISTING section the TABLE COMMENT LISTING data dictionary becomes active in this section TABLE_COMMENT TABLE _ COMMENT LISTING The table comment DDL_LISTING TABLES Marks the start and end of a DDL LISTING section the DDL_LISTING data dictionary becomes active in this section DDL_SCRIPT DDL_LISTING Display the DDL script of the currently active entity for example SCHEMATA TABLES 8 12 2 Creating a Custom Template In the simplest c
296. e actual operations directly Let s do that now to clone the server The first thing you notice in examining the serverclone module is that it takes a number of parameters for the new server instance We supply those in a similar way as options parser add_option new data action store dest new_data type string help the full path to the location of the data directory for the new instance parser add_option new port action store dest new_port 243 Introduction to extending the MySQL Utilities type string default 3307 help the new port for the new instance default default parser add_option new id action store dest new_id type string default 2 help the server_id for the new instance default default from mysql utilities command import serverclone Ery res serverclone clone_server conn opt new_data opt new_port opt new_id root None False True except exception UtilError e print ERROR e errmsg sys exit As you can see the operation is very simple We just added a few options we needed like new data new port and new id much like mysqlserverclone and supplied some default values for the other parameters Next we need to copy the databases Once again we use the command module for mysql dbcopy to do all of the work for us First we need the connection parameters for the new instance This is provided in the form of a dictionary We
297. e annotated and marked as comments 284 mysqldiff Identify Differences Among Database Objects NOTES e verbose V Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit e width lt number gt Change the display width of the test report The default is 75 characters You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to access all objects to be compared The SQL transformation feature has these known limitations e When tables with partition differences are encountered the utility generates the ALTER TABLE statement for all other changes but prints a warning and omits the partition differences e If the transformation detects table options in the source table specified with the changes for 284 option that are not changed or do not exist in the target table the utility generates the ALTER TABLE statement for all other changes but prints a warning and omits the table option differences Rename for events is not supported This is because mysqidiff compares objects by name In this case depending on the direction of the diff the event is identified as needing to be added or a DROP EVENT statement is generated e Changes in the definer clause for events are not supported
298. e changelog entries because the integration of the manual happens at build time For the most up to date release changelog please refer to the online version instead C 1 MySQL Workbench Change History MySQL Workbench release notes are no longer published in the MySQL Workbench Manual Release notes for the changes in each release of MySQL Workbench are located at MySQL Workbench Release Notes C 2 MySQL Utilities Change History MySQL Utilities release notes are no longer published in the MySQL Workbench Manual Release notes for the changes in each release of MySQL Utilities are located at MySQL Utilities Release Notes 381 382
299. e ee aia ea aa inaa a anaana aa ai 125 8 7 Creating Text ObDj Cts i nnns isra euire eisteda cia yeneetstekac tee idedac tener ERA uae 126 8 7 8 Creating IMAGES cecceece ce ceeeee eect eee e ee ae aac teen ee ee ee ee aaa te dioni sede aaaateeseeeeseaaaaaaneeeeeees 127 8 7 9 Reverse Engineering s 2 02 drn nna sate Aine eivedes ie clan ede eevee 128 8 7 10 Forward Engineering ccccceeeeeeeeee ee eeeeee ee ee eee PREEN EE RUNEA EIRENE REEERE PREE RENS 137 8 8 Modeling Tutorials svrsim hice ivensabee teal E aA aa a ennacte ee 156 8 8 1 Importing a Data Definition SQL Script 1 2 0 ceeeeeeeeeeeee ee aeaeeeeeeeeeeeeeaeaaeaeeeees 156 8 8 2 Using the Default Schema ccceccccceeeeeeeeeee eee e ee aa ete eeeeeeeeeeaaaaaaneeeeeeeseaaaaaaneeeeeeees 158 8 8 3 Basic MOCelING 0 cece cece cece cece cee e eect erent eee aa ea eter ee ee ee ai aoa aaa aieeaa da 159 8 8 4 Documenting the sakila Database 0 cccccecececeeeeeeeeeeeee ee aaeeeeeeeeeeeeseaaaaeeeeeeeeeeeeaaa 160 B95 PRUNING BAE P A E E A E E T A 162 8 9 1 Printing OPtionS siversedeaiteieleig ead stadt lias aia TEE EE EAE A AE AE E aa 162 8 10 MySQL Workbench Schema Validation Plugins Commercial Version ceeeeeeeeeeeees 162 8 10 41 General Validation s ssiccec 2sctveavesiveesgh et teateeivabee oct bakes devees cite edvades entwleleaseade scents 162 8 10 2 MySQL Specific Validation 0 cccccc ec cececeeeee
300. e for processes on MySQL servers and optionally kills them It can both be used to actually perform the search or kill operation or to generate the SQL statement for doing the job To kill all queries with user mats the following code can be used 2e gt from mysql utilities command proc imoort gt gt gt grep ProcessGrep matches USER mats actions KILL_QUERY gt gt gt grep execute root server l example com root server 2 example com Parameters e matches List of var pat pairs Sequence of field comparison conditions In each condition varis one of the constants listed earlier that specify PROCESSLIST table fields and patis a pattern For a process to match all field conditions must match sql only_body False Return the SQL code for executing the search and optionally the kill If only_body is True only the body of the function is shown This is useful if the SQL code is to be used with other utilities that generate the routine declaration If only_body is False a complete procedure will be generated if there is any kill action supplied and just a select statement if it is a plain search Parameters e only_body boolean Show only the body of the procedure If this is False a complete procedure is returned Returns SQL code for executing the operation specified by the options Return type string execute connections output sys stdout connector
301. e is typical of the methods and classes in the library Notice that this method has three required parameters and a dictionary of options that may exist Each method and function that uses this mechanism defines its own default values for the items in the dictionary A quick look at the method documentation shows the key names for the dictionary This can be seen in the preceding example where the dictionary contains three keys and the documentation lists their defaults 241 Introduction to extending the MySQL Utilities To call this method and pass different values for one or more of the options the code may look like this opt_dictionary width g OO TESE e IO Viele to farl 5 False result do_something_wonderful 1l obj_1l obj_2 opt_dictionary The documentation block for the preceding method is the style used throughout the library Example Now that you are familiar with the MySQL utilities and the supporting library modules let us take a look at an example that combines some of these modules to solve a problem Suppose that you want to develop a new database solution and need to use real world data and user accounts for testing The mysqlserverclone MySQL utility looks like a possibility but it makes only an instance of a running server It does not copy data However mysqldbcopy makes a copy of the data and mysqluserclone Clones the users You could run each of these utilities in sequence and that would wo
302. e master use the following command mysqldbexport server root localhost 3311 util_test export both rpl user rpl rpl rpl slave y Source on localhost connected Stopping slave STOP SLAVE Source on localhost connected Exporting metadata from util_test DROP DATABASE IF EXISTS util_test CREATE DATABASE util_test 278 mysqldbimport Import Object Definitions or Data into a Database USE util_test TABLE util_test t1l CREATE TABLE E1 a char 30 DEFAULT NULL ENGINE MEMORY DEFAULT CHARSET latinl done Source on localhost connected USE util_test Exporting data from util_test Data for Cable whil_test tl NSERT INTO util_test t1 VALUES 01 Test Basic database example NSERT INTO util_test t1 VALUES 02 Test Basic database example NSERT INTO util_test t1 VALUES 03 Test Basic database example NSERT INTO util_test t1 VALUES 04 Test Basic database example NSERT INTO util_test t1 VALUES 05 Test Basic database example NSERT INTO util_test t1 VALUES 06 Test Basic database example NSERT INTO util_test t1 VALUES 07 Test Basic database example done Connecting to the current server s master CHANGE MASTER TO MASTER_HOST localhost MASTER_USER rpl MASTER_PASSWORD rpl MASTER_PORT 3310 MASTER_LOG_FILE clone bin 000001 MASTER_LOG_POS 1739 Starting slave START SLAVE 14 4 7 mysqldbimport Im
303. e object file is unrestricted regardless of whether it is legally a derivative work Executables containing this object code plus portions of the Library will still fall under Section 6 Otherwise if the work is a derivative of the Library you may distribute the object code for the work under the terms of Section 6 Any executables containing that work also fall under Section 6 whether or not they are linked directly with the Library itself 6 As an exception to the Sections above you may also combine or link a work that uses the Library with the Library to produce a work containing portions of the Library and distribute that work under terms of your choice provided that the terms permit modification of the work for the customer s own use and reverse engineering for debugging such modifications You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License You must supply a copy of this License If the work during execution displays copyright notices you must include the copyright notice for the Library among them as well as a reference directing the user to the copy of this License Also you must do one 353 GNU Lesser General Public License Version 2 1 February 1999 of these things a Accompany the work with the complete corresponding machine readable source code for the Library including whatever changes were used in the work
304. e processes belonging to other accounts Without SUPER the account cannot kill processes belonging to other accounts To specify how to display output use one of the following values with the format 304 option 303 mysqlprocgrep Search Server Process Lists Options grid default Display output in grid or table format like that of the mysql monitor csv Display output in comma separated values format tab Display output in tab separated format vertical Display output in single column format like that of the G command for the mysq1 monitor mysqlprocgrep accepts the following command line options help Display a help message and exit age lt time gt Select only processes that have been in the current state more than a given time The time value can be specified in two formats either using the hh mm ss format with hours and minutes optional or as a sequence of numbers with a suffix giving the period size The permitted suffixes are s second m minute h hour d day and w week For example 4h15m mean 4 hours and 15 minutes For both formats the specification can optionally be preceded by or where means older than the given time and means younger than the given time format lt format gt f lt format gt Specify the output display format Permitted format values are grid csv tab and vertical The default is grid kill connection Kill the connection for all matc
305. e shown is the master s executed GTID set MySQL Replication Monitor and Failover Utility Failover Mode auto Next Interval Mon Mar 19 15 59 33 2012 Master Information Binary Log File Position Binlog_Do_DB Binlog_Ignore_De mysql bin 000001 571 GTID Executed Set ZAG TD BOOS 2 DAI IMEZ A dl OO PGA bby OlO be es ener Master GTID Executed Set mysqlfailover Automatic replication health monitoring and failover 2A67DE00 2DA1 11E2 A711 00764F2BE90F 1 7 SsOSDS T ADEA IN ILO 7 DACA SS els O quit R refresh H health G GTIID Lists U UUIDs L log entries Up Down scroll If the user continues to press the g key the display will cycle through the three gftid lists If the list is longer than the screen permits as shown in the example above the scroll up and down help is also shown In this case if the user presses the down arrow the list will scroll down If the user presses the u key the list of UUIDs used in the topology are shown MySQL Replication Monitor and Failover Utility Failover Mode auto Next Interval Mon Mar 19 16 02 34 2012 Master Information Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB nyse laoiin OOOOOl S7 il GTID Executed Set 2A67DE00 2DA1 11E2 A711 00764F2BE90F 1 7 UUIDs SSS SS SS SSS SS q psss dee SS SS SEES 4b host port role wiel jee SSeS SSS SSS Sn psss dees SS SS SESS 4b localhost 2351 MASTER 55c65a00 71fd llel 9f80 ac64ef35c961 lo
306. e times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit NOTES This utility is available as of u 1 2 0 This utility can only be applied to servers with the audit log plugin enabled And the audit log plugin is available as of MySQL Server versions 5 5 28 and 5 6 10 This utility requires Python version 2 6 or higher but does not support Python 3 The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf This feature exists as of MySQL Server 5 6 6 see mysql_config_editor MySQL Configuration Utility LIMITATIONS The remote login 251 option is not supported on Microsoft Windows platforms For Microsoft Windows use UNC paths and perform a local copy operation omitting the remote login 251 option EXAMPLES To display the audit log system variables run the following command mysqlauditadmin show options server root localhost 3310 Audit Log Variables and Options 4 4 Variable_name Value 4 4 audit_log_buffer_size 1048576 audit _log_ file audit log awebie leor
307. eaaeaeeeeeeeeeeeeaaaaeeeees 225 WE 2 INO CGS ete asec ae E OA pase ee tc a ag ea aa aoe nee een ee ON 226 V2 3 PIUQUAS cusrsissisho nn ctiecaiecninecnge stiieidaamnaiinedneneiedhachonedans A R 227 12 4 Adding a GUI to a Plugin Using MFOrmMs cceceeeeeeeeeeee cece ae eeeeeeeeeeeeeeaaaaeeeeeeeeees 228 12 5 The Workbench Scripting Shell ccceccccseeeeeeeeeee cece aaa eee eeeeeeseaaeaaaeeeeeeeeseaaaaaenees 229 12 5 1 Exploring the Workbench Scripting Shell cceceeeeeeeeeeeeeeeeeeeeeaeeaeeeeeeeeeees 229 125 2 The Shell WindOw is ssaniu aa aaa a a a aE 230 12 5 3 The Files Globals Classes and Modules Tabs cccccccceeeeeeeeeeeaeeeeeeaees 230 12 6 Tutorial Writing PIUQINS sissies Sanes ESKEAK AEE BEATER OAE KRAER A UE K ARSKAN 231 13 Keyboard SMOMCUIS sarani a A O a O a O OEE EAE 233 14 MYSQL Utilitie S iinitan anaa DE aa sat Aa a EER A 237 TAT PEIO eer a T T E TAR 237 V4 PE a Ee E E E A A A E E E E N E T aleee 237 iae VOC GTI Isis a T T S TT S 238 14 2 1 Introduction to MySQL Utilities 0 cece cece eee teeeteee tree ee rr aaa teeeeeeeeeaeaaaeees 238 14 2 2 Connection Parameters ccccccececceeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaeeeeeeeeeeseaaeaeeees 239 14 2 3 Introduction to extending the MySQL Utilities cee cece cece eeeeeeeeeeeeeeeeaee 239 WAS Command Si caries eect tanita a E E A S 245 14 3 1 mysql utilities command grep Search Databases for Objects
308. eaah fans A227 PIXMA LICENSE siana e a E E aAA E a ERa A 23 PyCrypto License serrocciueirsiancaari se cddeedenatavad es Gcaseuauceueed ceedeceseesstapseausuedieegeseee EULER awna ESAE A24 PYODBO CiCEnSE siosioina Geli a E E E E AEE EaR A25 Pyhon LICENSE wis clesccctee cases cesenunredecas REEERE ERE E RE REEN RONE RTA tase A 26 Scintilla ICGNSC roren ona a o a oa a a A 27 ScintilAaNET LICENS siciccscvcssccccatvccvesdicnccadsavivatsicvsccsuatvaciecdianedaeiseiiads Danie eiiean Pio edna Cariu A28 TNYXML License iu nnaniies enaena ee dite delete tee ee A 29 TreeViewAdv for NET License ccc cece ccccceccceceeeeeeeeeeeeeeeeeeeeeuecacecaeeeaeeeaeeueeeueeeaeeegnenaeeees A330 VSQLITC LICENSE cisssiccsticarseadesaitdwisieedsdanad cativaas saddatndaveaevieatadaaadieavstause Ea E a Nai A531 BLT License oi crcarchinscvsngcsuandueaanenseunedcdandaceanivadenensuaneeuaid dewanduadusentpasedaduduadanvadatenssaaharsunts Use of any of this software is governed by the terms of the licenses that follow MySQL Workbench 5 2 Section A 1 NET Flat TabControl License Section A 2 ANTLR License Section A 3 Bitstream Vera License Section A 4 Boost Library License Section A 5 Cairo License Section A 6 CTemplate Google Template System License Section A 7 CURL 1ibcur1 License Section A 8 DockPanel Suite License Section A 9 Dojo Toolkit v1 7 0b1 License Section A 10 GLib Licens
309. eating Text Objects 8 6 1 6 The Image Tool Use the image tool to place an image on the canvas When this tool is selected and you click the canvas a dialog box opens enabling you to select the desired graphic file 102 The Vertical Toolbar To activate the image tool from the keyboard use the I key For more information about images see Section 8 7 8 Creating Images 8 6 1 7 The Table Tool Use this tool to create a table on the EER Diagram canvas Clicking the canvas creates a table To edit the table with MySQL Table Editor right click it and choose Edit Table or Edit in New Window from the pop up menu You can also double click the table to load it into the table editor To activate the table tool from the keyboard use the T key For more information about creating and editing tables see Section 8 7 1 3 The MySQL Table Editor 8 6 1 8 The View Tool Use this tool to create a view on an EER Diagram canvas When the table tool is activated a schema list appears on the toolbar below the main menu enabling you to associate the new view with a specific schema You can also select a color for the object by choosing from the color list to the right of the schema list After selecting this tool clicking the canvas creates a new view To edit this view right click it and choose Edit View or Edit in New Window from the pop up menu To activate the view tool from the keyboard use the V key
310. ect description as set for the model in Document Properties PROJECT_CREATED Variable MAIN Automatically set for the model project but as displayed in Document Properties PROJECT_CHANGED Variable MAIN Automatically set for the model project but as displayed in Document Properties TOTAL_TABLE_COUNT Variable MAIN The number of tables in all schemata in the model TOTAL_COLUMN_COUNT Variable MAIN The number of columns in all tables in all schemata in the model TOTAL_INDEX_COUNT Variable MAIN The number of indexes in the model 170 Supported Template Markers Marker text Type Data Dictionary or Parent Corresponding data Dictionary TOTAL_FK_COUNT Variable MAIN The number of foreign keys in SCHEMATA Section the model Used to mark the start and end of a SCHEMATA section the SCHEMATA data dictionary becomes active in this section SCHEMA_NAME SCHEMATA The schema name SCHEMA_ID SCHEMATA The schema ID TABLE_COUNT SCHEMATA The number of tables in the current schema COLUMN_COUNT Variable SCHEMATA The number of columns in the current schema INDICES COUNT Variable SCHEMATA The number of indexes in the current schema FOREIGN_KEYS_COUNT Variable SCHEMATA The number of foreign keys in the current schema TABLES Section SCHEMATA Marks the start and end of a TABLES section the TABLES data dictionary becom
311. ected Checking for binary logging on master Setting up replication He done The following command starts replication from the beginning of a specific master binary log file mysqlreplicate master root localhost 3306 slave root localhost 3307 rpl user rpl rpl master log file my_log 000003 master on localhost connected slave on localhost connected Checking for binary logging on master Setting up replication done The following command starts replication from specific master binary log coordinates specific log file and position mysqlreplicate master root localhost 3306 slave root localhost 3307 rpl user rpl rpl master log file my_log 000001 master log pos 96 master on localhost connected slave on localhost connected Checking for binary logging on master Setting up replication done RECOMMENDATIONS You should set read_only 1 in the my cnf file for the slave to ensure that no accidental data changes such as INSERT DELETE UPDATE and so forth are permitted on the slave other than those produced by events read from the master Use the pedantic 307 and vv options for setting up replication on production servers to avoid possible problems with differing storage engines 14 4 15 mysqlrpladmin Administration utility for MySQL replication This utility permits users to perform administrative actions on a replic
312. ections r 5 Manage DB Connections if i olB amp Stored Connections Connection Name Big Iron Server Type a name for the connection Local instance MySQUSS Connection Method Standard TCP IP v Method to use to connect to the RDBMS Big Iron Server Parameters Advanced Hostname 127 0 0 1 Port 3306 Name or IP address of the server host TCP IP port Username root Name of the user to connect with Password Store in Vault Clear The user s password Default Schema The schema that will be used as default schema Disks Move ovem Gose You are now ready to forward engineer your model to the live server From the main menu select Database Forward Engineer The Forward Engineer to Database wizard will be displayed The Options page of the wizard shows various advanced options For this tutorial you can ignore these and simply click Next On the next page you can select the object you want to export to the live server In this case you only have a table so no other objects need be selected Click Next 43 Adding Data to Your Database 19 The next page Review SQL Script displays the script that will be run on the live server to create your schema Review the script to make sure that you understand the operations that will be carried out Click Next Figure 5 18 Getting Started Tutorial Review Script Forward Engineer to Database z Options Review the SQL Script to b
313. ectory folder and contents user parse_user_host Parse user passwd host port from user passwd host User Clone user and its grants to another user and perform user level operations General Interface Specifications and Code Practices The MySQL Utilities are designed and coded using mainstream coding practices and techniques common to the Python community Effort has been made to adhere to the most widely accepted specifications and techniques This includes limiting the choice of libraries used to the default libraries found in the Python distributions This ensures easier installation enhanced portability and fewer problems with missing libraries Similarly external libraries that resort to platform specific native code are also not used The class method and function signatures are designed to make use of a small number of required parameters and all optional parameters as a single dictionary Consider the following method def do_something_wonderful position objl obj2 options Does something wonderful A fictional method that does something to object 2 based on the location of something in object 1 position in Posteno inom jd objl in First object to manipulate obj2 in Second object to manipulate options in Option dictionary width width of printout default 75 iter max iterations default 2 ok_to_fail if True do not throw exception default True Returns bool True success Fail failed This exampl
314. ecute Current Statement Executes the current SQL statement e Explain All or Selection Describes all statements or the selected statement 71 Toolbar e Explain Current Statement Describes the current statement Visual Explain Current Statement Visually describes the current statement based on EXPLAIN information provided by MySQL Server 5 6 and above This feature was added in MySQL Workbench 5 2 45 Stop Stops executing the currently running script Reconnect to Server Reconnects to the MySQL server New Tab Creates a duplicate of the current SQL Editor tab Commit Transaction Commits a database transaction Rollback Transaction Rolls back a database transaction Refresh Synchronizes with the live server and refreshes views such as the live Overview tabsheet Commit Result Edits Commits any changes you have made to the server Discard Result Edits Discards any changes you have made Export Results Exports result sets to a file Selecting this option displays the Export Query Results to File dialog The dialog enables you to select which result set you wish to export the file format CSV HTML XML and the name and location of the output file Then click Export to export the data Edit Menu The Edit menu features the Format submenu The Format submenu includes the following menu items that are of importance when in SQL Editor mode Beautify Query Reformats the query selected in the query tab an
315. ecution of GTID_PURGED statements skip rpl Do not execute replication commands table lt db gt lt table gt Specify the table for importing This option is required while using format raw_csv verbose v 281 mysqldbimport Import Object Definitions or Data into a Database Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit NOTES The login user must have the appropriate permissions to create new objects access read the mysql database and grant privileges If a database to be imported already exists the user must have read permission for it which is needed to check the existence of objects in the database Actual privileges needed may differ from installation to installation depending on the security privileges present and whether the database contains certain objects such as views or events and whether binary logging is enabled Some combinations of the options may result in errors during the operation For example excluding tables but not views may result in an error when a view is imported The new storage engine 281 and default storage engine 280 options apply to all destination tables in the operation For the format 281 and import 281 options the permitted values are not case sensitive In addition values may
316. ed by your MySQL Workbench options settings For more information see Section 6 4 5 The Model Tab 8 7 3 3 The View Editor To invoke the view editor double click a view object on the EER Diagram canvas or double click a view inthe Physical Schemata section on the MySQL Model page This opens the view editor docked at the bottom of the application Double clicking the title bar undocks the editor Do the same to redock it Any number of views may be open at the same time Each additional view appears as a tab at the top of the view editor There are three tabs at the bottom of the view editor View Comments and Privileges Navigate between different tabs using the mouse or from the keyboard by pressing Control Alt Tab The View Tab Use the View tab to perform the following tasks Rename the view using the Name text box Enter the SQL to create a view using the SQL field Comment a view using the Comments text area The Comments Tab This tab enables you to enter comments for a particular view The Privileges Tab The Privileges tab of the view editor functions in exactly the same way as the Privileges tab of the table editor For more information see Section 8 7 1 3 9 The Privileges Tab 120 Creating Routines and Routine Groups 8 7 3 4 Modifying a View Using the Properties Palette When you select a view on the EER Diagram canvas its properties are displayed in the Properties palette Most of the pro
317. ed only on the MySQL Model page 8 7 6 2 The Note Editor To invoke the note editor double click a note object in the Model Note section on the MySQL Model page This opens the note editor docked at the bottom of the application Double clicking the note tab undocks the editor Double click the title bar to redock it Any number of notes may be open at the same time Each additional note appears as a tab at the top of the note editor Use the editor to change the name of a note or its contents 8 7 7 Creating Text Objects Text objects are applicable only to an EER diagram They can be used for documentation purposes for example to explain a grouping of schema objects They are also useful for creating titles for an EER diagram should you decide to export a diagram as a PDF or PNG file 8 7 7 1 Adding Text Objects to an EER Diagram To add text objects to an EER Diagram use the Text Object tool on the vertical toolbar Make sure that the EER Diagram tab is selected then right click the text object icon on the vertical toolbar The text object icon is the rectangular icon found below the label icon Clicking the mouse on this icon changes the mouse pointer to a text object pointer You can also change the mouse pointer to a text object pointer by pressing the N key Choosing the Text Object tool changes the contents of the toolbar that appears immediately below the menu bar When the Text Object pointer is active this toolbar contains a
318. ed to an EER Diagram by dragging and dropping them from this palette 8 7 1 2 Adding Tables to an EER Diagram Tables can also be added to an EER Diagram using the table tool on the vertical toolbar Make sure that the EER Diagram tab is selected then right click the table icon on the vertical toolbar The table icon is the rectangular tabular icon Clicking the mouse on this icon changes the mouse pointer to a table pointer You can also change the mouse pointer to a table pointer by pressing the T key Choosing the table tool changes the contents of the toolbar that appears immediately below the menu bar When the Tables pointer is active this toolbar contains a schemata list an engines list a collations list and a color chart list Use these lists to select the appropriate schema engine collation 104 Creating Tables and color accent for the new table Make sure that you associate the new table with a database The engine and collation of a table can be changed using the table editor The color of your table can be changed using the Properties palette The Default Engine and Default Collation values refer to the database defaults Create a table by clicking anywhere on the EER Diagram canvas This creates a new table with the default name t abiel To revert to the default mouse pointer click the arrow icon at the top of the vertical toolbar Figure 8 8 A Table on an EER Diagram _ address v address_id SMALLI
319. ee a newly installed ODBC driver You can also use it to create a data source for a specific database instance to be connected using a previously configured driver Typically you need to provide a name for the data source the DSN in addition to the database server IP port username and sometimes the database the user has access to If MySQL Workbench is able to locate an ODBC manager GUI for your system a Plugins Start ODBC Administrator menu item be present under the Plugins menu as a convenience shortcut to start it e Linux There are a few GUI utilities some of which are included with unixODBC Refer to the documentation for your distribution ODBC provides iodbcadm gtk Official binaries of MySQL Workbench include it and it can be accessed through the Plugins Start ODBC Administrator menu item e Mac OS X You can use the ODBC Administrator tool which is provided as a separate download from Apple If the tool is installed in the Applications Utilities folder you can start it through the Plugins Start ODBC Administrator menu item Microsoft Windows You can use the Data Sources ODBC tool under Administrative Tools And it can be started through the Plugins Start ODBC Administrator menu item ODBC Driver architecture R Since the ODBC driver needs to be installed in the client side you will need an ODBC driver that supports your clients operating system and architecture For example if you are running MySQ
320. ee Software Foundation Inc Taken from GNU libtool 2001 Originally by Gordon Matzigkeit lt gord gnu ai mit edu gt 1996 This file is free software the Free Software Foundation gives unlimited permission to copy and or distribute it with or without modifications as long as this notice is preserved You are receiving a copy of the libintl library The terms of the Oracle license do NOT apply to the libintl library it is licensed under the following license separately from the Oracle programs you receive If you do not wish to install this program you may delete the intl dll or libintl files This component is licensed under Section A 12 GNU Lesser General Public License Version 2 1 February 1999 A 17 Libxml2 License The following software may be included in this product Libxm12 Except where otherwise noted in the source code e g the files hash c list c and the trio files which are covered by a similar licence but with different Copyright notices all the files are Copyright C 1998 2003 Daniel Veillard All Rights Reserved Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to
321. ee ects ee aeeceeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeneeeeeeees 163 8 11 The DBDoc Model Reporting Dialog Window Commercial Version ceeeeeeeeteeeeeees 163 8 12 Customizing DBDoc Model Reporting Templates cccccceeeeeeeeeeeeeaeaaeeteeeeeeeeeeeaneaeenees 166 8 12 1 Supported Template Markers ccceceecceeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaceeeeeeeeeaeaaaaeeeees 169 8 12 2 Creating a Custom Template ccccceceeeeeee cece ee aa cee eeeeeeeeeeaaaaeeeeeeeeeeeaaaaeeneeeeeeees 173 MySQL Workbench provides extensive capabilities for creating and manipulating database models including these e Create and manipulate a model graphically e Reverse engineer a live database to a model Forward engineer a model to a script or live database 83 Open an Existing EER Model e Create and edit tables and insert data This is not an exhaustive list The following sections discuss these and additional data modeling capabilities The Home window is the typical starting point for work with data modeling In the Data Modeling section of the Workspace you can use the action items there to create and manage models forward and reverse engineer and compare and synchronize schemata e Open an Existing EER Model e Create new EER Model e Create EER Model from Existing Database e Create EER Model from SQL Script The following sections describe these action items 8 1 Open an Existing EER Model Cli
322. eedlinestc 3332 SLAVE odds 0S esm Eam iets 0 gt dez47 13 sb isc ptocalhose 3333 SLAVE 65ccbb38 71f d 1lel1 9f80 bda8146bdb0a eea lhos ta lmoss4 SLAVE 6dd6abf4 71fd 1le1 9f80 d406a0117519 e SSeS SSS SSeS i psss jee SS SS SS SSS 4b Q quit R refresh H health G GTID Lists U UUIDs L log entries If once the master is detected as down and failover mode is auto or elect and there are viable candidate slaves the failover feature will engage automatically and the user will see the failover messages appear When failover is complete the interface returns to monitoring replication health after 5 seconds The following shows an example of failover occurring Failover starting Candidate slave localhost 3332 will become the new master Preparing candidate for failover Creating replication user if it does not exist Stopping slaves Performing STOP on all slaves Switching slaves to new master Starting slaves Performing START on all slaves Checking slaves for errors Failover complete Discovering slaves for master at localhost 3332 Failover console will restart in 5 seconds After the failover event the new topology is shown in the replication health report MySQL Replication Monitor and Failover Utility Failover Mode auto Next Interval Mon Mar 19 16 05 12 2012 Master Information Binary Log File Position Binilog_De_DB Binlog_ignore_DB nyse loin OOOO ial GTID Executed Set ANG DAO 2 DALIAN LOO V
323. eeeeeaea 4 3 2 Launching MySQL Workbench on Windows 00 ceeeeeeeeeeeeeeeeeeee ee aeaaeeeeeeeeeeeeaeaaeeees 4 3 3 Uninstalling MySQL Workbench on Windows cccceeeeeeee eect eeeeeeeeeeeeeaeaaneeeeeeeeees 4 3 4 Installing MySQL Workbench on LINUX 1 0 2 2 cece eeeeee cece eee ete ee cece teen ae aaeaeeeeeeeeeeaeaaeaenees 4 3 5 Launching MySQL Workbench on LINUX cceecceeeee cece cece eae eeee cess sees aeaaeeneeeeeeeeeaeaaea 4 3 6 Uninstalling MySQL Workbench on Linux 0ccceceeeee cece cence eeeeeeee ee aeaaeeeeeeeeeeeeaeaaeaees 4 3 7 Installing MySQL Workbench on Mac OS X 2 eeccceeeeeeeee cece ee eeeeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaea 4 3 8 Launching MySQL Workbench on Mac OS X cceceeeeeeeeeceeeeeeeeeeeeeaeaaeeeeeeeeeeeeeeaaaaeenees 4 3 9 Uninstalling MySQL Workbench on Mac OS X cccceeeeeeee cece eecceeeeeeeeeeeeaeaaeeneeeeeeeeeaea MySQL Workbench is available for the following platforms e Windows e Linux e Mac OS X Binary distributions of MySQL Workbench are available for the preceding platforms Source code distributions are also available as a tar gz package or an RPM package The following sections explain the installation process for each of these platforms 4 1 Hardware Requirements MySQL Workbench requires a system that runs smoothly The minimum hardware requirements are e CPU 32 bit or 64 bit e Cores Single Single Core 3GHz or higher Dual Core 2GHz or
324. eeeees 19 4 3 Starting MySQL Workbench 0 ccccceeeeeeeeeeeeeeeee eee ae aa eee eeeeeeeeaeaaaaaaeeeeeseeseaaaaaaneeeeeeees 20 4 3 1 Installing MySQL Workbench on Windows 0 cccceeeeeeeeeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaee 21 4 3 2 Launching MySQL Workbench on Windows eceeeeeeeeeeeeeeeeeeeeeeaeaaenteeeeeees 21 4 3 3 Uninstalling MySQL Workbench on Windows ccecceeeeeeeeeeeeeeee ee eeeeteeeeeeeeeaeaaee 22 4 3 4 Installing MySQL Workbench on LINUX ceeeeeeeeeeeeeeeeee esac ae eeteeeeeeeeeaeaaaaneeeeeees 23 4 3 5 Launching MySQL Workbench on Linux 0 c cceeeeeeeeeeeeeeeeeeeeeeeaeaaeeteeeeeeeeeaeaaea 23 4 3 6 Uninstalling MySQL Workbench on LinuX ceeeeeeeee cece ee eeeeeeeeeeeeeeaeaaeaneeeeeees 23 4 3 7 Installing MySQL Workbench on Mac OS X cceceeeeeee ee eeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaae 24 4 3 8 Launching MySQL Workbench on Mac OS X ceseeeeeeeeeeeeeeeeeeeeeeeeeaeaaeaeeeneeees 24 4 3 9 Uninstalling MySQL Workbench on Mac OS X eeeeeeeeeeeeeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaes 25 5 Getting Started Tutorial iseia i r Sana he eee ee ee 27 5 1 Administering a MySQL Server ccccceeeeceaeeeeeeeeeeeee esse eae eeeeeeeeeeaeaaeaceeeeeeeeeaeaaaaeeeeeees 27 5 2 Creatingya Model rrea e a ai aedea ds re ceded vee nds eee detailed 39 5 3 Adding Data to Your Database eieren cece a E Eaa tere eS EAEE NE ERES 44 6 The Home WIndOW missieri aenema
325. efinitions or Data from a Database Specify the export format Permitted format values are definitions export only the definitions metadata for the objects in the database list data export only the table data for the tables in the database list and both export the definitions and the data The default is definitions file per table Write table data to separate files This is Valid only if the export output includes data that is if export data 274 or export both 274 are given This option produces files named db_name tb _name format For example a csv export of two tables named t1 and t2 in database d1 results in files named db1 t1 csv and db1 t2 csv If table definitions are included in the export they are written to stdout as usual format lt format gt f lt format gt Specify the output display format Permitted format values are sql grid tab csv and vertical The default is sql locking lt locking gt Choose the lock type for the operation Permitted lock values are no locks do not use any table locks lock all use table locks but no transaction and no consistent read and snapshot consistent read using a single transaction The default is snapshot no headers h Do not display column headers This option applies only for csv and tab output quiet q Turn off all messages for quiet execution regexp basic regexp G Perform pattern matches using the REGEXP operator The
326. eir contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF 361 Pixman License MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT Ole SUBSTITUTE GOODS OR SERVICES LOSS Oly WiSkkh DALTA OR TAINO ILI S 2 OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE End A 22 Pixman License The following software may be included in this product Pixman Baneri WO 2il a2 The following is the MIT license agreed upon by most contributors Copyright holders of new code should use this license statement where possible They may also add themselves to the list below Copyright 1987 1988 1989 1998 The Open Group Copyright 1987 1988 1989 Digital Equipment Corporation Copyright 1999 2004 2008 Keith Packard Copy eige 2000ER by ENEs Copyright 2000 Keith Packard member of The XF
327. elect multiple columns and check the PK check box However there is an additional step that is required you must click the Indexes tab then in the Index Columns panel you must set the desired order of the primary keys Note kK When entering default values in the case of CHAR and VARCHAR data types MySQL Workbench will attempt to automatically add quotation marks if the user does not start their entry with one For other data types the user must manage quoting if required as it will not be handled automatically by MySQL Workbench Caution A Care must be taken when entering a default value for ENUM columns because a nonnumeric default will not be automatically quoted You must manually add single quote characters for the default value Note that MySQL Workbench will not prevent you from entering the default value without the single quotation marks If a nonnumeric default value is entered without quotation marks this will lead to errors For example if the model is reverse engineered the script will contain unquoted default values for ENUM columns and will fail if an attempt is made to run the script on MySQL Server 8 7 1 3 3 The Indexes Tab The Indexes tab holds all index information for your table Use this tab to add drop and modify indexes 108 Creating Tables Figure 8 11 The Indexes Tab SQL File 1 Lr Indexes PRIMARY PRIMARY idx_fk_city_id V address_id address addre
328. em where you can report bugs Workbench Team Blog Links to the Workbench team blog Planet MySQL Links to MySQL related blogs and news Workbench forums Links to the MySQL user and developer forums 50 Workspace 6 2 Workspace The Workspace is designed to enable you to quickly get to the task you would like to carry out In alignment with MySQL Workbench functionality it is divided into three main areas SQL Development For further information see Chapter 7 SQL Development Data Modeling For further information see Chapter 8 Data Modeling Server Administration For further information see Chapter 10 Server Administration 6 3 Workbench Application Minimum Window Size As of version 5 2 10 the MySQL Workbench application features a fixed minimum window size of 1024x768 You cannot reduce the size of the application to less than this resolution 6 4 Workbench Preferences MySQL Workbench preferences and default settings are set by the Preferences menu This menu is divided sections as described below General Configuration of general purpose options Administrator Configuration of tools used by the Administrator functionality SQL Editor Configuration of the SQL Editor SQL Queries Preferences specific to the queries Model Default model attributes Model MySQL MySQL specific model attributes including the MySQL storage engine and targeted MySQL version Diagram EER diagram settings Appearance Cha
329. en Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 4 PSF is making Python available to Licensee on an AS IS 365 Python License basis PSF MAKES NO REPRESENTATIONS OR WARRANTIES EXPRESS OR IMPLIED BY WAY OF EXAMPLE BUT NOT LIMITATION PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS 5 PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING DISTRIBUTING OR OTHERWISE USING PYTHON OR ANY DERIVATIVE THEREOF EVEN IF ADVISED OF THE POSSIBILITY THEREOF 6 This License Agreement will automatically terminate upon a material breach of its terms and conditions 7 Nothing in this License Agreement shall be deemed to create any relationship of agency partnership or joint venture between PSF and Licensee This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee or any third party 8 By copying installing or otherwise using Python Licensee agrees to be bound by the terms and conditions of this License Agreement BEOPEN COM LICENSE AGREEMENT FOR PYTHON 2 0 BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 1 This LICENSE AGREEMENT is be
330. ense do NOT apply to Cairo Oracle distributes it under the GNU Lesser General Public License Version 2 1 separately from the Oracle programs you receive You can also separately obtain and use Cairo independent of the Oracle programs under a dual license subject to the terms of the LGPL or the Mozilla Public license Version 1 1 If you do not wish to install this program you may delete libcairo dll or libcairo 2 dylib and libpixman 1 0 dylib from the installation directory or uninstall MySQL Workbench completely 346 CTemplate Google Template System License This component is licensed under Section A 12 GNU Lesser General Public License Version 2 1 February 1999 A 6 CTemplate Google Template System License The following software may be included in this product CTemplate Google Template System Copyright c 2005 Google Inc All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of Google Inc nor the names of its contributors may be used to endorse
331. enus These menu items are active only when an EER Diagram tab is selected The Similar Figures and the Connected Figures menu items are disabled if no object is currently selected on an EER diagram When multiple objects have been selected using one of these menu items you can navigate between selected items by choosing the Go to Next Selected or Go to previous Selected menu item Selecting objects changes some of the Edit menu items If only one object is selected that object s name appears after the Cut Copy and Delete menu items If more than one object is selected these menu items show the number of objects selected 8 5 1 2 1 Find Dialog Window Each MySQL Workbench window includes search functionality The Find panel with Find amp Replace enabled is shown below Figure 8 2 The Find Panel with Find amp Replace File Edit View Query Database Plugins Scripting Help SS dae E Object Browser SCHEMAS Big iQ me Search objects mystuff lofe fal sakila L String Matching test world Regular Expression Ignore Case E description x Match Whole Words release_year ly Wrap Around language_id original_language_ rental_duration rental_ rate Clear Recent Searches length replacement_cost rating special_features last_update FROM sakila film LIMIT 0 1000 Recent Searches Snippets Information Duration Fetch Find options The Find dialogue
332. ep 2621 root focalhost 57031 Sleep None 2622 root focalhost 57032 Sleep None 2624 root focalhost 57034 Query ini SHOW FULL PROCESSLIST 2625 root localhost 57035 Sleep None Refresh Rate Don t Refresh Kill Query Kill Connection 14 Enterprise Features Figure 2 13 Server Status Workbench 6 0 e090 MySQL Workbench Pe My Local example com DB sakila elhi oisidicd a E Manegemene Schemas Administration Server Status X j MANAGEMENT gt Server Status Connection Name Cem Connections My Local example com DB amp Users and Privileges E5 Status and System Variables Host scissors local M m Runnin 125 7 amp Data Export MySQL Socket tmp mysql sock g Data import Restore Server 5 6 Port 3306 5 6 10 INSTANCE MySQL Community Server GPL aanita inated E Startup Shutdown Traff f D ar one Compiled For 0sx10 7 x86_64 raffic Key Efficiency 27 49 KB s 99 9 Options File Available Server Features Performance Schema On SSL Availability off Thread Pool n a PAM Authentication Off Memcached Plugin nja Password Validation nla Semisyne Replication Plugin nja Audit Log pla Server Directories Base Directory Just local mysaql ij o3 os i i Data Directory usr local mysql data Objectinfe Session Disk Space in Data Dir 198Gi of 465Gi available Table actor Plugins Directory usr local mysgl lib plugin Tmp Direct jvaritmp Columns mp Uirectory var tmp actor id Error L
333. erver Process Lists ccccceeeeeeeeeeeeeeeeeeeees 14 4 14 mysqireplicate Set Up and Start Replication Between Two Servers 14 4 15 mysql rpladmin Administration utility for MySQL replication 0008 14 4 16 mysqlrplcheck Check Replication Prerequisites ccccceceeeeseeeeeeeeees 14 4 17 mysqlrplshow Show Slaves for Master Server cccccceseeeeeeeeeeeeeeeeees 14 4 18 mysqlserverclone Clone Existing Server to Create New Server 14 4 19 mysqiserverinfo Display Common Diagnostic Information from a SOLVER Gia A EA AE EEA E TEN EA E T N Geudvesstiuiivesde 14 4 20 mysqluc Command line client for running MySQL Utilities ee 14 4 21 mysqluserclone Clone Existing User to Create New User 008 Parsons eaoin a e a EE E E E E E 14 5 1 mysql utilities parser Parse MySQL Log Files 0ceceeeeeeeeeeneeeeeeeeeeeeeeaes FREIALCONTOOIS aneren a E AE OEA nerd ca AE R EE R 14 6 1 mut MySQL Utilities Testing 2 0 0 0 cece cece cece cece aa eee eeeeeeeeeeaeaaaaneeeeeeees PAD DGMNGIX oe Geet es a cateweles chatted caueaente E E A A A N 14 7 1 MySQL U lities FAQ ciiaveisiataaaicceaieestesassavoddavatsiviaalsvbteas AKENE KARNA RA E KARKR ERT KRAA KERERE 14 7 2 MySQL Utilities copy_server py Sample 0 cccceeeceeeeeeeeeeeeeeeeeaeeaeeeeeeeeeeeeaaa Aj Third Fany LICGAS OS sesiis iorn R eweecbad EA EA
334. ervfRoB COR vans SELECT CONCAT Customer last_name Customer first_name AS customer address phone film titte FROM rental INNER JOIN customer ON rental customer_id customer customer_id ie 2 3 4 INNER JOIN address ON Customer address_id address address_id s INNER JOIN inventory ON rental inventory_id inventory inventory id 6 INNER JOIN film ON inventory film_id film film_id 7 WHERE rental return_date IS NULL g s 100 AND rental_date INTERVAL film rental_duration DAY lt CURRENT_DATE LIMIT 54 99 key PRIMARY address id Mtached_conahor ira sahta rental return attached condition 1 rental isnulf sakila rental return_date atlached_condition 2 fiim Csakis rontal rontal dato interval sakila film rental_duration day lt lt cache gt curdate Result 3 Explain Improved Server Status Additional server status information was added and the user interface was improved Select Server Status from the Management tab to open this window 13 Improved Server Status Figure 2 12 Server Status Workbench 5 2 Server Status SERVER HEALTH eo i Host 127 0 0 1 Server 5 6 10 Status Running Usage Traffic 1833 KB s Query Cache Nitrate COOK Key A BIK CONNECTIONS 7 s S G ie User Host Command Time State info 2596 root localhost 56321 Sleep 2597 root focalhost 56322 Sleep None 2608 root focalhost 56370 Sleep None 2609 root focalhost 56372 i Sle
335. es active in this section TABLE_NAME Variable TABLES The table name TABLE_ID Variable TABLES The table ID COLUMNS_LISTING Section TABLES Marks the start and end of a COLUMNS _LISTING section the COLUMNS LISTING data dictionary becomes active in this section COLUMNS COLUMN_KEY COLUMNS_LISTING Variable COLUMNS Marks the start and end of a COLUMNS section the COLUMNS data dictionary becomes active in this section Whether the column is a primary key COLUMN_NAME Variable COLUMNS The column name COLUMN_DATATYPE Variable COLUMNS The column data type COLUMN_NOTNULL COLUMN_DEFAULTVALUE Variable COLUMNS Variable COLUMNS Whether the column permits NULL values The column default value COLUMN_COMMENT Variable COLUMNS The column comment COLUMN_ID Variable COLUMNS The column ID COLUMN_KEY_PART COLUMN_NULLABLE Variable COLUMNS if detailed COLUMNS if detailed Variable The column key type Can the column contain NULL values 171 Supported Template Markers Marker text Type Data Dictionary or Parent Corresponding data Dictionary COLUMN_AUTO_INC Variable COLUMNS if detailed Does the column auto increment COLUMN_CHARSET Variable COLUMNS if detailed The column character set COLUMN_COLLATION Variable COLUMNS if detailed The column collation COLUMN_IS_USERTY
336. esignated place then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code even though third parties are not compelled to copy the source along with the object code 5 A program that contains no derivative of any portion of the Library but is designed to work with the Library by being compiled or linked with it is called a work that uses the Library Such a work in isolation is not a derivative work of the Library and therefore falls outside the scope of this License However linking a work that uses the Library with the Library creates an executable that is a derivative of the Library because it contains portions of the Library rather than a work that uses the library The executable is therefore covered by this License Section 6 states terms for distribution of such executables When a work that uses the Library uses material from a header file that is part of the Library the object code for the work may be a derivative work of the Library even though the source code is not Whether this is true is especially significant if the work can be linked without the Library or if the work is itself a library The threshold for this to be true is not precisely defined by law If such an object file uses only numerical parameters data structure layouts and accessors and small macros and small inline functions ten lines or less in length then the use of th
337. est FreeTDS sources from ftp ftp freetds org pub freetds and place it in the freetds directory Make sure to get version 0 92 or newer cd freetds Execute build_freetds sh After compilation is done install it using make install from the path given by the script oN ODO Install the driver in the ODBC Administrator to make the ODBC subsystem to recognize it The name of the driver file is 1ibtdsodbc so and is located in usr lib or usr local lib Once the driver is installed you should be able to create data sources for it from the ODBC Administrator GUI Protocol version selection in FreeTDS R When using FreeTDS TDS_VERSION 7 0 is needed in the connection string If you pick a FreeTDS specific connection method option in the connection dialog that option is added to the connection string automatically Mac OS X See the FreeTDS setup notes for Linux 11 4 3 Connection Setup Using an ODBC DataSource Using Connection Parameters 11 4 4 Microsoft SQL Server Type Mapping Table 11 2 Type mapping Source Type MySQL Type Comment INT INT TINYINT TINYINT UNSIGNED flag set in MySQL SMALLINT SMALLINT BIGINT BIGINT BIT TINYINT 1 FLOAT FLOAT Precision value is used for storage size in both REAL FLOAT NUMERIC DECIMAL DECIMAL DECIMAL MONEY DECIMAL 216 Microsoft SQL Server Type Mapping Source Type MySQL T
338. est_copy locking lock all Cosy ing Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying done Source on localhost connected Destination on localhost connected database util_test renamed as util_test_copy TABLE util_test t1l table data TABLE util_test t2 table data TABLE util_test t3 table data TABLE util_test t4 table data VIEW util_test vl TRIGGER util_test trg PROCEDURE util_test pl FUNCTION util_test f1 EVENT util_test el GRANTS from util_test To copy one or more databases from a master to a slave you can use the following command to copy the databases Use the master as the source and the slave as the destination 271 mysqldbexport Export Object Definitions or Data from a Database wn mysqldbcopy source root localhost 3310 destination root localhost 3311 test123 rpl master rpl user rpl Source on localhost connected Destination on localhost connected Source on localhost connected Stopping slave Copying database test123 Copying TABLE test123 t1 Copying data for TABLE test123 t1l Connecting to the current server as master Starting slave done To copy a database from one slave to another attached to the same master you can use the following command using the slave with the database to be copied as the source and the slave where the database needs to copie
339. etcane caeuent ay ences caunens siegiecaad abewene Gs E NANa N EEA SK Di UNCER o 237 T4 et Prelate cece sc sezae tahun val enana n ea E E A vanaesgadeclh diab T on vekteeceagecens 237 14 2 INntroduCti N vscscuccasseekaceenstecaaaeseddeasanscatueegeuastiwndncea sete adsonsecetan ns Guwedaancatia eniesacaandecalataweeesaienee 238 14 2 1 Introduction to MySQL Utilities eee cece eee ee eeee eter tees ee aa ee teeeeeeeeeeeaaaaeeneereeeees 238 14 2 2 Connection Parameters cece ceee cece cece ee cece ee cece aa ee cece eens cesses eeeeeeaaeeeeeeaaneeeeeaaeneeeea 239 14 2 3 Introduction to extending the MySQL Utilities 0 nee 239 14 3 COMMANGS iscseedidesensianunsseoencatsedancs ise senntuaeacantintdaastupsedtatansennedtsveaadiasbeaslansmecaatastenamaaeoanaanines 245 14 3 1 mysql utilities command grep Search Databases for Objects 245 14 3 2 mysql utilities command proc Search Processes On Servers s a s 246 14 4 Manual Pages divi eceeieteiciiet a acteedintern habs doete ieee Ihe deal enrages eaa iaaah 248 14 4 1 MySQL Utilities Overview Brief overview of command line utilities c 248 14 4 2 mysqlauditadmin Allows users to perform maintenance action on the audit LOO gist ete A E OE E angenwe ine dada A E E A ed av badinalsesgaraseeeth aiaundateven 250 14 4 3 mysqlauditgrep Allows users to search the current or an archived audit log 254 14 4 4 mysqldbcompare Compare Two Da
340. eters and Advanced configuration options This connection definition may be saved using the Store connection for future use as option and there is also the Test Connection option Target Connection Setup The MySQL Server that will be home to the newly migrated database 11 7 2 Schemata Retrieval and Selection General thoughts Fetch Schemata List The names of available schemas will be retrieved from the source RDBMS The account used for the connection will need to have appropriate privileges for listing and reading the schemas you want to migrate Target RDBMS connection settings will also be validated The steps that are performed include connects to the source DBMS checks the connection and retrieves the schema list from the source Schemata Selection Select the schemata that you want to migrate 11 7 3 Reverse Engineering This is an automated step where the actions include Connect to the source DBMS Reverse engineer the selected schemata and perform post processing if needed 11 7 4 Object Selection By default all table objects will be migrated Use the Show Selection button in order to disable individual table objects from being migrated 222 Migration 11 7 5 Migration Reverse engineered objects from the source RDBMS will be automatically converted to MySQL compatible objects Default datatype and default column value mappings will be used You will be able to review and edit the generated objects
341. exporting only events by excluding all other types Similarly to skip creation of UPDATE statements for BLOB data specify the skip blobs 276 option To specify how to display output use one of the following values with the format 275 option sql default Display output using SQL statements For definitions this consists of the appropriate CREATE and GRANT statements For data this is an INSERT statement or bulk insert if the bulk insert 274 option is specified grid Display output in grid or table format like that of the mysql monitor e CSV 272 mysqldbexport Export Object Definitions or Data from a Database Display output in comma separated values format e tab Display output in tab separated format e vertical Display output in single column format like that of the G command for the mysql monitor To specify how much data to display use one of the following values with the di splay 274 option e brief Display only the minimal columns for recreating the objects e full Display the complete column list for recreating the objects e names Display only the object names Note For SQL format output the display 274 option is ignored To turn off the headers for csv or tab display format specify the no headers 275 option To turn off all feedback information specify the quiet 275 option To write the data for individual tables to separate files use the file per t
342. ff for models containing large numbers of schemata and tables Show Metadata Schemata By default metadata schemata are not displayed To display them for example to troubleshoot or check metadata information select this option DBMS connection keep alive interval in seconds When executing long running queries over a slow connection you may need to increase this value to prevent the connection being lost Defaults to 600 54 The SQL Queries Tab DBMS connection read time out in seconds Maximum amount of time that the query can take to return data from the DBMS Defaults to 600 Productivity The query results properties that can be set include the following e Enable Code Completion in Editors The SQL Editor offers Auto complete functionality by either pressing the keyboard shortcut Modifier Space or it will start automatically if the Automatically Start Code Completion preference is enabled Automatically Start Code Completion Enabled by default this will automatically execute the code auto completion feature while editing SQL in the SQL Editor If disabled you will instead use the keyboard shortcut Modifier Space to execute the auto completion routine Reformat DDL for Views Whether to automatically reformat the View DDL that is returned by the MySQL Server Note R The MySQL Server does not store the formatting information for View definitions e Max syntax error count Large complex script
343. fines the SQL_MODE used by Forward Engineering and Synchronization 6 4 7 The Diagram Tab Use this tab to determine display settings for an EER diagram 60 The Appearance Tab Figure 6 8 The Diagram Preferences w Workbench Preferences General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance All Objects Z Expand New Objects Propagate Object Color Changes to All Diagrams bles Z Show Column Types Max Length of ENUMs and SETs to Display 20 C Show Column Flags Max Number of Columns to Display 30 Larger tables will be truncated Routines Trim Routine Names Longer Than 20 characters Relationships Connections _ Draw Line Crossings slow in large diagrams 7 Hide Captions _ Center Captions Over Line Select whether to expand new objects by checking the Expand New Objects check box and select whether to draw line crossings by checking the Draw Line Crossings check box This tab also enables you to set the maximum number of characters for the following items e Column Names e Column Types Routine Names Changes to these values change the display properties only not the objects themselves 6 4 8 The Appearance Tab Use this tab to set the available colors for the objects that appear on an EER diagram canvas You can also add colors if you wish 61 The Appearance Tab Figure 6 9 The Appearance Preferences F Workbench
344. finitions of objects on server2 like the definitions of the corresponding objects on server1 The default direction is server1 You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to access all objects in the operation If the utility is to be run on a server that has binary logging enabled and you do not want the comparison steps logged use the disable binary logging 264 option OPTIONS mysqldbcompare accepts the following command line options e help Display a help message and exit e changes for lt direction gt Specify the server to show transformations to match the other server For example to see the transformation for transforming object definitions on server1 to match the corresponding definitions on server2 use changes for server1 263 Permitted values are server1 and server2 The default is server 263 mysqldbcompare Compare Two Databases and Identify Differences difftype lt difftype gt d lt difftype gt Specify the difference display format Permitted format values are unified context differ and sql The default is unified disable binary logging If binary logging is enabled disable it during the operation to prevent comparison operations from being written to the binary log Note Disabling binary logging requires the SUPER privilege format lt format gt f lt format gt Specify the display
345. following command line options e help Display a help message and exit changes for lt direction gt Specify the server to show transformations to match the other server For example to see the transformation for transforming object definitions on server1 to match the corresponding definitions on server2 use changes for server1 284 Permitted values are server1 and server2 The default is server difftype lt difftype gt d lt difftype gt Specify the difference display format Permitted format values are unified context differ and sql The default is unified force Do not halt at the first difference found Process all objects to find all differences quiet q Do not print anything Return only an exit code of success or failure server1 lt source gt Connection information for the first server in the format lt user gt lt passwa gt lt hosb lt port gt lt socket gt or lt login path gt lt port gt lt socket gt server2 lt source gt Connection information for the second server in the format lt users lt passwd gt lt host gt lt port gt lt socket or lt login path gt lt port lt socket gt show reverse Produce a transformation report containing the SQL statements to conform the object definitions specified in reverse For example if changes for 284 is set to server1 also generate the transformation for server2 Note The reverse changes ar
346. format for changed or missing rows Permitted format values are grid csv tab and vertical The default is grid quiet q Do not print anything Return only an exit code of success or failure run all tests a Do not halt at the first difference found Process all objects server1 lt source gt Connection information for the first server in the format lt user gt lt passwa gt lt hosb lt port gt lt socket gt or lt login path gt lt port gt lt socket gt server2 lt source gt Connection information for the second server in the format lt users lt passwd gt lt host gt lt port gt lt sockets or lt ogin path gt lt port gt lt socket gt show reverse Produce a transformation report containing the SQL statements to conform the object definitions specified in reverse For example if changes for is set to server1 also generate the transformation for server2 Note The reverse changes are annotated and marked as comments skip data check Skip the data consistency check skip diff Skip the object definition difference check Skip object compare Skip the object comparison check skip row count Skip the row count check Span key size lt number of bytes to use for key gt Change the size of the key used for compare table contents A higher value can help to get more accurate results comparing large databases but may slow the algorithm Default value is 8
347. format of the log file includes the date and time of the event the level of the event informational INFO warning WARN error ERROR critical failure CRITICAL and the message reported by the utility The interface provides the user with a number of options for displaying additional information The user can choose to see the replication health report default or choose to see the list of GTIDs in use the UUIDs in use and if logging is enabled the contents of the log file Each of these reports is described below health Display the replication health of the topology This report is the default view for the interface By default this includes the host name port role MASTER or SLAVE of the server state of the server UP is connected WARN not connected but can ping DOWN not connected and cannot ping the GTID_MODE and health state The master health state is based on the following if GTID_MODE ON the server must have binary log enabled and there must exist a user with the REPLICATE SLAVE privilege The slave health state is based on the following the IO_ THREAD and SQL_THREADS must be running it must be connected to the master there are no errors the slave delay for non gtid enabled scenarios is not more than the threshold provided by the max position 293 and the slave is reading the correct master log file and slave delay is not more than the seconds behind 293 threshold option At each interval if
348. format output sql Display SQL transformation statement output The changes for 284 option controls the direction of the difference by specifying the object to be transformed in either the difference report default or the transformation report designated with the difftype sql 284 option Consider the following command mysqldiff serverl root host1l server2 root host2 difftype sql dbl tablel dbx table3 283 mysqldiff Identify Differences Among Database Objects The leftmost database db1 exists on the server designated by the server1 284 option host1 The rightmost database dbx exists on the server designated by the server2 284 option host 2 e changes for server1 284 Produce output that shows how to make the definitions of objects on server1 like the definitions of the corresponding objects on server2 changes for server2 284 Produce output that shows how to make the definitions of objects on server2 like the definitions of the corresponding objects on server1 The default direction is server1 For sql difference format you can also see the reverse transformation by specifying the show reverse 284 option The utility stops on the first occurrence of missing objects or when an object does not match To override this behavior specify the force 284 option to cause the utility to attempt to compare all objects listed as arguments OPTIONS mysqldiff accepts the
349. formation e Snippets e Schemas The following sections describe each panel in more detail 7 7 5 1 Snippets panel The Snippets sidebar offers both built in and custom snippets The sidebar contains a select box with My Snippets for custom snippets and built in options titled DB Mgmt Database Management SQL DDL SQL Data Definition Language and SQL DML SQL Data Manipulation Language Snippets may be given names and these snippets can be viewed and edited from the Snippets sidebar To load a snippet into the SQL Query area either choose the Snippets Insert icon or right click on the desired snippet and choose Insert Double click a snippet to open an edit context to edit the snippet body or title This example shows two snippets with only the first having defined a name 77 Sidebar Figure 7 12 SQL Editor Snippets Palette Snippets ww My Snippets a Aa Select Stuff Jo S SELECT name code FROM Country C ean 7 7 5 2 Session and Object Information Panel This panel summarizes the current connection to the server Figure 7 13 SQL Editor Connection Information Palette Object Info Session Connection Name localhost Host localhost Port 3306 Server MySQL Version 5 5 15 log Login User root Current User root localhost This panel also summarizes information about the object 78 Sidebar Figure 7 14 SQL Editor Object Info Object Info Session Table actor C
350. formation about this menu item see Section 8 5 1 5 3 The Object Notation Submenu Relationship Notation For information about this menu item see Section 8 5 1 5 4 The Relationship Notation Submenu Diagram Properties and Size Opens a diagram size dialog box that enables you to adjust the width or height of the canvas The unit of measure is pages the default value is two When you have tables with numerous columns use this menu item to increase the size of the EER Validation For information about this menu item see Section 8 5 1 5 2 The Validation Submenus Commercial Version Commercial version only Model Options Sets options at the model level These options should not be confused with the options that are set globally for the Workbench application and which are referred to as Workbench Preferences The available model options are a subset of the Workbench Preferences options For more information about Workbench Preferences see Section 6 4 5 The Model Tab The DBDoc Model Reporting Dialog Window Commercial Version This dialog window is found by navigating to the Model menu and choosing the DBDoc Model Reporting item Note R The DBDoc Model Reporting item is not available in the MySQL Workbench OSS version Use this dialog window to set the options for creating documentation of your database models For more information see Section 8 11 The DBDoc Model Reporting Dialog Windo
351. formation file on the slave The default is master info read from the data directory Note This option requires that you run the utility on the slave and that you have appropriate read access for the file e quiet q 318 mysqlrplcheck Check Replication Prerequisites NOTES Turn off all messages for quiet execution Note Errors and warnings are not suppressed e show slave status s Display the values from SHOW SLAVE STATUS on the master e slave lt source gt Connection information for the slave server in the format lt user gt lt passwa gt lt host gt lt port gt lt socket gt or lt login path gt lt port gt lt socket gt e Suppress Suppress warning messages e verbose V Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit e width lt number gt Change the display width of the test report The default is 75 characters The login user must have the appropriate permissions to execute SHOW SLAVE STATUS SHOW MASTER STATUS and SHOW VARIABLES on the appropriate servers Mixing IP and hostnames is not recommended The replication specific utilities will attempt to compare hostnames and IP addresses as aliases for checking slave connectivity to the master However if your installation does not support reverse name lo
352. fy how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug version Display version information and exit This utility is available as of u 1 2 0 This utility can only be applied to servers with the audit log plugin enabled And the audit log plugin is available as of MySQL Server versions 5 5 28 and 5 6 10 This utility requires the use of Python version 2 6 or higher but does not support Python 3 Single or double quote characters respectively or can be used around option values In fact quotes are required to set some options values correctly such as values with whitespace For example to specify the event types Create DB and Drop DB for the event type option the following syntax must be used vent type Create DB Drop DB or event type Create DB Drop DB EXAMPLES To display the audit log file statistics and output the results in CSV format run the following command shell gt mysqlauditgrep file stats format CSV SERVER data audit log Audit Log File Statistics File Size Created Last Modified cwe e lec QlOl wan Se 27 Isesseiil 2Oil2 We Cee iil I 7shtosss 2012 Audit Log Startup Entries 258 mysqlauditgrep Allows users to search the current or an archived audit log SERVER_ID STARTUP_OPTIONS NAME TIMESTAMP MYSQL_VERSION OS_VERSION VERSION 1 SERVER sql mysqld def
353. gle column format like that of the G command for the mysq1 monitor 4 RAW Display output results in the original raw format of the audit log records which is written in XML Standard SQL Pattern Matching The simple patterns defined by the SQL standard enables users to use two characters with special meanings percent matches zero or more characters and _ underscore matches exactly one arbitrary character In standard SQL these types of patterns are used with the LIKE comparison operator and they are case insensitive by default This utility assumes that they are case insensitive For example audits Match any string that starts with audit Match any string consisting of one or more characters For documentation about the standard SQL pattern matching syntax see Pattern Matching REGEXP Pattern Matching POSIX Standard REGEXP patterns are more powerful than the simple patterns defined in the SQL standard A regular expression is a string of ordinary and special characters specified to match other strings Unlike SQL Patterns REGEXP patterns are case sensitive The REGEXP syntax defines the following characters with special meaning Match any character e A Match the beginning of a string 255 mysqlauditgrep Allows users to search the current or an archived audit log Match the end of a string Match zero or more repetitions of the preceding regular expression Match one or m
354. gn key s from s s to s s fk name table name column name ref_table name ref_table primaryKey name auto_create_fks grt root wb doc physicalModels 0 catalog schemata 0 Creating a Plugin from a Script To create a plugin from an arbitrary script it is first necessary to make the file a module and export the required function from it It is then necessary to declare the module as a plugin and specify the return type and input arguments Mem Wiss Uiqeewe impor ort ModuleInfo DefineModule name AutoFK author John Doe version 1 0 ModuleInfo plugin sample createGuessedForeignKkeys caption Create Foreign Keys from ColumnNames input wbinputs objectOfClass db mysql schema groups Overview Utility ModuleInfo export grt INT grt classes db_mysql_Schema def auto_create_fks schema With the addition of the preceding code the auto_create_fks function is exported and will be added to the schema context menu in the model overview When invoked it receives the currently selected schema as its input 232 Chapter 13 Keyboard Shortcuts The following tables list keyboard shortcuts for MySQL Workbench commands Modifier in the tables stands for the platform specific modifier key This is Command on Mac OS X Control on other platforms On Mac OS X the Alt key is Option There are keyboard shortcut tables for the File Edit View Arrange Model Query Database Scripting Help and EER
355. gt a amp New Connection F New Server Instance Ej Edit Table Data m Create New EER Model H Manage Import Export i Edit SQL Script 5 Create EER Model From Existing Database Manage Security I 6 Manage Connections E gt Create EER Model From SQL Script g Manage Server Instances a 2 To administer your MySQL Server you must first create a Server Instance The instance contains information about the target server including how to connect to it From the MySQL Workbench Home window click New Server Instance The Create New Server Instance Profile wizard will be displayed 3 In this tutorial you will connect to a locally installed server so click Next 28 Administering a MySQL Server Figure 5 2 Getting Started Tutorial Specify Host Machine Create New Server Instance Profile Specify Host Machi Dean hegre ie Specify the Host Machine the Database Server is running on This wizard will guide you through the creation of a Server Profile to manage a MySQL server To Fully support Management of a remote MySQL server an SSH daemon must be running on the target machine Alternatively if you are going to manage a Windows server From a Windows computer you can also use native Windows management tools Remote management is used to start and stop a server and do server configuration You may create a Profile without remote management if you do not need that Functionality IF your database server is running on the
356. gt is optional and either lt port gt or lt socket gt must be provided e threads Use multiple threads for cross server copy The default is 1 e verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to access all objects in the operation To copy all objects from a source the user must have these privileges SELECT and SHOW VIEW for the database and SELECT for the mysql database To copy all objects to a destination the user must have these privileges CREATE for the database SUPER when binary logging is enabled for procedures and functions and GRANT OPTION to copy grants Actual privileges required may differ from installation to installation depending on the security privileges present and whether the database contains certain objects such as views or events and whether binary logging is enabled The new storage engine 269 and default storage engine 269 options apply to all destination tables in the operation Some option combinations may result in errors during the operation For example eliminating tables but not views may result in an error a the view is copied The rp1 269 option is not valid fo
357. guage style IDEF1X The ICAM DEFinition language information modeling method To view the different styles set up a relationship between two or more tables and choose the different menu items The relationship notation style that you choose persists for the duration of your MySQL Workbench session and is saved along with your model When MySQL Workbench is restarted the relationship notation reverts to the default the Crow s Foot style style first Changing notation styles after objects have been placed on a diagram can significantly change the appearance of the diagram Note R If you plan to export or print an EER diagram be sure to decide on a notation 8 5 1 6 The Database Menu The Database menu has these items Query Database Launches the SQL Editor which enables you to create SQL code and execute it on a live server For more information see Section 7 7 SQL Editor Manage Connections Launches the Manage DB Connections dialog which enables you to create and manage multiple connections For more information see Section 7 6 Manage DB Connections Dialog Reverse Engineer Creates a model from an existing database For more information see Section 8 7 9 2 Reverse Engineering a Live Database Forward Engineer Creates a database from a model For more information see Section 8 7 10 2 Forward Engineering to a Live Server Synchronize with Any Source Allows you to compare a target database or
358. h name e Plugin directory path name e Configuration file location and name e Current binary log coordinates file name and position e Current relay log coordinates file name and position This utility can be used to see the diagnostic information for servers that are running or offline If you want to see information about an offline server the utility starts the server in read only mode In this case you must specify the basedir 827 datadir 328 and st art 328 options to prevent the utility from starting an offline server accidentally Note Be sure to consider the ramifications of starting an offline server on the error and similar logs It is best to save this information prior to running this utility To specify how to display output use one of the following values with the format 328 option grid default Display output in grid or table format like that of the mysql monitor e csv Display output in comma separated values format e tab Display output in tab separated format e vertical Display output in single column format like that of the G command for the mysql monitor To turn off the headers for csv or tab display format specify the no headers 328 option To see the common default settings for the local server s configuration file use the show defaults 828 option This option reads the configuration file on the machine where the utility is run not the machine for the host that the server 328
359. hat will become available in the future All editions of MySQL Workbench are based on the Community Edition and all future improvements to the base framework and feature set will be included in this version The Community Edition is a full feature product that puts a powerful database management tool into the hands of the MySQL community The Standard Edition The Standard Edition is a commercial extension that builds on top of the OSS Edition and adds modules and plugins enabling an optimized work flow The highlights of this edition are e MySQL Specific Schema Validation e Model Validation e General Schema Validation e DBDoc DBDoc provides the following features e Document complex database schemata e Document all SQL object types e Document output available in different file formats A comparison of edition features can be found at MySQL Workbench Developer Central 17 18 Chapter 4 Installing and Launching MySQL Workbench Table of Contents 4 1 Hardware Requirements scsccceieesccibs el uatecectiandeed E edeesnatayesnepebessadetgsiaegetestaatilyees 4 2 Software Requirements cccccceeeee cece cece eee teeter tees eae ee ee esse ee aa aa eeeeeeeeeeeaeaaeeneeeeeeeeeaeaaea 4 3 Starting MySQL Workbench ccccecccceeeeee cece cece eee ee ener esse eae ea neeeeeeeeeaeaaeaceeeeeeeeeaeaaaaneeeeeees 4 3 1 Installing MySQL Workbench on Windows ccceeeeeeeeeeeee eee ee eeeeeeeeee ee aaaaeeeeee
360. have the same storage engines available the same default storage engine and the same InnoDB storage engine mysqlreplicate master root localhost 3306 slave root localhost 3307 rpl user rpl rpl vv pedantic master on localhost connected slave on localhost connected master id 2 slave id 99 Checking InnoDB statistics for type and version conflicts Checking storage engines Checking for binary logging on master Setting up replication Flushing tables on master with read lock Connecting slave to master CHANGE MASTER TO MASTER_HOST omitted 308 mysql rpladmin Administration utility for MySQL replication Starting slave status Waiting for master to send event error 0 Unlocking tables on master donet The following command starts replication from the current position of the master which is the default mysqlreplicate master root localhost 3306 slave root localhost 3307 rpl user rpl rpl master on localhost connected slave on localhost connected Checking for binary logging on master Setting up replication done The following command starts replication from the beginning of recorded events on the master mysqlreplicate master root localhost 3306 slave root localhost 3307 rpl user rpl rpl start from beginning master on localhost connected slave on localhost conn
361. he frm file Instead it attempts to read the contents of the file byte by byte and forms a best effort approximation of the CREATE statement Due to the many complexities of the server code the diagnostic mode does not currently process all features of a table Future revisions will improve the accuracy of the diagnostic mode 14 7 1 3 4 If the diagnostic mode is only a best effort compilation why use it The diagnostic mode is used to attempt to read corrupt or otherwise damaged frm files You would also use it if you had no access to a server installation on the local machine 14 7 1 3 5 Why does the default mode require a server The default mode uses a server to create a temporary working copy of the server instance It does not access the donor server in any way other than to execute the mysqld exe process 14 7 1 3 6 Can the frm reader read any frm file While it can read most frm files there are known limits to which storage engines it can process correctly Currently tables with storage engines partition and performance_schema cannot be read However these frm files can be read by the diagnostic mode 14 7 1 3 7 My frm files are tucked away in a restricted folder How do I get access to them to run the frm reader without copying or modifying file privileges You can use elevated privileges such as su or sudo to execute the frm reader You must use the user option to specify a user to launch the spawned server
362. he Library does 1 You may copy and distribute verbatim copies of the Library s complete source code as you receive it in any medium provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty keep intact all the notices that refer to this License and to the absence of any warranty and distribute a copy of this License along with the Library You may charge a fee for the physical act of transferring a copy and you may at your option offer warranty protection in exchange for a fee 2 You may modify your copy or copies of the Library or any portion of it thus forming a work based on the Library and copy and distribute such modifications or work under the terms of Section 1 above provided that you also meet all of these conditions a The modified work must itself be a software library b You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change c You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License d If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility other than as an argument passed when the facility is invoked then you must make a good faith effort to ensure that in the event an application does not supply such function or table the f
363. he export and the CHANGE MASTER followed by the START SLAVE statements are placed after the export stream both 273 mysqldbexport Export Object Definitions or Data from a Database Include both the master and slave information for CHANGE MASTER statements for either spawning a new slave with the current server s master or using the current server as the master All statements generated are labeled and commented to enable the user to choose which to include when imported To include the replication user in the CHANGE MASTER statement use the rpl user 275 option to specify the user and password If this option is omitted the utility attempts to identify the replication user In the event that there are multiple candidates or the user requires a password these statements are placed inside comments for the CHANGE MASTER statement You can also use the comment rp1 274 option to place the replication statements inside comments for later examination If you specify the rp1 file 275 option the utility writes the replication statements to the file specified instead of including them in the export stream If you attempt to export databases on a server with GTIDs enabled GTID_MODE ON a warning will be generated if the export does not include all databases This is because the GTID statements generated include the GTIDs for all databases and not only those databases in the export The utility will also generate a wa
364. he master This executes the appropriate STOP and START slave statements The STOP SLAVE statement is executed at the start of the copy and the CHANGE MASTER followed by the START SLAVE statements are executed after the copy slave Include the CHANGE MASTER statement to start a new slave using the current server s master information This executes the appropriate STOP and START slave statements The STOP SLAVE statement is executed at the start of the copy and the CHANGE MASTER followed by the START SLAVE statements follow the copy To include the replication user in the CHANGE MASTER statement use the rpl user 269 option to specify the user and password If this option is omitted the utility attempts to identify the replication user In the event that there are multiple candidates or the user requires a password the utility aborts with an error If you attempt to copy databases on a server with GTIDs enabled GTID_ MODE ON a warning will be generated if the copy does not include all databases This is because the GTID statements generated include the GTIDs for all databases and not only those databases in the export The utility will also generate a warning if you copy databases on a GTID enabled server but use the skip gtid 269 option To make the most use of GTIDs you should copy all of the databases on the server with the all 269 option OPTIONS mysqldbcopy accepts the following command line options e help
365. he names of all columns in a model Consider the following template as an attempt to achieve this Report Column Name COLUMN_NAME This template produces no output even for a model that contains many columns In this example the only data dictionary active is the main dictionary However COLUMN_NAME is stored in the COLUMNS data dictionary which is associated with the COLUMNS section With this knowledge the template can be improved as follows COLUMNS Column Name COLUMN_NAME COLUMNS 168 Supported Template Markers This still does not produce output To see why see Table 8 1 Data Dictionaries Tree The COLUMNS data dictionary has the parent dictionary COLUMNS_LISTING COLUMNS_LISTING has the parent TABLES which has the parent SCHEMATA whose parent is the main dictionary Remember that for a dictionary to be involved in variable lookup its associated section must currently be active To achieve the desired output the template must be something like the following SCHEMATA TABLES COLUMNS_LISTING COLUMNS Column Name COLUMN_NAME COLUMNS COLUMNS_LISTING TABLES SCHEMATA The following template is the same but with explanatory comments added Main dictionary active SCHEMATA SCHEMATA dictionary active TABLES TABLES dictionary active COLUMNS_LISTING COLUMNS_LISTING dictionary active
366. hed to do so subject to the following conditions The above copyright notice and this permission notice including the next paragraph shall be included in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE A 23 PyCrypto License The following software may be included in this product PyCrypto The Python Cryotography Toolkit Distribute and use freely there are no restrictions on further dissemination and usage except those imposed by the laws of your country of residence This software is provided as is without warranty of fitness for use or suitability for any purpose express or implied Use at your own risk or not at all Incorporating the code into commercial products is permitted you do not have to make source available or contribute your changes back though that would be nice amk www amk ca JE F K K k Re Re RR Re RR Re e k e A k k E ATE ULES rmd160 c CONTENTS A sample C implementation of the RIPEMD 160 hash function TARGET any compu
367. hem e Model Navigator Opens the Model Navigator palette e Catalog Opens the Catalog palette e Layers Opens the Layers palette User Datatypes Opens the User Datatypes palette e Object Descriptions Opens the Description palette e Object Properties Opens the Properties palette e Undo History Opens the History palette Output Displays the console output The keyboard shortcut for this menu item is Control F2 Reset Window Layout Resets all windows to their default layout Zoom 100 The default level of detail of an EER diagram Zoom In Zooms in on an EER diagram Zoom Out Zooms out from an EER diagram The ability to zoom in on an EER diagram is also available using the slider tool in the Model Navigator palette See Section 8 5 9 The Model Navigator Panel Set Marker Bookmarks an object From the keyboard select the object you wish to bookmark then use the key combination Control Shift and the number of the marker 1 through 9 You may create up to nine markers Go To Marker Returns to a marker From the keyboard use the Control key and the number of the marker Toggle Grid Displays grid lines on an EER diagram Toggle Page Guides Toggles Page Guides 8 5 1 4 The Arrange Menu The Arrange menu items apply only to objects on an EER diagram canvas and are enabled only if an EER diagram view is active The Arrange menu has these items Align to Grid Aligns items on the canvas to the grid lines Bring to
368. her the menu item or the key combination Control Y Also find a Delete ob ject_name menu item for removing the currently selected object The keyboard command for this action is Control Delete You can also right click an object and choose the delete option from the pop up menu The Delete ob ject_name menu item behaves differently depending upon circumstances For example if an EER Diagram is active and a table on the canvas is the currently selected object a dialog box may open asking whether you want to remove the table from the canvas only or from the database as well For information about setting the default behavior when deleting from an EER Diagram see Section 6 4 5 The Model Tab Warning If the MySQL Model page is active the selected object is deleted from the catalog and there will be no confirmation dialog box Choose Edit Selected to edit the currently selected object You can also perform edits in a new window by selecting Edit Selected in New Window The keyboard shortcuts for Edit Selected and Edit Selected in New Window are Control E and Control Shift E respectively The Select item has the following submenus Select All Keyboard shortcut Control A Selects all the objects on the active EER diagram e Similar Figures Objects of the same type Finds objects similar to the currently selected object e Connected Figures Finds all the objects connected to the currently selected object 87 Modeling M
369. her the relationship is one to one or one to many There is also a check box that enables you to specify whether the relationship is an identifying relationship 8 7 2 3 Connection Properties Right click a connection to select it When a connection is selected it is highlighted and its properties are displayed in the properties palette Connection properties are different from the properties of other objects The following list describes them caption The name of the connection By default the name is the name of the foreign key and the property is centered above the connection line captionXxOffs The X offset of the caption captionyOffs The Y offset of the caption comment The comment associated with the relationship drawSpl1it Whether to show the relationship as a continuous line endCapt ionxOf fs The X termination point of the caption offset endCaptionyOf fs The Y termination point of the caption offset extraCaption A secondary caption By default this extra caption is centered beneath the connection line extraCaptionxOffs The X offset of the secondary caption extraCaptionyoOffs The Y offset of the secondary caption mandatory Whether the entities are mandatory For more information see Section 8 7 2 2 The Relationship Editor many False if the relationship is a one to one relationship middleSegmentOffset The offset of the middle section of the connector modelOn1y Set when the conne
370. here indicated or by copying installing or otherwise using Python 1 6 1 Licensee agrees to be bound by the terms and conditions of this License Agreement ACCEPT 367 Python License CWI LICENSE AGREEMENT FOR PYTHON 0 9 0 THROUGH 1 2 Copyright ey UOdl Loos The Netherlands All rights reserved Permission to use COPY A MOCNE Stichting Mathematisch Centrum Amsterdam and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific permission STICHTING MATHEMATISCH CENTRUM DISCLAIM THIS SOFTWARE INCLUDING ALL IMPLIED WA FITNESS FOR ANY SPECIAL INDIRECT OR CONSEQUENT WHATSOEVER RESULTING FROM LOSS OF USE ACTION OF CONTRACT NEGLIGENCE OR OTHER OF OR IN CONNECTION WITH THE USE OR PER Licenses and Acknowledgements for Incor This section is an incomplete but grow written prior S ALL WARRANTIES WITH REGARD TO RRANTIES OF MERCHANTABILITY AND IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE IAL DAMAGES OR ANY DAMAGES DATA OR PROFITS WHETHER IN AN TORTIOUS ACTION ARISING OUT FORMANCE OF THIS SOFTWARE porated Software i
371. hing processes like the KILL CONNECTION statement kill query Kill the query for all matching processes like the KILL QUERY statement match command lt pattern gt Match all processes where the Command field matches the pattern match db lt pattern gt Match all processes where the Db field matches the pattern match host lt pattern gt Match all processes where the Host field matches the pattern match info lt pattern gt Match all processes where the Info field matches the pattern 304 mysqlprocgrep Search Server Process Lists match state lt pattern gt Match all processes where the State field matches the pattern match user lt pattern gt Match all processes where the User field matches the pattern print Print information about the matching processes This is the default if no ki1l11 connection 304 or kill query 304 option is given If a kill option is given print 305 prints information about the processes before killing them regexp basic regexp G Perform pattern matches using the REGEXP operator The default is to use LIKE for matching This affects the mat ch xxx options Server lt source gt Connection information for a server to search in the format lt user gt lt passwd gt lt host gt lt port gt lt sockets or lt login path gt lt port gt lt socket gt Use this option multiple times to search multiple servers sql prin
372. however This will permit the frm reader to read the original frm file and copy it to the spawned server and access the copy without requiring additional privileges 14 7 1 3 8 Will the default mode display a 100 accurate CREATE statement For most tables and all views yes However there are at least two features that are not stored in the frm file and therefore will not be included These are autoincrement values and foreign keys That being said the CREATE statement produced will be syntactically correct 339 MySQL Utilities copy_server py sample 14 7 2 MySQL Utilities copy_server py sample Copyright c 2010 2013 Oracle and or its affiliates All rights reserved This program is free software you can redistribute it and or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program if not write to the Free Software Foundation InG Bil Erankiin Sie iwsliciela Eloot Boston MWA O2IIO 1SGOil ws This file contains an example of how to build a customized utility using the MySQL Utilities scripts and libraries import
373. hows which variables are defined in which sections The variable should be used in its correct section or its value will not be displayed If a variable t ype is a variable then the table describes its data dictionary and a parent dictionary if type is a section Also remember that the data dictionaries used to perform variable lookups form a hierarchical tree so it is possible to use a variable in achild section that is defined in a parent section Table 8 2 Supported Template Markers Marker text Type Data Dictionary or Parent Dictionary Corresponding data TITLE Variable MAIN Title of the report GENERATED Variable MAIN Date and time when the report was generated STYLE_NAME Variable MAIN The name of the style selected in MySQL Workbench this is typically used to load the corresponding CSS file depending on the name of the style selected in MySQL Workbench SCHEMA_COUNT Variable MAIN The number of schemata in the model PROJECT_TITLE Variable MAIN Project title as set for the model in Document Properties PROJECT_NAME Variable MAIN Project name as set for the model in Document Properties PROJECT_AUTHOR Variable MAIN Project author as set for the model in Document Properties PROJECT_VERSION Variable MAIN Project version as set for the model in Document Properties PROJECT_DESCRIPTION Variable MAIN Proj
374. iable variable mysqlauditadmin accepts the following command line options audit log name lt AUDIT_LOG_FILE gt Full path and file name for the audit log file Used by the file stats 251 option and the copy command copy to lt COPY_DESTINATION gt The location to copy the specified audit log file The path must be locally accessible for the current user file stats Display the audit log file statistics help Display a help message and exit remote login lt REMOTE_LOGIN gt User name and host to be used for the remote login for copying log files It is defined using the following format lt user gt lt host or IP gt Usage will prompt for the password server lt SERVER gt Connection information for the server in the format lt user gt lt passwd gt lt host gt lt port lt socket or lt ogin path gt lt port gt lt socket gt show options 251 mysqlauditadmin Allows users to perform maintenance action on the audit log Display the audit log system variables value lt VALUE gt Value used to set variables based on the specified commands such as policy and rotate_on_size e server1 lt source gt Connection information for the first server in the format lt user gt lt passwa gt lt hosb lt port gt lt socket gt or lt login path gt lt port gt lt socket gt verbose V Specify how much information to display Use this option multipl
375. ibrary and explaining where to find the accompanying uncombined form of the same work 8 You may not copy modify sublicense link with or distribute the Library except as expressly provided under this License Any attempt otherwise to copy modify sublicense link with or distribute the Library is void and will automatically terminate your rights under this License However parties who have received copies or rights from you under this License will not have their licenses terminated so long as such parties remain in full compliance 354 GNU Lesser General Public License Version 2 1 February 1999 9 You are not required to accept this License since you have not signed it However nothing else grants you permission to modify or distribute the Library or its derivative works These actions are prohibited by law if you do not accept this License Therefore by modifying or distributing the Library or any work based on the Library you indicate your acceptance of this License to do so and all its terms and conditions for copying distributing or modifying the Library or works based on it 10 Each time you redistribute the Library or any work based on the Library the recipient automatically receives a license from the original licensor to copy distribute link with or modify the Library subject to these terms and conditions You may not impose any further restrictions on the recipients exercise of the rights granted herei
376. ibrary of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language Release 7 of PCRE is distributed under the terms of the BSD licence as specified below The documentation for PCRE supplied in the doc directory is distributed under the same terms as the software itself The basic library functions are written in C and are freestanding Also included in the distribution is a set of C wrapper functions THE BASIC LIBRARY FUNCTIONS Written by Philip Hazel Email local part phl0 Email domain cam ac uk University of Cambridge Computing Service Cambridge England Phone 44 1223 334714 Copyright c 1997 2006 University of Cambridge All rights reserved THE C WRAPPER FUNCTIONS Contributed by Google Inc Copycnignhti c 2006 sGoog lem ince All rights reserved THE BSD LICENCE Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met Redistributions of source code must retain the above COVE INE Mees ils Mase ore eond tions eye ENS following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of the University of Cambridge nor the name of Google Inc nor the names of th
377. ic default name for foreign keys To change the global default see Section 6 4 5 The Model Tab You can also add a secondary caption and a caption to a relationship The Visibility Settings section is used to determine how the relationship is displayed on the EER Diagram canvas Fully Visible is the default but you can also choose to hide relationship lines or to use split lines The split line style is pictured in the following figure Figure 8 17 The Split Connector Z tblpublishers fk_pub i A m tblbooks gt 117 Creating Foreign Key Relationships Note R A broken line connector indicates a nonidentifying relationship The split line style can be used with either an identifying relationship or a nonidentifying relationship It is used for display purposes only and does not indicate anything about the nature of a relationship To set the notation of a relationship use the Model menu Relationship Notation menu item For more information see Section 8 5 1 5 4 The Relationship Notation Submenu The Foreign Key Tab The Foreign Key tab contains several sections Referencing Table Cardinality and Referenced Table The Mandatory check boxes are used to select whether the referencing table and the referenced table are mandatory By default both of these constraints are t rue indicated by the check boxes being checked The Cardinality section has a set of radio buttons that enable you to choose whet
378. ick Next to continue Test DB Connection On this page MySQL Workbench tests your database connection and displays the results If an error occurs you are directed to view the logs which can be done by clicking the Show Logs button Management and OS Used to specify a remote management type and target operating system which is available when the Host Machine is defined as a remote host The SSH login based management option includes configuration entries for the Operating System and MySQL Installation Type SSH Configuration If you specified a Remote Host on the Specify Host Machine page you will be presented with the Host SSH Connection page that enables you to use SSH for the connection to the server instance This facility enables you to create a secure connection to remotely administer and configure the server instance You must enter the host name and user name of the account that will be used to log in to the server for administration and configuration activities If you do not enter the optional SSH Key for use with the server then you will be prompted for the password when the connection is established by MySQL Workbench 181 Manage Server Instances Dialog MySQL Server itself It is not the same as the connection used to connect to a Note R This connection is to enable remote administration and configuration of the server for general database manipulation wish to start or stop the server or edit its configuratio
379. if some inconsistencies are found e g errant transactions on slaves or SQL thread errors during servers checks By default the utility will only issue warnings if issues are found when checking slaves status during failover and will continue its execution unless this option is specified ping lt number gt Number of ping attempts for detecting downed server Note on some platforms this is the same as number of seconds to wait for ping to return Default is 3 seconds rpl user lt replication_user gt The user and password for the replication user requirement in the form lt user gt lt password gt or lt login path gt E g rpl passwd Default None script threshold lt return_code gt Value for external scripts to trigger aborting the operation if result is greater than or equal to the threshold Default None no threshold checking seconds behind lt seconds gt Used to detect slave delay The maximum number of seconds behind the master permitted before slave is considered behind the master Default 0 slaves lt slave connections gt Connection information for slave servers in the form lt users lt passwa gt lt hosb lt port gt lt socket gt or lt ogin path gt lt port gt lt socket gt List multiple slaves in comma separated list The list will be evaluated literally whereby each server is considered a slave to the master listed regardless if they are a slave of the master
380. iioc neninek na aa Aa eA sacks bey Mea lind RR A aa aeaa 180 10 3 Manage Data Import Export 0 cece cece teeter tetera teat tenants senate NENEA KANEEN RTENE 180 10 4 Manage SOCUIILY cctiseesstssgocassnieecesangecesanteedenseeieetantivecanaee aa aaan a a 180 10 5 Manage Server Instances ccceeeeceee cece ee ee ence eeee sete ee aaaa ee teeeeeeeeeaeaaaaeeeeeeeeeaeaaeaenees 180 10 6 Creating and Managing Server Instances ccccceeeeeeeeeeeeeeeeeeeaeaaeeteeeeeeeeeaeaaeaneeeeees 180 10 6 1 New Server Instance Wizard ccecceeceeeeeeeee teen ee aa ee eeeeeeeeeeeeaaaaeeeeeeeeeeeaeaaeaaes 180 10 6 2 Manage Server Instances Dialog cccceeeeeeneeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaeeees 182 10 7 Server Administration and Configuration 0 cccccceeeeeeeeeeeeeeeeeeeaeaaeeteeeeeeeeeaeaaeaneeeeeees 185 10 7 1 The Stantuo Tabien aseni ae aaae A E ae Aa aaia Eaa 186 10 7 2 The Configuration Tab sssssssssssennsessssssrsrnrrrrsssttnntnnrerastsnntnnrersssnntrnrerann 187 10 7 3 The ACCOUNTS TaD scrcas EA 189 10 7 4 The Connections Tab sssssssssssesesrssssssssretrrrsrsstsrttnrrrrsessntrnrernoessnennnenneennnn 191 MySQL Workbench 5 2 10 7 5 The Variables Tabirini R vaeebanlvewsehenweeeas 192 107 0 The Data Dump TaD eeren A nde teaneecesesmendees 193 TO 727 The LOgs Tab sieros S REE E ETERRA ARRENE 196 11 Database Migration WiZard ieee cece oaen RATAREA 199 11
381. ileges expands to include REPLICATION CLIENT REPLICATION SLAVE and SUPER 190 The Connections Tab These roles are available DBA Grants all privileges MaintenanceAdmin Grants privileges to maintain the server ProcessAdmin Grants privileges to monitor and kill user processes UserAdmin Grants privileges to create users and reset passwords SecurityAdmin Grants privileges to manage logins and grant and revoke server privileges MonitorAdmin Grants privileges to monitor the server DBManager Grants privileges to manage databases DBDesigner Grants privileges to create and reverse engineer any database schema ReplicationAdmin Grants privileges to set up and manage replication BackupAdmin Grants privileges required to back up databases 10 7 4 The Connections Tab The Connections tab lists all current connections to the monitored server 191 The Variables Tab Figure 10 8 Administrator Connections Tab Task and Object Browser Server Status MANAGEMENT INFO SYSTEM Ay Nene mysaido127 001 f Startup Shutdown X Host 127 0 0 1 Server E Status and System Variables A Server Logs SERVER HEALTH Status CPU 12 Mem 69 Connection Usage 5 Traffic 8 42 KB s CONFIGURATION fa Options File localhost 49171 localhost 53528 SECURITY localhost 53529 Users and Privileges localhost 55277 SHOW PROCESSLIST localhost 55278 DATA EXPORT RESTORE 3 Data Export and Restore WB
382. ill be used by Workbench mysqlworkbench to store information required on certain operations e Automatically Reopen Previous Model When Started Check this if you want the model on which you previously worked to be automatically reopened when you start MySQL Workbench e Force use of software rendering for EER diagrams MySQL Workbench will use OpenGL for rendering when available However due to faulty drivers problems do occasionally occur These issues can be resolved by selecting the software rendering option here e Model Undo History Size You can limit the size of the undo history here Set this value to 0 to have an unlimited undo history e Auto save model interval An open model that has not been saved will automatically be saved after this period On loading a model file MySQL Workbench will notify the user if the file was not previously saved correctly due to a crash or power failure MySQL Workbench can then attempt to recover the last auto saved version For automatic recovery to be available for a new file it will have to have been saved at least once by the user Save snapshot of open editors on close Enabling will save and reload the SQL Editor tabs after closing opening MySQL Workbench including after an unexpected crash e Auto save scripts interval Frequency of the auto saves Create new tabs as Query tabs instead of File By default opening a new SQL Editor tab opens as an SQL File tab Check this opt
383. imported before they can be used The following code snippet illustrates declaring a module that exports a single function from wb import import grt ModuleInfo DefineModule name MyModule author your name version 1 0 ModuleInfo export grt DOUBLE grt STRING grt LIST grt DOUBLE def printListSum message doubleList sum 0 for d in doublelList sum sum d print message sum return sum 12 3 Plugins Plugins are special Modules that are exposed to the user through the Workbench GUI This is typically done using the main menu or the context sensitive menu Much of the MySQL Workbench functionality is implemented using plugins for example table view and routine editors are native C plugins as are the forward and reverse engineering wizards The Administrator facility in MySQL Workbench is implemented entirely as a plugin in Python A plugin can be a simple function that performs some action on an input and ends without further interaction with the user Examples of this include auto arranging a diagram or making batch changes to objects To create a simple plugin the function must be located in a module and declared as a plugin using the plugin decorator of the ModuleInfo object Plugins can have an indefinite runtime such as when they are driven by the user through a graphical user interface This is the case for the object editors and wizards within MySQL Workbench Although the wizard type of plugin
384. in FAR 52 227 19 Commercial Computer Software License December 2007 Oracle USA Inc 500 Oracle Parkway Redwood City CA 94065 This software is developed for general use in a variety of information management applications It is not developed or intended for use in any inherently dangerous applications including applications which may create a risk of personal injury If you use this software in dangerous applications then you shall be responsible to take all appropriate fail safe backup redundancy and other measures to ensure the safe use of this software Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications Oracle is a registered trademark of Oracle Corporation and or its affiliates MySQL is a trademark of Oracle Corporation and or its affiliates and shall not be used without Oracle s express written authorization Other names may be trademarks of their respective owners This software and documentation may provide access to or information on content products and services from third parties Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third party content products and services Oracle Corporation and its affiliates will not be responsible for any loss costs or damages incurred due to your access to or use of third party content products or services This document in
385. in the next step Table data will be migrated in a later step as well This is an automated step where the actions include Create Script File Connect to Target Database and Create Schemata and Objects 11 7 9 Create Target Results Scripts to create the target schemas were executed but the data has not yet been migrated This step allows reviewing a creation report If there are any errors then you can manually fix the scripts and click Recreate Objects to retry the schema creation or return to the Manual Editing page to correct them there and then retry the target creation To edit first select the object and then the SQL CREATE Script will be shown for the selected object Edit it there then press Apply to save 223 Data Migration Setup 11 7 10 Data Migration Setup Provides additional options for data transfer including the ability to set up a script to automate this transfer in the future 11 7 11 Bulk Data Transfer The transfer is executed here 11 7 12 Migration Report Displays the final report that can be reviewed to ensure a proper migration was executed 11 8 MySQL Workbench Migration Wizard FAQ Frequently Asked Questions with answers Questions e 11 8 1 224 While using the Postgresq psqlodbc driver see the following error 08001 08001 Already connected 202 SQLDriverConnect Questions and Answers 11 8 1 While using the Postgresql psqlodbc driver see the following er
386. ind Text list You may also select any or all of the following check boxes e Match Case e Whole Word e Use Regular Expression e Search in Comments e Search in SQL for Views SPs etc Any text you enter into the Find Text list is retained for the duration of your session Use the Next or Previous buttons to find occurrences of your search criterion Clicking the Find All button opens a Find Results window anchored at the bottom of the application If you wish you may undock this window as you would any other Use this window to navigate to objects For example double clicking the Description of an object located on an EER diagram navigates to the specific diagram and selects the object Notice that the properties of the object are displayed in the Properties palette The Find dialog window can also be opened using the Control F key combination Use Control G to find the next occurrence and Control Shift G to find a previous occurrence Close the Find dialog window by clicking the x in the top right corner or by pressing the Esc key 89 Modeling Menus 8 5 1 2 2 Workbench Preferences This menu item enables you to set global preferences for the MySQL Workbench application For further information see Section 6 4 Workbench Preferences 8 5 1 3 The View Menu The View menu has these items Home Selects the Home window Windows A submenu with items that provide a means for opening the windows associated with t
387. ing Z Confirm Data Changes General Max query length to store in history in bytes Queries that exceed this size will not be saved in the history when executed The default is 65536 bytes and setting to 0 means there is no limit all queries will be saved e Continue on SQL Script Error Should an error occur while executing a script this option causes execution to continue for the remainder of the script Safe Updates Forbid UPDATEs and DELETEs with no key in WHERE clause or no LIMIT clause Requires connection This enables the sql_safe_updates MySQL Server option for the MySQL Workbench session Changing this option requires a reconnection to the server which can be performed by Query Reconnect to Server Progress status update interval When executing long running queries over a slow connection you may need to increase this value to prevent excess load on the connection Defaults to 500 milliseconds Online DDL Default algorithm for ALTER table The default algorithm selected when performing ALTER TABLE operations in MySQL Workbench The setting can also be adjusted for each ALTER TABLE operation Options include In Place preferred and Copy see the online DDL documentation for more information Added in MySQL Workbench 5 2 46 56 The Model Tab Default lock for ALTER table The default lock setting for allowing concurrent queries with ALTER TABLE in MySQL Workbench This setting
388. inners Users who are familiar with the various settings and parameters can also quickly create a new instance from the Manage Server Instances dialog discussed later The steps presented in the wizard are as follows 180 New Server Instance Wizard 1 Specify Host Machine N Database Connection w Test DB Connection gt A Management and OS 5 SSH Configuration 6 Windows Management 7 Test Settings 8 Review Settings 9 MySQL Config File 10 Specify Commands 11 Complete Setup Specify host machine On this page you can select Localhost if you intend to manage a server on your local machine If you select Remote Host you must provide the IP address or the network name of the remote server Or Take Parameters from Existing Database Connection utilizes a pre existing connection as defined within MySQL Workbench Click Next to continue Database Connection This page enables you to select a connection to a specific database The settings entered previously have been concerned with the connection to the server required for administrative purposes This page is concerned with connecting to a specific database You can either launch the Manage DB Connections dialog or select a pre existing connection from a list The former is most useful if you have not created any connections If you must create a connection at this point refer to Section 7 6 Manage DB Connections Dialog After a connection has been selected cl
389. ion if you prefer the simpler Query tabs that for example will not prompt to be saved when closed Added as of MySQL Workbench 5 2 45 52 The Administrator Tab Place Sidebar on the Right Side By default the Sidebar is placed on the left hand side of the MySQL Workbench application Select this option to place it on the right hand side Allow more than once instance of MySQL Workbench to run Disabled by default Interactive GRT Shell Language You can select the language to be used in the GRT Generic RunTime shell by choosing a language from the list Interactive GRT Shell Language Currently the choices are Lua and Python Python is the recommended option Internal Workbench Schema Defaults to mysqlworkbench 6 4 2 The Administrator Tab This section provides configuration options that affect the Administrator functionality in MySQL Workbench Path to mysqldump tool Path to your local mysqldump binary Leave it blank to use the bundled mysqldump binary Path to mysqli tool Path to your local mysql client binary Leave it blank to use the bundled mysql binary Export Directory Path Directory where your exported mysql dumps are located Figure 6 3 The Administrator Preferences Dialog Box Workbench Preferences General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance Data Export and Import Path to mysqldump Tool ee Leave blank to use bundled version Path to
390. iple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit NOTES The login user must have the appropriate permissions to execute SHOW SLAVE STATUS SHOW MASTER STATUS and SHOW VARIABLES on the appropriate servers as well as grant the REPLICATE SLAVE privilege The utility checks permissions for the master slaves and candidates at startup Mixing IP and hostnames is not recommended The replication specific utilities will attempt to compare hostnames and IP addresses as aliases for checking slave connectivity to the master However if your installation does not support reverse name lookup the comparison could fail Without the ability to do a reverse name lookup the replication utilities could report a false negative that the slave is not connected to the master For example if you setup replication using MASTER_HOST ubuntu net on the slave and later connect to the slave with mysqlrplcheck and have the master specified as master 192 168 0 6 using the valid IP address for ubuntu net you must have the ability to do a reverse name lookup to compare the IP 192 168 0 6 and the hostname ubuntu net to determine if they are the same machine Similarly if you use localhost to connect to the master the health report may not show all of the slaves It is best to use the actual hostname of the master when connecting or setting up replication
391. ipt contains only such logic for managing and validating options The work of the operation resides in the command module Command modules are designed to be used from other Python applications For example one could call the methods in the serverinfo py module from another Python script This enables developers to create their own interfaces to the utilities It also permits developers to combine several utilities to form a macro level utility tailored to a specified need For example if there is a need to gather server information as well as disk usage it is possible to import the serverinfo py and diskusage py modules and create a new utility that performs both operations Common modules are the heart of the MySQL Utilities library These modules contain classes that abstract MySQL objects devices and mechanisms For example there is a server class that contains operations to be performed on servers such as connecting logging in and running queries The MySQL Utilities Library While the library is growing the following lists the current common modules and the major classes and methods as of the 1 0 1 release database dbcompare format options Class Method Database get_create_object diff_objects check_consistency format_tabular list format_vertical_list pein list setup_common_options add_skip_options check_skip_options check_format_option Description Perform database level operations Retrieve object create s
392. irst rename the existing schema 8 7 10 Forward Engineering 8 7 10 1 It is possible to forward engineer a database using an SQL script or by connecting to a live database Forward Engineering Using an SQL Script To create a script of your database model choose the Export item from the File menu You may export a script to alter an existing database or create a new database The script to create a database is similar to the one created using the mysqldump db_name command If you choose to create a database there are several export options available 137 Forward Engineering 8 7 10 1 1 Creating a Schema Select the File Export Forward Engineer SQL CREATE Script menu item to start the Forward Engineer SQL Script wizard The following figure shows the first page of the wizard Figure 8 28 SQL Export Options SQLE rt Opti q port Options SQL Export Options Output SQL Script File Leave blank to view generated script but not save to a file 8 Options Generate DROP Statements Before Each CREATE Statement Generate DROP SCHEMA Skip Creation of FOREIGN KEYS Omit Schema Qualifier in Object Names Generate USE statements GBoOaa Generate Separate CREATE INDEX Statements Add SHOW WARNINGS After Every DDL Statement Do Not Create Users Only Export Privileges o A o A Generate INSERT Statements for Tables The SQL Export Options displays the following facilities Output SQL Script File T
393. ity to remove the folder prior to starting the cloned server OPTIONS mysqlserverclone accepts the following command line options e help Display a help message and exit e delete data Delete the folder specified by new data if it exists and is not empty e mysqld lt options gt Additional options for mysqld To specify multiple options separate them by spaces Use appropriate quoting as necessary For example to specify log bin binlog and general log file mylogfile use mysqld log bin binlog general log file my log file e new data lt path_to_new_datadir gt The full path name of the location of the data directory for the new server instance If the directory does not exist the utility will create it e new id lt server_id gt The server_id value for the new server instance The default is 2 e new port lt port gt 325 mysqlserverinfo Display Common Diagnostic Information from a Server The port number for the new server instance The default is 3307 e quiet q Turn off all messages for quiet execution root password lt password gt The password for the root user of the new server instance e server lt source gt Connection information for the server to be cloned in lt users lt passwa gt lt host gt lt port gt lt socket gt format Start timeout lt timeout_in_seconds gt Number of seconds to wait for server to start Default 10 seconds
394. izes with the live server to update the information displayed by the schemata explorer 81 82 Chapter 8 Data Modeling Table of Contents 8 1 Open an Existing EER Model ioiaren cece eee eee ee nese ee ae E esas aaa AE 84 8 2 Create New EER Model 0 cccccee cece neces eeeeee ee ee aaa neces eeeeaeaaeaeeeeeeeeeeaeaaaaaaeeeeeeeeaeaaaaneeeeees 84 8 3 Create EER Model from Existing Database cccceeeeeceeeeeeeeeeeeeeeeaaeeeeeeeeeeeseaaeaeeneeeeeeeeeaaa 84 8 4 Create EER Model from SQL Script ccececeee ee eceeeee cece tees ae aaa eeeeeeeeeeaeaaeaeeeeeeeeeeaeaaaaneeeeeees 84 8 5 Model Editor asicc ci icfeddzceedi faa ciedh has cela a aa sch EAE ia AEE Give a Eaa 85 8 5 1 Modeling MEN S svssncc cece cee csciecunus anacnnstsnteies cate denaesncaunsbvdavenstseteans deeaegaestheanvelanacessteneen 86 8 5 20 Jhe Toolbar2 324 ices dees endl noel eraa Neie E Qe heats heated aves nae 95 8 5 3 EER Diagrams icctsccncacciaseetecncne nnctieadetennanccdstaseeeteesdcactetke ive becncausasxdeesteandeasvavae bens 96 8 5 4 The Physical Schemata Panel c cceeeeeeeeee esac ae eeeeeeeeeeee ae aaeaeeeeeeeeeeeeaaaaneeeeeeeeeeeaea 96 8 5 5 The Schema Privileges Panel cccceeeeeeeeee cece ae eeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeeeeseeeeeeaaa 96 8 5 6 The SQL Scripts Panel ccccceceee cece eee eeee ee ee ee ee cee e test ee esse aa aaaaeeeeeeeeeeaaaaaaeeeeeeeeeeaea 98 8 5 7 The Mode
395. ject has been manually sized The value for this attribute is either true Or false name The name of the object top The number of pixels from the object to the top of the canvas visible Whether the object shows up on the canvas Use 1 for true and 0 for false It is currently used only for relationships width The width of the object Depending upon the object this property may be read only or read write Tables have the following additional properties indexesExpanded Whether indexes are displayed when a table is placed on the canvas Use 1 for true and 0 for false triggersExpanded Whether triggers are displayed when a table is placed on the canvas Use 1 for true and 0 for false For a discussion of connection properties see Section 8 7 2 3 Connection Properties 8 6 EER Diagram Editor EER diagrams are created by double clicking the Add Diagramicon You may create any number of EER diagrams just as you may create any number of physical schemata Each EER diagram shows as a tab below the toolbar a specific EER diagram is selected by clicking its tab Clicking an EER diagram tab navigates to the canvas used for graphically manipulating database objects The Vertical Toolbar is on the left side of this page 8 6 1 The Vertical Toolbar The vertical toolbar shows on the left sidebar when an EER diagram tab is selected The tools on this toolbar assist in creating EER diagrams
396. k Data Transfer REPORT E Store connection for future usage as Migration Report The optional Store connection option will save the connection details It must be set before proceeding to the next step by clicking Next Target Selection The target is the MySQL database that will contain the newly migrated database The current Workbench MySQL connections will be available here or you can choose Manage DB Connections to create a new connection 203 A visual guide to performing a database migration Figure 11 4 MySQL Workbench migration Target selection Target Selection OVERVIEW Overview Target RDBMS Connection Parameters SOURCE amp TARGET Stored Connection MANSEE v Select from saved connection settings Connection Method Standard TCP IP v Method to use to connect to the RDBMS Parameters Advanced Schemata Selection Hostname localhost Name or IP address of the server host TCP IP port Reverse Engineer Source Fetch Schemata List Username root Name of the user to connect with OBJECT MIGRATION Source Objects Password Store in Vault l Clear The user s password Will be requested later if it s not set Migration Manual Editing Target Creation Options Create Schemata Default Schema The schema to use as default schema Leave blank to select it later Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT St
397. k the Add Routine iconin the Physical Schemata section of the MySQL Model page The default name of the routine is rout inel If a routine with this name already exists the new routine is named rout ine2 Adding a new routine automatically opens the routine editor docked at the bottom of the application For information about using the routine editor see Section 8 7 4 1 2 The Routine Editor Right clicking a routine opens a pop up menu with the following items e Rename e Cut routine_name e Copy rout ine_name e Paste e Edit Routine Edit in New Window e Copy SQL to Clipboard e Delete routine_name The Edit Routine item opens the routine editor The cut and paste items are useful for copying routines between different schemata 121 Creating Routines and Routine Groups Note R Deleting the code for a routine from the Routines tab of the Routine Group Editor results in removal of the routine object from the model Note R To remove a routine from a routine group use the controls on the Routine Group tab of the Routine Group Editor The action of the delete option varies depending upon how you have configured MySQL Workbench For more information see Section 6 4 5 The Model Tab 8 7 4 1 2 The Routine Editor To invoke the routine editor double click a routine in the Physical Schemata section on the MySQL Model page This opens the routine editor docked at the bottom of the application Any
398. l Modifier Y Model EER Diagram Scripting Menu Table 13 8 Scripting menu keyboard shortcuts Function Keyboard Shortcut Context Scripting Shell Modifier F3 Modifier Option 3 on All Mac OS X Run Workbench Script File Modifier Shift R All Help Menu Table 13 9 Help menu keyboard shortcuts Function Keyboard Shortcut Context Help Index F1 Command Option question on All Mac OS X EER Diagram Mode In the EER Diagram view a number of other keyboard shortcuts are available Table 13 10 EER diagram mode keyboard shortcuts Function Keyboard Shortcut Selection tool Escape Hand tool H Delete tool D Layer tool L Note tool N Image tool Table tool T View tool V Routine Group tool G Non Identifying Relationship 1 1 1 Non ldentifying Relationship 1 n 2 Identifying Relationship 1 1 3 Identifying Relationship 1 n 4 Identifying Relationship n m 5 Relationship Using Existing Columns 6 Table 13 11 Keyboard shortcut changes MySQL Workbench version The Change 5 2 45 The Modifier shortcut was added to comment uncomment SQL in the SQL editor 5 2 45 On Microsoft Windows the Modifier W shortcut was changed to Control F4 this shortcut closes MySQL Workbench tabs 235 236 Chapter 14 MySQL Utilities Table of Contents TAA PHETACS o ccs scansieneteoesjensasntawestaa
399. l Notes Panel cece cece ee cece ce eeee cece einni ee aa eeeeeeaaeeeeseaaeeeeseaaeeeeseaaeeeeseaaes 98 8 5 8 The History Palette cirinireki a aE EEA KEE EEE 98 8 5 9 The Model Navigator Panel esssssssssesssserrsrsissssstrrirrisrssstrrrrrinrstsnnrntrnnnnsrntnnnennsstnn 98 8 5 10 The Catalog Tree Palette 0 00 00 ccc cece cece cece ea ee eter ents ee ceeded eeeeeeeeaeaaaaeeeeeeeeeaeaaea 99 8 5 11 The Layers Palette 0 cic cece cece cece cette eee ee ee cee e eter eee e ee seeded erases ee aaaaaaeeeeeeeeeeaea 99 8 5 12 The Properties Palette 2i ctw ee Ne he del adenine 100 8 62 EER Diagram Eton vcicsiccectcsachecetseag fect EREE EEE Sade cend ned cask Fabs eect EEE Sideces net casd tadeenttneeees 100 8 6 1 The Vertical Toolbalt ic s 2svieec et ease stahsatbiweat a a a aan aeaii 100 8 7 Working with Models cceeeeeee ee eeeeeeeeeeee teen ae eaeeeeeeeeeeeeaaaaeeeeeeeeeeeeaeaaeaeeeseeeeeeaeaaanneneeeees 104 8 1 Creating Tables 2 civigeiveies ie iedie he iain needed eee 104 8 7 2 Creating Foreign Key Relationships cccceeeeceeeeeeeeeaeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaaaaeeeees 115 8 7 3 Creating VICWS visicteccese nanni aiaa aE R e aaa Taa 119 8 7 4 Creating Routines and Routine Groups sesssssssssssssssrsisrssssrrrrrirrssssstrrrrrrssssrsrrrrnrent 121 8 7 5 Creating Layers 2iik ceii anal hahaa halakha eens 124 8 7 6 Creating NOteS 0 cccccceeeeeee cece cece cee e eee ee ee e
400. l server use this command mysqldiff serverl root localhost employees emp1 serverl on localhost connected WARNING Objects in serverl employees but not in server2 emp1 EVENT el Compare failed One or more differences found 285 mysqldiff Identify Differences Among Database Objects mysqldiff serverl root localhost employees tl empl t1l employees t3 emp1 t3 serverl on localhost connected Comparing employees tl to empl tl PASS serverl on localhost connected Comparing employees t3 to empl t3 PASS Success All objects are the same mysqldiff serverl root localhost employees salaries empl salaries differ serverl on localhost connected Comparing employees salaries to empl salaries FAIL Object definitions are not the same CREATE TABLE salaries emp_no gt int 11 NOT NULL seuleey alee lil WOT NO from_date date NOT NULL to_date date NOT NULL PRIMARY KEY emp_no from_date KEY emp_no emp_no ENGINE InnoDB DEFAULT CHARSET latinl 5 NA ENGINE MyISAM DEFAULT CHARSET latinl 2 nn Compare failed One or more differences found The following examples show how to generate a transformation report Assume the following object definitions Host1 CREATE TABLE dbl tablel num int misc char 30 Host2 CREATE TABLE dbx table3 num int notes char 30 misc char 55 To generate a set of SQL
401. l_test export both rpl user rpl rpl rpl master v Source on localhost connected Stopping slave STOP SLAVE Source on localhost connected Exporting metadata from util_test DROP DATABASE IF EXISTS util_test CREATE DATABASE util_test USE util_test TABLE util test el CREATE TABLE CL la char 30 DEFAULT NULL ENGINE MEMORY DEFAULT CHARSET latinl done Source on localhost connected USE util_test Exporting data from util_test Data for table util test ti NSERT INTO util_test t1 VALUES 01 Test Basic database example NSERT INTO util_test t1 VALUES 02 Test Basic database example NSERT INTO util_test t1 VALUES 03 Test Basic database example NSERT INTO util_test t1 VALUES 04 Test Basic database example r r NSERT INTO util_test t1l1 VALUES 05 Test Basic database example NSERT INTO util_test t1l1 VALUES 06 Test Basic database example NSERT INTO util_test t1 VALUES 07 Test Basic database example lt done r Eia r Connecting to the current server as master CHANGE MASTER TO MASTER HOST localhost MASTER_USER rpl MASTER_PASSWORD rpl MASTER_PORT 3311 MASTER_LOG_FILE clone bin 000001 MASTER_LOG_POS 106 Starting slave START SLAVE Similarly to export a database and include the replication commands to use the current server s master for example to start a new slave using the same th
402. larified derivation from RFC 1321 now handles byte order either statically or dynamically 1999 11 04 lpd Edited comments slightly for automatic TOC extraction 1999 10 18 lpd Fixed typo in header comment ansi2knr rather than md5 added conditionalization for C compilation from Martin Purschke lt purschke bnl gov gt TOIS G3 WS ae Oreina version Asynchronous socket services The asynchat and asyncore modules contain the following notice Copyright 1996 by Sam Rushing All Rights Reserved Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of Sam Rushing not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission 370 Python License SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE Cookie management The Co
403. lave and connection information for connecting to the master It is also possible to specify a database to be used to test replication The utility reports conditions where the storage engines on the master and the slave differ It also reports a warning if the InnoDB storage engine differs on the master and slave For InnoDB to be the same both servers must be running the same type of InnoDB built in or the InnoDB Plugin and InnoDB on both servers must have the same major and minor version numbers and enabled state By default the utility issues warnings for mismatches between the sets of storage engines the default storage engine and the InnoDB storage engine To produce errors instead use the pedantic 307 option which requires storage engines to be the same on the master and slave The vv option displays any discrepancies between the storage engines and InnoDB values with or without the pedant ic 307 option Replication can be started using one of the following strategies e Start from the current position default Start replication from the current master binary log file and position The utility uses the SHOW MASTER STATUS statement to retrieve this information 306 mysqlreplicate Set Up and Start Replication Between Two Servers OPTIONS Start from the beginning Start replication from the first event recorded in the master binary log To do this use the start from beginning 807 option St
404. laves Switching slaves to new master Starting slaves Performing START on all slaves Checking slaves for errors Failover complete done After this command the log file will contain entries like the following 316 mysql rpladmin Administration utility for MySQL replication 2012 03 19 14 44 17 PM INFO Executing failover command 2012 03 19 14 44 17 PM INFO Performing failover 2012 03 19 14 44 17 PM INFO Candidate slave localhost 3333 will become the new master 2012 03 19 14 44 17 PM INFO Preparing candidate for failover 2012 03 19 14 44 19 PM INFO Creating replication user if it does not exist 2012 03 19 14 44 19 PM INFO Stopping slaves 2012 03 19 14 44 19 PM INFO Performing STOP on all slaves 2012 03 19 14 44 19 PM INFO Switching slaves to new master 2012 03 19 14 44 20 PM INFO Starting slaves 2012 03 19 14 44 20 PM INFO Performing START on all slaves 2012 03 19 14 44 20 PM INFO Checking slaves for errors 2012 03 19 14 44 21 PM INFO Failover complete AVQILL OSC AAMINI 5 qickevares To perform switchover and demote the current master to a slave use the following command mysqlrpladmin master root localhost 3331 slaves root localhost 3332 root localhost 3333 root localhost 3334 new master root localhost 3332 demote master switchover Performing switchover t com master at localhost 3331 to slave at localhost 33232 Checking c
405. lays on the right side of the page For the HTML Basic Frames template you can select either the Colorful orthe Restrained Colors option from the Style list The HTML Basic Single Page template offers only the Colorful style The HTML Detailed Frames template offers the Vibrant style and also the more subdued Coated style The Text Basic template offers only the Fixed Size Font style From the Base Options frame choose the report title and the output directory for the report files As of MySQL Workbench 5 1 17 it is possible to specify variables in the output path e The user s home directory Available on Linux and Mac OS X versions only 164 The DBDoc Model Reporting Dialog Window Commercial Version desktopfolder The user s desktop documentsfolder The user s Documents folders The following table shows typical values for various platforms Platform Typical Default Documents Folder Windows C Documents and Settings user_name My Documents Linux Documents Mac OS X Users user_name Documents date The date in the format YYYY MM DD time The time in the format HHMM year The year in the format YYYY month The month in the format MM January is 01 and December is 12 monthname The name of the month rather than the number day The day number in the format DD For example the 12th would be 12 Content options can also be set Render Table Columns Display all the c
406. le property to False To locate an invisible object open the Layers palette and select the object by double clicking it After an object is selected you can reset the visible property from the Properties palette For a list of properties accessible through the Properties palette see Section 8 5 12 The Properties Palette In addition to the properties listed there a layer also has a description property Use this property to document the purpose of the layer 8 7 6 Creating Notes You can add notes to a database only from the Model Notes section of the MySQL Model page Notes are typically used to help document the design process 8 7 6 1 Adding Notes Double clicking the Add Note icon in the Model Notes section of the MySQL Model page adds a note with the default name of notel If a note with this name already exists the new note is named notez Adding a new note automatically opens the note editor docked at the bottom of the application For information about using the note editor see Section 8 7 6 2 The Note Editor 125 Creating Text Objects Right clicking a note opens a pop up menu with the following items e Rename Cut note_name e Copy note_name e Delete note_name The Edit Note item opens the note editor For information about using the note editor see Section 8 7 6 2 The Note Editor The cut and copy items are useful for copying notes between different schemata Notes can be add
407. le_names 2 Checking slave delay seconds behind master pass Slave status Slave_IO_State Waiting for master to send event Master_Host hostl Master_User rpl Master Port 32210 Connect_Retry 60 Master_Log_File clone bin 000001 Read_Master_Log_Pos 482 Relay_Log_File clone relay bin 000006 Relay_Log_Pos 251 Relay_Master_Log_File clone bin 000001 Slave_IO_Running Yes 320 mysqlrplshow Show Slaves for Master Server Slave_SQL_ Running Yes Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last IET rno 0 Last Error i Skip_Counter 0 Exec_Master_Log_Pos 482 Relay_Log_Space 551 Until_Condition None Until og File inne aI bree Ros 0 Master_SSL_Allowed No Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master 0 Master_SSL_Verify_Server_Cert No Last_lO_Brrno 2 0 Last IO EFPOr 8 Last_SOlL_ Errno 0 Last SoL Error i done 14 4 17 mysqlrplshow Show Slaves for Master Server This utility shows the replication slaves for a master It prints a graph of the master and its slaves labeling each with the host name and port number You must specify the discover slaves login 322 option to provide the user name and password to discover any slaves in the topology To explore the slaves for each client use
408. les tab enables you to browse the MySQL Workbench installed modules and their functions Clicking a module within the explorer causes its details to be displayed in a panel below the explorer This facility is useful for exploring the available modules and their supported functions It is also a way to check whether custom modules have been correctly installed 12 6 Tutorial Writing Plugins This tutorial shows you how to extend MySQL Workbench by creating a plugin The Sample Plugin EER Diagrams are useful for visualizing complex database schemata They are often created for existing databases to clarify their purpose or document them MySQL Workbench provides facilities for reverse engineering existing databases and then creating an EER Diagram automatically In this case relationship lines between foreign keys in the table will automatically be drawn This graphical representation makes the relationships between the tables much easier to understand However one of the most popular storage engines for MySQL MyISAM does not include support for foreign keys This means that MyISAM tables that are reverse engineered will not automatically have the relationship lines drawn between tables making the database harder to understand The plugin that will be created in this tutorial gets around this problem by using the fact that a naming convention is very often used for foreign keys tablename_primarykeyname Using this convention foreign keys can
409. library MForms which enables the creation of extensions that feature a graphical user interface The extension system enables the following capabilities e Automate common tasks e Extend the Workbench user interface e Create plugins code which can be invoked from the Workbench menu system e Manipulate schemata e Create custom Workbench features 12 1 GRT and Workbench Data Organization The GRT or Generic RunTime is the internal system used by Workbench to hold model document data It is also the mechanism by which Workbench can interact with Modules and Plugins Workbench model data such as diagrams schemata and tables is stored in a hierarchy of objects that can be accessed by any plugin The information is represented using standard data types integers doubles strings dicts lists and objects The GRT can be accessed using external scripting languages such as Lua and Python Awareness is required of how the GRT data types map into the scripting language In Python for example the GRT integer double and string data types are seen as corresponding Python data types Lists and dicts are kept in their internal representation but can generally be treated as Python lists and dicts and accessed in the usual way Objects contain data fields and methods but the GRT recognizes only objects from a pre registered class hierarchy It is possible to fully examine the classes contained within the GRT using the Workbench Scripting
410. lication to have a native look and feel while reducing the amount of work required to maintain the project However the GUI functionality required by MySQL Workbench can be met by a subset of graphical operations These are implemented in a cross platform GUI library MForms This further reduces the development effort because plugin developers can use MForms rather than writing front end specific code for each supported platform This also helps consistency of operation across all platforms MForms is coded in C but provides a Python interface To use it the Python code must import the mforms module MForms Containers Given the problems of using an absolute coordinate system across different platforms MForms employs containers that perform automatic layout The basic containers that MForms provides include e Form A top level window which can contain a single control usually another container The window will be sized automatically to fit its contents but can also be sized statically Box This is a container that can be filled with one or more controls in a vertical or horizontal layout Each child control can be set to use either the minimum of required space or fill the box in the direction of the layout In the direction perpendicular to the layout for example vertical in a horizontal layout the smallest possible size that can accommodate all child controls will be employed So in this example the smallest height possible to accomm
411. list of conditions and the following disclaimer in the documentation and or other materials provided with the Glai sre ta mioyo ons 3 The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE AUTHORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF StH POSSIBILITY OF SUCH DAMAGE A 19 Lua liblua License The following software may be included in this product Lua liblua Copy teine Om 919417 0 0 Sal aaonacy ee UC Reiko Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of
412. ll schemata in the model The preceding template file can be edited in any way you like with new markers being added and existing markers being removed as required For the custom template example you might want to create a much simpler template such as the one following Total number of Schemata SCHEMA_COUNT SCHEMATA Schema Name SCHEMA _NAME Tables TABLE_COUNT TABLES Table Name TABLE_NAME TABLES SCHEMATA Report Generated On GENERATED 175 Creating a Custom Template End of MySQL Workbench Custom Report This simplified report just lists the schemata and the tables in a model The date and time the report was generated is also displayed as a result of the use of the GENERATED variable The custom template can then be tested Start MySQL Workbench load the model to generate the report for select the Model DBDOC Model Reporting menu item Then select the new custom template from the list of available templates select an output directory and click Finish to generate the report Finally navigate to the output directory to view the finished report 176 Chapter 9 Generating code overview Table of Contents 9 1 Generating SQL Queries site cites ai isd cated deeded ated a iee 177 9 2 Generating PHP Code ccccccce cece eee ee eter tees eae ete aaa e a Aa a aaa AN aeaaea 177 This document provides
413. ll wait ping seconds to check master response If no response failover event occurs quiet q Turn off all messages for quiet execution rpl user lt replication_user gt The user and password for the replication user requirement in the format lt users lt password gt or lt login path gt E g rpl passwd Default None script threshold lt return_code gt Value for external scripts to trigger aborting the operation if result is greater than or equal to the threshold Default None no threshold checking seconds behind lt seconds gt Used to detect slave delay The maximum number of seconds behind the master permitted before slave is considered behind the master Default 0 slaves lt slave connections gt Connection information for slave servers in the form lt users lt passwd gt lt host lt port gt lt socket gt or lt login path gt lt port gt lt socket gt List multiple slaves in comma separated list The list will be evaluated literally whereby each server is considered a slave to the master listed regardless if they are a slave of the master 313 mysql rpladmin Administration utility for MySQL replication timeout lt seconds gt Maximum timeout in seconds to wait for each replication command to complete For example timeout for slave waiting to catch up to master Default 300 seconds e verbose V Specify how much information to display Use this option mult
414. llowing information to connect to this server User name root Password 324 mysqlserverclone Clone Existing Server to Create New Server master on localhost connected Finding slaves for master localhost 33333 Server localhost 3334 is running on localhost master on localhost FAILED Connection to localhost 3334 has failed Please enter the following information to connect to this server User name root Password master on localhost connected Finding slaves for master localhost 3334 Replication Topology Graph localhost 3331 MASTER T leealinosicsaS32 Sivan lecalinosies 3353 SIE MASER T Ie e alinosieg sss Sis yan 14 4 18 mysqlserverclone Clone Existing Server to Create New Server This utility permits an administrator to clone an existing MySQL server instance to start a new server instance on the same host The utility creates a new datadir new data 325 and starts the server with a socket file You can optionally add a password for the login user account on the new instance If the user does not have read and write access to the folder specified by the new data 325 option the utility shall issue an error Similarly if the folder specified by new data 325 exists and is not empty the utility will not delete the folder and will issue an error message Users must specify the delete data 325 option to permit the util
415. localhost 49320 Query 0 SHOW PROCESSLIST Users and Privileges 3 root localhost 49322 Sleep 2 DATA EXPORT RESTORE amp Data Export amp Data Import Restore Kill Query Kill Connection Refresh 14 Click the Stop Server button The message window will show that the server has stopped 15 Click the Start Server button to resume the server The message window will confirm that the server is running You have now seen how to create a server instance to enable you to manage a MySQL server For further information see Chapter 10 Server Administration 5 2 Creating a Model In this section you will learn how to create a new database model create a table create an EER Diagram of your model and then forward engineer your model to the live database server 1 Start MySQL Workbench On the Home window select Create new EER Model A model can contain multiple schemata Note that when you create a new model it contains the mydb schema by default You can change the name of this schema to serve your own purposes or delete it 39 Creating a Model Figure 5 13 Getting Started Tutorial Home Window Workbench Central Read about all changes in this MySQL Workbench release Workspace SQL Development oa Data Modeling Server Administration Connect to existing databases and run v7 Create and manage models forward amp Configure your database server setup SQL Queries SQL scripts edit data and reverse e
416. lueia OFF audi cmiog policy ALL audit_log_rotate_on_size 0 audit_log_strategy ASYNCHRONOUS 4 4 To perform a manual rotation of the audit log file use the following command 252 mysqlauditadmin Allows users to perform maintenance action on the audit log shell gt mysqlauditadmin server root localhost 3310 rotate Executing ROTATE command To display the audit log file statistics run the following command shell gt mysqlauditadmin file stats audit log name SERVER data audit log arcc lec audit log 13486539046497235 fle Bs od Bal hn ets NRE SOE ARIA a SSRN Wed Sep 26 11 07 43 2012 Wed Sep 26 11 05 04 2012 Wed Sep 26 11 07 43 2012 Wed Sep 26 11 05 04 2012 To change the audit log policy to log only query events and show the system variables before and after the execution of the policy command use the following command shell gt mysqlauditadmin show options server root localhost 3310 policy value QUERIES Showing options before command Audit Log Variables and Options 4 4 Variable_name Value 4 4 audit_log_buffer_size 1048576 audit_log_file audit log guuelatie__ilexey kesi OFF audit_log_policy ALL audit_log_rotate_on_size 0 audit_log_strategy ASYNCHRONOUS 4 4
417. ly have access to a remote MySQL server you must enter appropriate connection parameters as necessary This tutorial requires MySQL Workbench 5 2 16 or above It is assumed that you have a basic understanding of MySQL concepts This tutorial demonstrates the procedures on Microsoft Windows but they are the same for all supported platforms 5 1 Administering a MySQL Server In this section you will use MySQL Workbench to carry out administrative functions such as starting and stopping the server 1 Launch MySQL Workbench You will be presented with the Home window 27 Administering a MySQL Server Figure 5 1 Getting Started Tutorial Home Window MySQL Workbench Banm File Edit View Database Plugins Scripting Community Help 1 Sidhe Workbench Central Welcome to MySQL Workbench 6 fi amp g What s New in This Release lt A Read about all changes in this MySQL Workbench release MySQLDoc MySQLBug Workbench Planet MySQL os bench Library Reporter Team Blog Forums Workspace Connect to existing databases and run Create and manage models forward amp Configure your database server setup SQL Queries SQL scripts edit data and reverse engineer compare and user accounts browse status variables manage database objects synchronize schemas report and server logs SQL Development Data Modeling Q Server Administration G Open Connection to Start Querying Open Existing EER Model ie Server Administration
418. ments stored in the document If you choose to not set the SqiMode property ensure that the default SOL_MODE variable defined by the server does not contain any values from the following list ANSI_QUOTES HIGH_NOT_PRECEDENCE IGNORE_SPACE NO_BACKSLASH_ESCAPES PIPES_AS_CONCAT The SqiMode property is defined in two locations globally and at document scope MySQL Workbench uses the global property to initialize the document property for each new document created For each document the property value defined at document scope always has higher priority over the one defined globally 6 4 4 The SQL Queries Tab Preferences related to the SQL Editor and how query viewing behaves 55 The SQL Queries Tab Figure 6 5 The SOL Queries Preferences Workbench Preferences XA General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance General Max query length to store in history in bytes 65536 C Continue on SQL Script Error by default X Safe Updates Forbid UPDATEs and DELETEs with no key in WHERE clause or no LIMIT clause Requires a reconnection Progress status update interval in milliseconds 500 Online DDL Default algorithm for ALTER table Default Default lock for ALTER table Default Query Results X Limit Rows Limit Rows Count 1000 Max Field Value Length to Display in bytes 256 _ Treat BINARY VARBINARY as nonbinary character str
419. mitted format values are grid csv tab sql and vertical The default is grid server lt source gt Connection information for the server in the format lt user gt lt passwa gt lt host gt lt port lt socket or lt ogin path gt lt port gt lt socket gt show drops d Display DROP statements for dropping indexes 298 mysqlindexcheck Identify Potentially Redundant Table Indexes NOTES show indexes i Display indexes for each table Skip S Skip tables that do not exist Stats Show index performance statistics verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug version Display version information and exit worst lt N gt If stats 299 is given limit index statistics to the worst N indexes The default value of Nis 5 if omitted You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to read all objects accessed during the operation For the format 298 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 298 specifies the grid format An error occurs if a prefix matches more than one valid value The path to the MySQL client tools should be included i
420. mmary about Workbench model data organization modules Information about Workbench module usage plugins Information about writing Plugins and Modules for Workbench Type topic to get help on the topic Custom Python Modules Gee Module to work with Workbench runtime grt objects GHEE 5 EOE The root object in the internal Workbench object hierarchy grt modules Location where Workbench modules are available grt classes List of classes known to the GRT system mforms A Module to access the cross platform UI toolkit used in some Workbench features wb Utility module for creating Workbench plugins Type help module object function to get information about a module object or function Type dir object to get a quick list of methods an object has For an introductory tutorial on the Python language Visit hito decs pytinonoorg tutorial For general Python and library reference documentation visit http python org doc Within the Workbench Scripting Shell there are four tabs on the top of the left side panel Files Globals Classes and Modules Discussion of these additional tabs follows Note R An exception is thrown while attempting to use input or read from stdin 12 5 3 The Files Globals Classes and Modules Tabs The Workbench Scripting Shell features the Files Globals Classes and Modules tabs in addition to the main Shell tab The Files Tab Lists folders and files for user defined custom script files The
421. ms enclosed by percentage signs are variables Their meanings are as follows Stables The table associated with the object e stable The source table associated with the object e Sdtables The destination table associated with the object e column The column associated with the object Legitimate values for the foreign key update or delete rules are RESTRICT CASCADE SET NULL NO ACTION default For more information about these actions see Section 8 7 1 3 4 The Foreign Keys Tab 6 4 6 The Model MySQL Tab This enables you to set the default table storage engine MySQL Server version and SQL_MODE to be used for generated scripts 59 The Diagram Tab Figure 6 7 The Model MySQL Preferences Workbench Preferences General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance Model Default Target MySQL Version 5 6 Model Table Defaults Default Storage Engine InnoDB Forward Engineering and Synchronization SQL_MODE to be used in generated scripts TRADITIONAL ALLOW _INVALID_DATES Default Target MySQL Version Certain features will utilize options for this MySQL Version This option was added in MySQL Workbench 5 2 45 Default Storage Engine Tables created in MySQL Workbench will be defined using this default storage engine e SQL_MODE to be used in generated scripts Defaults to TRADITIONAL ALLOW_INVALID_DATES this de
422. must be declared in the usual way only the entry point of the plugin will need to be executed in the plugin function as most of the additional functionality will be invoked as a result of the user interacting with the GUI 227 Adding a GUI to a Plugin Using MForms Note R Reloading a plugin requires MySQL Workbench to be restarted Declare a plugin using this syntax ModuleInfo plugin plugin_name caption input groups pluginMenu These parameters are defined as follows plugin_name A unique name for the plugin It may contain only alphanumeric characters dots and underscores caption A caption to use for the plugin in menus input An optional list of input arguments groups Optional list of groups the plugin belongs to Recognized values are e Overview Utility The Context menu in the Model Overview Model Utility The menu for diagram objects Menu lt category gt The Plugins menu in the main menu pluginMenu Optional name of a submenu in the Plugins menu where the plugin should appear For example Catalog Objects Utilities This is equivalent to adding a Menu lt category gt in the groups list 12 4 Adding a GUI to a Plugin Using MForms MySQL Workbench is implemented with a C core back end and a native front end for each supported platform Currently the front end is implemented with Windows Forms on Microsoft Windows GTK on Linux and Cocoa on Mac OS X This approach permits the app
423. mysql Tool fa Leave blank to use bundled version Location where dump files should Export Directory Path C Users philip Documents dumps be placed by default 53 The SQL Editor Tab 6 4 3 The SQL Editor Tab This section provides configuration options that affect the SQL Editor functionality in MySQL Workbench Note R There is also an SQL Editor section in the General preference tab with preference settings for how the SQL Editor tabs are saved and opened The SQL Editor is divided into three sections General Productivity and SQL Parsing in Text Editors as seen in the following screenshot Figure 6 4 The SOL Editor Preferences Workbench Preferences General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance General Show Schema Contents in Schema Tree C Show Metadata Schemata DBMS connection keep alive interval in seconds 600 DBMS connection read time out in seconds 600 Productivity Z Enable Code Completion in Editors X Automatically Start Code Completion Reformat DDL for Views Max syntax error count 100 SQL Parsing in Text Editors Default SQL_MODE for syntax checker SQL Identifiers are Case Sensitive Non Standard SQL Delimiter 55 General Show Schema Contents in Schema Tree Enumerating populating and drawing large numbers of items can significantly increase loading times For this reason this facility can be switched o
424. n 7 7 4 2 Results Tabsheets The results area of the screen shows the results from any queries that have been executed If the script contains multiple queries a result tab will be generated for each query that returns results Figure 7 9 SQL Editor Results Tabsheets Overview Output CNM ac Result 1 x Koon R E RE ARaORe R Fetched 239 records name code gt Afghanistan AFG Netherlands NLD Netherlands Antilles ANT Albania ALB Algeria DZA American Samoa Andorra Angola Anguilla Antigua and Barbuda United Arab Emirates Argentina Armenia Controls are provided to enable you to easily move over the results These are shown in the following screenshot Figure 7 10 SQL Editor Results Tabsheets Navigation Controls Koo Ala B lH lQ Fetched 239 records tal From left to right the controls are e Move to first row Highlights the first row in the current result set e Move to previous row Highlights the previous row e Move to next row Highlights the next row e Move to last row Highlights the last row in the current result set Toggle wrapping of cell contents Toggles between truncating or wrapping the data in a cell 75 Main Tabsheets Sort Ascending Sorts the selected column in ascending order e Sort Descending Sorts the selected column in descending order e Export record set to an external file Writes a result set to a CSV HTML or XML file as required Refresh Data from Data So
425. n You are not responsible for enforcing compliance by third parties with this License 11 If as a consequence of a court judgment or allegation of patent infringement or for any other reason not limited to patent issues conditions are imposed on you whether by court order agreement or otherwise that contradict the conditions of this License they do not excuse you from the conditions of this License If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations then as a consequence you may not distribute the Library at all For example if a patent license would not permit royalty free redistribution of the Library by all those who receive copies directly or indirectly through you then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library If any portion of this section is held invalid or unenforceable under any particular circumstance the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices Many people have made generous contributions to the wi
426. n Plugins Commercial Version The Object Notation Submenu The items under the Object Notation submenu apply exclusively to an EER diagram They are not enabled unless an EER diagram tab is selected The Object Notation submenu has these items e Workbench Default Displays table columns indexes and triggers e Workbench Simplified Shows only a table s columns e Classic Similar to the Workbench Simplified style showing only the table s columns e IDEF1X The ICAM DEFinition language information modeling style The object notation style that you choose persists for the duration of your MySQL Workbench session and is saved along with your model When MySQL Workbench is restarted the object notation reverts to the default style first Changing notation styles after objects have been placed on a diagram Note R If you plan to export or print an EER diagram be sure to decide on a notation can significantly change the appearance of the diagram 92 Modeling Menus 8 5 1 5 4 The Relationship Notation Submenu The items under the Relationship Notation submenu apply exclusively to an EER diagram They are not enabled unless an EER diagram tab is selected The Relationship Notation submenu has these items Crow s Foot IE The default modeling style For an example see Figure 8 47 Adding Tables to the Canvas Classic Uses a diamond shape to indicate cardinality Connect to Columns UML Universal Modeling Lan
427. n EER Diagram To add layers to an EER Diagram use the Layer tool on the vertical toolbar Select an EER Diagram tab and right click the layer icon on the vertical toolbar The layer icon is the rectangle with an L in the lower left corner and it is found below the eraser icon Clicking the mouse on this icon changes the mouse pointer to a layer pointer You can also change the mouse pointer to a layer pointer by pressing the L key Choosing the Layer tool changes the contents of the toolbar that appears immediately below the menu bar When the Layers pointer is active this toolbar contains a color chart list Use this list to select the color accent for the new layer The color of your layer can be changed later using the Properties palette Create a layer by clicking anywhere on the EER Diagram canvas and while holding the left mouse button down draw a rectangle of a suitable size This creates a new layer with the default name layer1 To revert to the default mouse pointer click the arrow icon at the top of the vertical toolbar The following image shows a layer containing a number of views Figure 8 18 The Layer Object To change the name of a layer use the name property of the Properties palette 124 Creating Notes 8 7 5 1 1 Right clicking a layer opens a pop up menu with the following items e Cut layer_name e Copy layer_name e Delete layer_name The cut and copy items are useful for copying layers bet
428. n Europe 468 00 1278 78000 83 5 1630 00 Hu ANT Netherlands A North America Caribbean 800 00 coa 217000 74 7 1941 00 ma ARE United Arab E Asia Middle East 83600 00 1971 2441000 74 1 37966 00 36846 00 ARG Argentina South America South America 2780400 00 1816 37032000 TSA 340238 00 323310 00 ARM Armenia Asia Middle East 29800 00 1991 3520000 66 4 1813 00 1627 00 ASM American Samoa Oceania Polynesia 199 00 68000 75 1 334 00 ATA Antarctica Antarctica Antarctica 13120000 00 0 nue 0 00 noe ATF French Southe Antarctica Antarctica 7780 00 0 ma 0 00 ma ATG Antigua and B North America Caribbean 442 00 1981 68000 70 5 612 00 584 00 AUS Australia Oceania Australia and 7741220 00 1901 18886000 79 8 351182 00 392911 00 AUT Austria Europe Western Europe 83859 00 1918 8091800 77 7 211860 00 206025 00 AZE Azerbaijan Asia Middle East 86600 00 1991 7734000 62 9 4127 00 4100 00 BDI Burundi Africa Eastern Africa 27834 00 1962 6695000 46 2 903 00 982 00 BEL Belgium Europe Western Europe 30518 00 1830 10239000 77 8 249704 00 243948 00 BEN Benin Africa Western Africa 112622 00 1960 6097000 50 2 2357 00 2141 00 Country 1 Apply Revert Action Output Time Action Response Duration Fetch Time ol 18 18 08 SELECT FROM world Country LIMIT 0 1000 239 row s returned 0 000 sec 0 001 sec _ Query Completed These additional controls enable you to make changes other than simple edits like inserting removing rows and exporting the data From left to right the
429. n Select the type of remote management you want to use Management and 0S Do not use remote management O Native Windows remote management only available on Windows 55H login based management Operating System Selection Select the operating system and the type of database installation on the target machine If you are unsure about the type of database installation select the Vendor Package variant If your specific operating system is not in this list select a related variant It can later be customized if needed Operating System Windows MySQL Installation Type Set the configuration method then click Next If the SSH login based management was chosen then you will configure its parameters which includes the User Name Host Name and optionally the SSH key for authentication 32 Administering a MySQL Server Figure 5 6 Getting Started Tutorial SSH Configuration Create New Server Instance Profile Specify Host Machine ted set Set remote SSH configuration parameters Database Connection Test DB Connection In order to remotely configure this database instance an SSH account on this host with appropriate privileges is ae required This account needs write access to the my cnf database config file read access to the database logs and Management and OS privileges to start stop the database daemon SSH Configuration Host Name Port 22 User Name C Authenticate
430. n file Other administrative Note R You must use an SSH connection type when managing a remote server if you functions do not require an SSH connection Windows Management If a Windows server is used then the Windows configuration parameters must be set Windows management requires a user account with the required privileges to query the system status and to control services And read write access to the configuration file is needed to allow editing of the file Test Settings On the next page your settings are tested and the wizard reports back the results after attempting to connect to the server If an error occurs you are directed to view the logs which can be done by clicking the Show Logs button MySQL Workbench must know where the MySQL Server configuration file is located to be able to display configuration information The wizard is able to determine the most likely location of the configuration file based on the selection made on the Operating System page of the wizard However it is possible to test that this information is correct by clicking the Check path and Check section buttons The wizard then reports whether the configuration file and server configuration section can in fact be accessed It is also possible to manually enter the location of the configuration file and the section pertaining to MySQL Server data these manually entered values should be tested using the buttons provided Click the Next button to continue
431. n path gt lt port gt lt socket gt Start from beginning b Start replication at the beginning of events logged in the master binary log This option is not valid unless both master log file 807 and master log pos 307 are given test db lt test_database gt The database name to use for testing the replication setup If this option is not given no testing is done only error checking verbose v 307 mysqlreplicate Set Up and Start Replication Between Two Servers Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit NOTES The login user for the master server must have the appropriate permissions to grant access to all databases and the ability to create a user account For example the user account used to connect to the master must have the WITH GRANT OPTION privilege The server IDs on the master and slave must be nonzero and unique The utility reports an error if the server ID is 0 on either server or the same on the master and slave Set these values before starting this utility Mixing IP and hostnames is not recommended The replication specific utilities will attempt to compare hostnames and IP addresses as aliases for checking slave connectivity to the master However if your installation does not support rever
432. n rather than a pattern If the pattern 302 option is given the first nonoption argument is treated as a connection specifier not as a pattern regexp basic regexp G Perform pattern matches using the REGEXP operator The default is to use LIKE for matching This affects the dat abase 302 and pattern 302 options Sserver lt source gt Connection information for a server to search in the format lt user gt lt passwd gt lt host gt lt port gt lt socket gt or lt login path gt lt port gt lt socket gt Use this option multiple times to search multiple servers sql print sql p Print rather than executing the SQL code that would be executed to find all matching objects This can be useful to save the statement for later execution or to use it as input for other programs version Display version information and exit For the format 302 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 302 specifies the grid format An error occurs if a prefix matches more than one valid value 302 mysqlprocgrep Search Server Process Lists The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required t
433. n t 2 According to Richard Stallman 1 6 1 is not GPL compatible because its license has a choice of law clause According to CNRI however Stallman s lawyer has told CNRI s lawyer that 1 6 1 is not incompatible with the GPL Thanks to the many outside volunteers who have worked under Guido s direction to make these releases possible B TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 1 This LICENSE AGREEMENT is between the Python Software Foundation PSF and the Individual or Organization Licensee accessing and otherwise using this software Python in source or binary form and its associated documentation 2 Subject to the terms and conditions of this License Agreement PSF hereby grants Licensee a nonexclusive royalty free world wide license to reproduce analyze test perform and or display publicly prepare derivative works distribute and otherwise use Python alone or in any derivative version provided however that PSF s License Agreement and PSF s notice of copyright i e Copyright c 2001 2002 2003 2004 2005 2006 Python Software Foundation All Rights Reserved are retained in Python alone or in any derivative version prepared by Licensee 3 In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof and wants to make the derivative work available to others as provided herein th
434. n the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To check all tables in the employees database on the local server to see the possible redundant and d i g A uplicate indexes use this command mysqlindexcheck server root localhost employees Source on localhost connected The following indexes are duplicates or redundant for table employees dept_emp REATE INDEX emp_no ON employees dept_emp emp_no USING BTREE may be redundant or duplicate of LTER TABLE employees dept_emp ADD PRIMARY KEY emp_no dept_no The following indexes are duplicates or redundant for table employees dept_manager REATE INDEX emp_no ON employees dept_manager emp_no USING BTREE may be redundant or duplicate of LTER TABLE employees dept_manager ADD PRIMARY KEY emp_no dept_no The following indexes are duplicates or redundant for table employees salaries CREATE INDEX emp_no ON employees salaries emp_no USING BTREE may be redundant or duplicate of ALTER TABLE employees salaries ADD PRIMARY KEY emp_no from_date 299 mysqlmetagrep Search Database Object Definitions The following indexes are duplicates or redundant for table employees titles CREATE INDEX emp_n
435. name no data gt script _file sql command Using the no data option ensures that the script contains only DDL statements However if you are working with a script that also contains DML statements you need not remove them they will be ignored the changes be sure to retain a copy of the original DDL script You will need the original script to create an ALTER script For more information see Section 8 7 10 1 2 Altering a Schema Note E If you plan to redesign a database within MySQL Workbench and then export Use the databases option with mysqldump if you wish to create the database as well as all its objects If there is no CREATE DATABASE db_name statement in your script file you must import the database objects into an existing schema or if there is no schema a new unnamed schema is created If your script creates a database MySQL Workbench creates a new physical schemata tab on the MySQL Model page Any database objects may be imported from a script file in this fashion tables views routines and routine groups Any indexes keys and constraints are also imported Objects imported using an SQL script can be manipulated within MySQL Workbench the same as other objects Before exiting be sure to save the schema Choose the File Save menu item and the reverse engineered database will be saved as a MySQL Workbench file with the extension mwb See Section 8 8 1 Importing a Data Definition SQL Sc
436. nashenddandanceabeshawedaanexeddanshwevenabancneba bhweeaapaenetaas gt PORE LICONSE chi sdiwcctevsvvacussanvecenvacwdeen NNA NRE ENAERE A lt PIXMAN LICENSE orenian sania iia a EA EEA AE Kaa E AE AE AA AAE AAEE EEEN EAA E AE R a PYGYyPtO LICENSE mssinuarinnarnien a aa E E A EE AR PYODBG LICENSE ihossaan aa a a aaa ai a aa ERE PANON LICENO e a S T vi MySQL Workbench 5 2 A 26 Scintilla License 0 00 00 A 27 ScintillaNET LICENSE 20 00 cece cece ec eece ee eeca cease esau caeeaueaeeeueueeaeeaeeaeeueegueaeeaeeaeeaass A 28 TimyAML EIGONS6 asian fides rieni auna EAER RAAUA A EKAA KAEKA OERE SAE RS RAKAA AAEREN A 29 TreeViewAdv for NET License A 30 VSQLite License ALB zii LICENSE acuanana OTE E EE dacwacaeanavesalvcaneecieeacaasblasencs B MySQL Workbench FAQ scen C MySQL Workbench and Utilities Change History ssseseesesssessesseserrirsrssssssnrrrnnsrssssnnrrrrerses C 1 MySQL Workbench Change History seessessssssssesssssrrsrsnrssssrrnrnnsrssssrrrrnrtrssssnnrnnreres C 2 MySQL Utilities Change History vii viii 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 third party code see Appendix A Third Party Licenses Legal Notices Copyright 2006 2013 Oracle and or its affiliates All rights reserved This
437. nce Operations actor nnoDB Select tables and click the operation you want to perform address pepr NOTE Some commands may require locking tables until completion be ald inte which may take a long time for large tables city nnoDB I country InnoDB Analyze Table T customer InnoDs Analyzes and stores the key distribution for a table z be rae are During the analysis the table is locked with a read lock for InnoDB and MyISAM T film_category InnoDB __ Don t write to BINLOG local Analyze Table T film_text MyISAM T inventory InnoDB TD language InnoDB Optimize Table H payment InnoDB Reorganizes the physical storage of table data and associated index data Di rental InnoDB to reduce storage space and improve 1 0 efficiency when accessing the table ff I pore nce _ Optimize FULLTEXT only Number of words to optimize per run 2000 o Don t write to BINLOG local Optimize Table Check Table CHECK TABLE checks a table or tables for errors For MyISAM tables the key statistics are updated as well 9 _ Fast _ Changed Check Table Checksum Table CHECKSUM TABLE reports a checksum for the contents of a table o Quick if supported Checksum Table lt Summary List Cascaded DELETE statements generator You can generate a series of DELETE statements needed to delete a row from that table which includes rows from other tables that reference it recursively The SELECT version allows you to preview what row
438. nch 5 0 is still being continually maintained and some performance related issues may have been resolved e Limit the number of steps to save in the Undo History facility Depending on the operations performed having an infinite undo history can use a lot of memory after a few hours of work In Tools Options General enter a number in the range 10 to 20 into the Undo History Size spinbox e Disable relationship line crossing rendering In large diagrams there may be a significant overhead when drawing these line crossings In Tools Options Diagram uncheck the option named Draw Line Crossings 379 Check your graphics card driver The GDI rendering used in MySQL Workbench 5 0 is not inherently slow as most video drivers support hardware acceleration for GDI functions It can help if you have the latest native video drivers for your graphics card Upgrade to MySQL Workbench 5 1 MySQL Workbench 5 1 has had many operations optimized For example opening an object editor such as the table editor is much faster even with a large model loaded However these core optimizations will not be back ported to 5 0 B 3 I get errors when creating or placing objects on an EER Diagram am using OpenGL rendering AMD processor and ATI graphics hardware To solve this problem renew the ATI drivers pack which can be downloaded from the AMD Web site B 4 What do the column flag acronyms PK NN UQ BIN UN ZF Al in the MySQL Workbench
439. nd line or from the graphical user interface of the host operating system Using the command line launching facility is useful when you want to customize some aspects of the way MySQL Workbench operates The following sections describe how to launch MySQL Workbench for each of the supported platforms In addition to platform specific command line options MySQL Workbench has the following command line options Note R On Microsoft Windows the command line options contain one leading dash instead of two For example use log level for Microsoft Windows and log level for Linux and Mac OS X log level level Controls the verbosity level for logging output from Workbench With increasingly levels of verbosity the valid values for level are error warning info debug1 debug2 and debug3 The location of the generated log files such as wb 10g are as follows Platform Default location Linux mysql workbench log Mac OS X Library Application Support Workbench log Microsoft Windows C Users user_nameAppData Roaming MySQL Workbench log e admin instance Load the server instance specified e query connection Load the connection specified e model modelfile Load the model specified 20 Installing MySQL Workbench on Windows e script script Run the script specified e run code Run the code snippet specified quit when done Quits MySQL Workbench after
440. need to adjust the placement of objects on the EER Diagram canvas Print to PDF Creates a PDF file of your EER Diagram Print to PS Creates a PostScript file of your EER Diagram 8 10 MySQL Workbench Schema Validation Plugins Commercial Version MySQL Workbench provides validation modules so that you can test your models before implementing them The validation plugins are accessed from the Model menu One plugin performs general validation for any Relational Database Management System RDMS and the other is MySQL specific Beneath these menu items are a number of specific validation tests Running any one of these tests opens an output window docked at the bottom of the application Warning messages are displayed on the left side of this window and the tests performed are displayed on the right The following sections outline the tasks performed by the validation modules 8 10 1 General Validation The following list names the general validation types and gives examples of specific violations Empty Content Validation e A table with no columns e A routine or view with no SQL code defined e A routine group containing no routines A table view or routine not referenced by at least one role e A user with no privileges e Objects such as tables that do not appear on at least one EER Diagram Table Efficiency Validation 162 MySQL Specific Validation e A table with no primary key A primary key that does n
441. new tab within the main SQL Editor window You can also access the MySQL Table Editor from an EER Diagram by double clicking a table object 105 Creating Tables 8 7 1 3 1 The Main Editor Window Any number of tables may be edited in the MySQL Table Editor at any one time Adding another table creates a new tab at the top of the editor By default the MySQL Table Editor appears docked at the top of the table editor tab within the SQL editor The MySQL Table Editor is shown on top of the following figure Figure 8 9 The Table Editor 5 3 aas Se z gt create dete last_update lt S550888838 cton 1 154154 SELECT FROM sakia actor UMIT 0 1000 2 154521 SELECT FROM sakia customer LIMIT 1000 The MySQL Table Editor provides a work space that has tabs used to perform these actions e Columns Add or modify columns Indexes Add or modify indexes Foreign Keys Add or modify foreign keys Triggers Add or modify triggers e Partitioning Manage partitioning e Options Add or modify various general table and row options The following sections discuss these tabs in further detail 8 7 1 3 2 The Columns Tab Use the Columns tab to display and edit all the column information for a table With this tab you can add drop and alter columns 106 Creating Tables You can also use the Columns tab to change column properties such as name data type and default value Figure 8 10
442. ng a user opens a pop up menu The items in the menu function as described in Section 8 5 5 1 Adding Roles 8 5 6 The SQL Scripts Panel Use the SOL Scripts panel to load and modify SQL scripts If you created your project from an SQL script and plan to create an ALTER script you may want to add the original script here since it will be needed to create an ALTER script For more information see Section 8 7 10 1 2 Altering a Schema 8 5 7 The Model Notes Panel Use the Model Notes panel to write project notes Any scripts or notes added will be saved with your project 8 5 8 The History Palette Use the History palette to review the actions that you have taken Left clicking an entry opens a pop up menu with the item Copy History Entries to Clipboard Choose this item to select a single entry You can select multiple contiguous entries by pressing the Shift key and clicking the entries you wish to copy Select noncontiguous entries by using the Control key Only actions that alter the MySQL model or change an EER diagram are captured by the History palette 8 5 9 The Model Navigator Panel Docked at the top left of the application is the Model Navigator or Bird s Eye panel This panel provides an overview of the objects placed on an EER diagram canvas and for this reason it is most useful when an EER diagram is active Any objects that you have placed on the canvas should be visible in the navigator The Model
443. ng list of licenses and acknowledgements for third party software incorporated in the Python distribution Mersenne Twister The _random module includes code based on a download from http www math keio ac jp matumoto MT2002 emt19937ar html The following are the verbatim comments A Con epee wie MOIS S7 aeia Uee eA from the original code ation improved 2002 1 26 Coded by Takuji Nishimura and Makoto Matsumoto Before using initialize the state by u or init_by_array init_key key_length Copy eront ey Veo 2 U02y All rights reserved Redistribution and use in source and bi modification are permitted provided th are mets Redistributions of source code must NOtTCo wnt hls TSE ORL COnNdItIrOnS and ns Redistributions in binary form must notreer ENIS Ist OP COnGitt rons and documentation and or other material GLSlr UbulLon The names of its contributors may n products derived from this software permission THIS SOFTWARE IS PROVIDED BY THE COPYRI AS TSF LIMITED TO THE IMPLIED WARRANTIES OF M A PARTICULAR PURPOSE ARE DISCLAIMED I CONTRIBUTORS BE LIABLE FOR ANY DIRECT EXEMPLARY OR CONSEQUENTIAL DAMAGES IN PROCUREMENT OF SUBSTITUTE GOODS OR SERV PROFITS OR BUSINESS INTERRUPTION LPABL iT TY WHETHER TN CONTRAGC D SPRECI NEGLIGENCE OR OTHERWISE ARISING IN ANY AND ANY EXPRESS OR IMPLIED WARRANTIES sing init_genrand seed Makoto Matsumoto and Takuji Nishimura nary forms with or wi
444. nge colors and fonts used by various Workbench components A more detailed discussion of these options follows 6 4 1 The General Tab The General tab enables you to set the following options 51 The General Tab Figure 6 2 The General Preferences Dialog Box r Workbench Preferences xs General Administrator SQL Editor SQL Queries Model Model MySQL Diagram Appearance EER Modeler Automatically reopen previous model at start Force use of software based rendering for EER diagrams Allowed values are from 1 up Model undo history size 50 Note using high values gt 100 will increase memory usage and slow down operation Interval to perform auto saving of the open model Auto save model interval 1 minute The model will be restored from the last auto saved version if Workbench unexpectedly quits SQL Editor 7 Save snapshot of open editors on dose Interval to perform auto saving of all open script tabs Auto save scripts interval disable The scripts will be restored from the last auto saved version if Workbench unexpectedly quits _ Create new tabs as Query tabs instead of File Others T Place sidebar on the right side E Allow more than one instance of MySQL Workbench to run Select the language to use in the interactive GRT shell Interactive GRT Shell language python Scripts modules and plugins will work regardless of this setting This option requires a restart This schema w
445. ngineer compare and user accounts browse status variables manage database objects Ses synchronize schemas report and server logs Re Re at Open Existing EER Model amp Server Administration a Local instance MySQL55 User root Host bocahost 3306 sacou ee E ej Manage Connections o ele On the Physical Schemata toolbar click the button to add a new schema This will create a new schema and display a tabsheet for the schema In the tabsheet change the name of the schema to dvd_collection by typing into the field called Name Ensure that this change is reflected on the Physical Schemata tab Now you are ready to add a table to your schema 40 Creating a Model Figure 5 14 Getting Started Tutorial New Schema L MysQt tSOL Mode gt File Edit View Arrange Model Database Plugins Scripting Community Help Serr 2O32099 Ra Des Definiten TINYINT 1 LE TINYINT 1 DECIMAL 10 LOATS FLOAT DOUBLE TINYINT 4 SMALLINT 6 MEDIUMINT INT 11 BIGINT 20 INT 11 MEDIUMBLOS MEDIUMTEXT MEDIUMTEXT MEDIUMINT DECIMAL 10 In the Physical Schemata section double click Add Table This will automatically load the table editor with the default table name being table1 In the table editor change the name of the table from table1 to movies Next add several columns Double click a cell within the Column Name column and the first field will default to moviesid be
446. nk Software Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO HE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR URPOSE ARE DISCLAIMED IN NO EVENT SHALL OPENLINK OR CONTRIBUTORS E LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY R CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF UBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS NTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN ONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF HE POSSIBILITY OF SUCH DAMAGE iS 2 el ee lee bis iS A 15 Libiconv License The following software may be included in this product Libiconv You are receiving a copy of the GNU LIBICONV Library The terms of the Oracle license do NOT apply to the GNU LIBICONV Library it is licensed under the following license separately from the Oracle programs you receive If you do not wish to install this program you may delete iconv dll or libiconv files This component is licensed under Section A 12 GNU Lesser General Public License Version 2 1 February 1
447. nnection and executing a utility using variable substitution Note it may be necessary to escape the on some platforms for example Linux Output below is an excerpt and is representational only mysqluc e set SERVER root host123 mysqldiskusage server S SERVER 331 mysqluserclone Clone Existing User to Create New User Source on host123 connected NOTICE Your user account does not have read access to the datadir Data sizes will be calculated and actual file sizes may be omitted Some features may be unavailable Database totals 4 4 db_name total 4 4 world 4 4 Total database disk usage 1 072 359 052 bytes or 1022 00 MB done The following demonstrates launching the console using the commands shown above but piped into the console on the command line The results are the same as above echo set SERVER root host123 mysqldiskusage server S SERVER mysqluc The following demonstrates launching the console and setting variables via the command line mysqluc SERVER root host123 VAR_A 57 e show variables Variable Value SERVER root host123 VAR_A i 14 4 21 mysqluserclone Clone Existing User to Create New User This utility uses an existing MySQL user account on one server as a template and clones it to create one or more new user accounts
448. nsistency check failed done 14 4 5 mysqldbcopy Copy Database Objects Between Servers This utility copies a database on a source server to a database on a destination server If the source and destination servers are different the database names can be the same or different If the source and destination servers are the same the database names must be different The utility accepts one or more database pairs on the command line To name a database pair use db_name new_db_name syntax to specify the source and destination names explicitly If the source and destination database names are the same db_name can be used as shorthand for db_name db_name By default the operation copies all objects tables views triggers events procedures functions and database level grants and data to the destination server There are options to turn off copying any or all of the objects as well as not copying the data To exclude specific objects by name use the exclude 269 option with a name in db obj format or you can supply a search pattern For example exclude db1 trig1 269 excludes the single trigger and exclude trig_ 269 excludes all objects from all databases having a name that begins with t rig and has a following character 267 mysqldbcopy Copy Database Objects Between Servers By default the utility creates each table on the destination server using the same storage engine as the original table To overri
449. nt Subpartition By Parameters Subpartition Count ee ee els eC Melee Partitioning Meseeur 111 Creating Tables The Partition By pop up menu displays the types of partitions you can create e HASH e LINEAR HASH e KEY e LINEAR KEY e RANGE e LIST Use the Parameters field to define any parameters to be supplied to the partitioning function such as an integer column value Choose the number of partitions from the Partition Count list To manually configure your partitions check the Manual check box This enables entry of values into the partition configuration table The entries in this table are Partition Values Data Directory e Index Directory e Min Rows e Max Rows Comment Subpartitioning is also available For more information about partitioning see Partitioning 8 7 1 3 7 The Options Tab The Options tab enables you to set several types of options 112 Creating Tables Figure 8 15 The Options Tab Options General Options this option to o r ia x ile analy in sedates slower and reads fast 5 p x Use this option to generate smaller indices This usually makes updates slower and reads faster Pack Keys Don tuse Sen ULT telis the storage engine to only pack long CHAR VARCHAR columns Table Password Pa z the table definition file This option does not do anything in the standard M Auto Increment 600 The intial AUTO_INCREMENT valve for the
450. nt Uncomment lines Modifier SQL Editor of SQL Auto Complete SQL Modifier Space SQL Editor View Menu Table 13 3 View menu keyboard shortcuts Function Keyboard Shortcut Context Output Window Modifier F2 Modifier Option 2 Mac All OS X Set Marker n Modifier Shift n n is integer 1 9 EER Diagram Go to Marker n Modifier n n is integer 1 9 EER Diagram Arrange Menu Table 13 4 Arrange menu keyboard shortcuts Function Keyboard Shortcut Context Bring to Front Modifier Shift F EER Diagram Send to Back Modifier Shift B EER Diagram Model Menu Table 13 5 Model menu keyboard shortcuts Function Keyboard Shortcut Context Add Diagram Modifier T Model EER Diagram Validate All Modifier Alt V Model EER Diagram Validate All MySQL Modifier Alt B Model EER Diagram Model Options Command Alt Shortcut available only on Mac OS X Model EER Diagram Query Menu Table 13 6 Query menu keyboard shortcuts Function Keyboard Shortcut Context Execute statement Modifier Return SQL Editor Execute statements Modifier Shift Return SQL Editor New Tab Modifier T SQL Editor Database Menu Table 13 7 Database menu keyboard shortcuts Function Keyboard Shortcut Context Query Database Modifier U All Reverse Engineer Modifier R Model EER Diagram 234 Function Keyboard Shortcut Context Forward Engineer Modifier G Model EER Diagram Synchronize Mode
451. nt of admin commands Com_assign_to_keycache Count of ALTER DATABASE statements Com_alter_db_upgrade Count for ALTER EVENT statements Count of ALTER FUNCTION statements Com_alter_procedure Com_alter_server Count of ALTER TABLE statements Com_alter_tablespace Count of ANALYZE statements Count of BEGIN statements Com_binlog Number of calls to stored procedures Count of CHANGE DATABASE statements Count of CHANGE MASTER statements Count of CHECK statements Count of CHECKSUM statements Cunt af COMMIT nbabam ambn WB Admin Opened 10 7 6 The Data Dump Tab The Import Export Server Data tab enables you to create a dump file or restore data from a dump file Clicking the Import Export Server Data action item launches a new Admin page at the Data Dump tab Within the Data Dump tab are three further tabbed windows e Export to Disk e Import from Disk e Advanced Options 10 7 6 1 Export to Disk The Export to Disk tab enables you to select the schema and tables to export You also have the option to export tables to their own files or all tables to a single file Exporting tables to individual files enables you to restore on a per table basis 193 The Data Dump Tab Figure 10 10 Administrator Export to Disk i C TMSOL Wortbench Admin mysqld 127 0 0 1 X File Edit View Database Plugins Scripting Community Help Task and Object Browser MANAGEMENT 6 Server Status J Startup Shutdown 2
452. number of routines may be open at the same time Each additional routine appears as a tab at the top of the routine editor Routine and Privileges tabs appear at the bottom of the routine editor Navigate between different tabs using the mouse or from the keyboard by pressing Control Alt Tab 8 7 4 1 2 1 The Routine Tab Use the Routine tab of the routine editor to perform the following tasks e Rename the routine using the Name field e Enter the SQL to create a routine using the SQL field 8 7 4 1 2 2 The Privileges Tab The Privileges tab of the routine editor functions in exactly the same way as the Privileges tab of the table editor For more information see Section 8 7 1 3 9 The Privileges Tab Note R Privileges are available only in the Standard Edition of MySQL Workbench 8 7 4 2 Routine Groups 8 7 4 2 1 Adding Routine Groups to the Physical Schemata Double clicking the Add Routine Group icon inthe Physical Schemata section of the MySQL Model page adds a routine group with the default name of rout ines1 If a routine group with this name already exists the new routine group is named routines2 Adding a new routine group automatically opens the routine groups editor docked at the bottom of the application For information about using the routine groups editor see Section 8 7 4 2 3 The Routine Group Editor Right clicking a routine group opens a pop up menu with the following items e Rename e Cut routine_gro
453. o Adapter type VirtualBox Graphics Adapter Chip Type VBOX BIOS String Version OxB0C2 or later Video Memory 12288 KB 8 5 2 The Toolbar The MySQL Workbench toolbar is located immediately below the menu bar Click the tools in the toolbar to perform the following actions e The new document icon Creates a new document The folder icon Opens a MySQL Workbench file mwb extension e The save icon Saves the current MySQL Workbench project The right and left arrows The left arrow performs an Undo operation The right arrow performs a Redo operation Other tools appear on the toolbar depending upon the context 8 5 2 1 Tool Specific Toolbar Items When an EER diagram canvas is selected the following icons appear to the right of the arrow icons e The toggle grid icon Turns the grid on and off e The grid icon Aligns objects on the canvas with the grid e The new EER diagram icon Creates a new EER diagram tab The toolbar also changes depending upon which tool from the vertical toolbar is active For discussion of these tools see Section 8 6 1 The Vertical Toolbar 95 EER Diagrams If the Table tool is active schemata lists engine types and collations appear on the toolbar The table properties can be modified using the Properties Editor When an object is selected the object s properties such as color can be changed in the Properties Editor 8 5 3 EER Diagrams Use the Add new Diagram i
454. o ON employees titles emp_no USING BTREE may be redundant or duplicate of ALTER TABLE employees titles ADD PRIMARY KEY emp_no title from_date 14 4 12 mysqlmetagrep Search Database Object Definitions This utility searches for objects matching a given pattern on all the servers specified using instances of the server 302 option It produces output that displays the matching objects By default the first nonoption argument is taken to be the pattern unless the pattern 302 option is given If the pattern 302 option is given all nonoption arguments are treated as connection specifications Internally the utility generates an SQL statement for searching the necessary tables in the INFORMATION_SCHEMA database on the designated servers and executes it in turn before collecting the result and printing it as a table Use the sq1 802 option to have the utility display the statement rather than execute it This can be useful if you want to feed the output of the statement to another application such as the mysql monitor The MySQL server supports two forms of patterns when matching strings SQL Simple Patterns used with the LIKE operator and POSIX Regular Expressions used with the REGEXP operator By default the utility uses the LIKE operator to match the name and optionally the body of objects To use the REGEXP operator instead use the regexp 302 option Note that since the REGEXP operator does substring se
455. o display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit NOTES For the format 304 option the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 304 specifies the grid format An error occurs if a prefix matches more than one valid value The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES For each example assume that the root user on localhost has sufficient privileges to kill queries and connections Kill all queries created by user mats that are younger than 1 minute mysqlprocgrep server root localhost match user mats age 1m kill query Kill all connections that have been idle for more than 1 hour mysqlprocgrep server root localhost match command sleep age 1h kill connection 14 4 14 mysqlreplicate Set Up and Start Replication Between Two Servers This utility permits an administrator to start replication from one server the master to another the slave The user provides login information for the s
456. o performing a database migration Figure 11 12 MySQL Workbench migration Target Creation Options Target Creation Options Migration Task List OVERVIEW o gt Overview Select options for the creation of the migrated schema in the target MySQL server and click Next gt to execute SOURCE amp TARGET Schema Creation Source Selection Target Selection Fetch Schemata List Y Schemata Selection V Create schema in target RDBMS Create a SQL script file C WUsers philipmigration_script sql Y Reverse Engineer Source OBJECT MIGRATION Y Source Objects Options Migration E Keep schemata if they already exist Objects that already exist will not be recreated or updated Y Manual Editing Create Schemata Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report Create Schemata Now the schemata is created The complete log is also available here Figure 11 13 MySQL Workbench migration Create Schemata Create Schemata Overview The SQL scripts generated for the migrated schema objects will now be executed in the target database You can monitor execution in the logs and if there are errors SOURCE amp TARGET you may correct them in the next step Table data will be migrated at a later step Source Selection Y Target Selection Fetch Schemata List Y Schemata Selection Y Reverse Engineer Source Create Script File
457. o read the login path values from the login configuration file mylogin cnf EXAMPLES Find all objects with a name that matches the pattern t_ the letter t followed by any single character mysqlmetagrep pattern t_ server mats localhost 4 4 4 Connection Object Type Object Name Database 4 4 4 mats localhost 3306 TABLE tt test mats localhost 3306 TABLE 2 test mats localhost 3306 TABLE EES test 4 4 4 To find all object that contain t2 in the name or the body for routines triggers and events mysqlmetagrep b pattern t2 server mats localhost 3306 4 4 4 4 Connection Object Type Object Name Database 4 4 4 4 Soot Plocaltiost 2306 TRIGGER teTeoo test Pooks localtiose 3306 TABLE 2 test 4 4 4 4 In the preceding output the trigger name does not match the pattern but is displayed because its body does This is the same as the previous example but using the REGEXP operator Note that in the pattern it is not necessary to add wildcards before
458. o specify the output file name enter it into the Output SQL Script File field or use the Browse button to select a file If this field is left blank you will be able to view the generated script but it will not be saved to a file Generate DROP Statements Before Each CREATE Statement Select this option to generate a statement to drop each object before the statement that creates it This ensures that any existing instance of each object is removed when the output is executed Omit Schema Qualifier in Object Names Select this option to generate unqualified object names in SQL statements Generate Separate CREATE INDEX Statements 138 Forward Engineering Select this option to create separate statements for index creation instead of including index definitions in CREATE TABLE statements e Add SHOW WARNINGS after every DDL statement Select this option to add SHOW WARNINGS statements to the output This causes display of any warnings generated when the output is executed which can be useful for debugging e Do Not Create Users Only Export Privileges Select this option to update the privileges of existing users as opposed to creating new users Exporting privileges for nonexistent users will result in errors when you execute the CREATE script Exporting users that already exist will also result in an error e Generate INSERT Statements for Tables Select this option if you have added any rows to a table For more info
459. odate the controls would be used Table This is a container that can organize one or more controls in a grid The number of rows and columns in the table and the location of controls within the grid can be set by the developer ScrollView This is a container that can contain a single child control and will add scrollbars if the contents do not fit the available space 228 The Workbench Scripting Shell 12 5 The Workbench Scripting Shell 12 5 1 The Workbench Scripting Shell provides a means for entering and executing scripts Through the use of the scripting shell MySQL Workbench can support new behavior and data sources using code written in Lua and Python The shell can also be used to explore the current Workbench GRT Generic Runtime facilities The scripting shell is not only useful for expanding MySQL Workbench You can use a script file from the scripting shell command line to perform repetitive tasks programmatically The development language can be either Python or Lua The default programming language used in Workbench Scripting Shell is defined in the General tab of the MySQL Workbench Preferences dialog and defaults to Python with MySQL Workbench For more information see Chapter 14 MySQL Note R Although they serve a different purpose the MySQL Utilities are also bundled Utilities Exploring the Workbench Scripting Shell To open the Workbench Scripting Shell select Scripting Scripting Shell from the
460. of each of the other slaves thereby collecting any transactions executed on other slaves but not the candidate In this way the candidate becomes the most up to date slave elect This mode is the same as auto except if no candidates specified in the list of candidate slaves are viable it does not check the remaining slaves and generates and error and exits fail This mode produces an error and does not failover when the master is downed This mode is used to provide periodic health monitoring without the failover action taken For all options that permit specifying multiple servers the options require a comma separated list of connection parameters in the following form where the password port and socket are optional lt User gt lt passwd gt G host gt lt port gt s lt secket gt or lt login pathi k L port ee socketa The utility permits users to discover slaves connected to the master In order to use the discover slaves feature all slaves must use the report host and report port startup variables to specify the correct hostname and ip port of the slave If these are missing or report the incorrect information the slaves 290 mysql failover Automatic replication health monitoring and failover health may not be reported correctly or the slave may not be listed at all The discover slaves feature ignores any slaves it cannot connect to The discover slaves feature is run automatically on ea
461. of much more complex pattern matching expression OPTIONS mysqlauditgrep accepts the following command line options end date lt END_DATE gt End date time to retrieve log entries until the specified date time range If not specified or the value is 0 all entries to the end of the log are displayed Accepted formats yyyy mm ddThh mm ss or yyyy mm dd event type lt EVENT_TYPE gt Commaz separated list of event types to search in all audit log records matching the specified types Supported values are Audit Binlog Dump Change user Close stmt Connect Out Connect Create DB Daemon Debug Delayed insert Drop DB Execute Fetch Field List Init DB Kill Long Data NoAudit Ping Prepare Processlist Query Quit Refresh Register Slave Reset stmt Set option Shutdown Sleep Statistics Table Dump Time file stats Display the audit log file statistics format FORMAT f FORMAT Output format to display the resulting data Supported format values GRID default TAB CSV VERTICAL and RAW help Display a help message and exit pattern lt PATTERNs gt e lt PATTERN gt Search pattern to retrieve all entries with at least one attribute value matching the specified pattern By default the standard SQL LIKE patterns are used for matching If the regexp option is set then REGEXP patterns must be specified for matching query type lt QUERY_TYPE gt Commaz separated list of SQL statements commands
462. og On usr local mysql data scissors localerr fat pame General Log off last name last update t Slow Query Log off Replication Slave this server is not a slave in a replication setup Authentication Enterprise Features Support for MySQL Enterprise features in the Commercial edition of MySQL Workbench was added From within the Management tab for an open connection look for the following products under the heading MySQL Enterprise MySQL Enterprise Backup MEB A GUI frontend for the MEB tool After installing a commercial version of MySQL Workbench and MySQL Enterprise Backup MySQL Workbench will check for and handle the pre requisites Backup recovery is also supported This plugin supports MEB with local and remote installations of Linux and Mac OS X and locally for MySQL Windows MySQL Audit Log Inspector A GUI for browsing the contents of generated logs by the commercial Audit Log Plugin Powerful filtering and search capabilities are available Fast browsing is provided by caching the log data locally in an encrypted file This plugin supports MEB with local and remote installations of Linux and Mac OS X and locally for MySQL Windows Database Migration Features SQL Anywhere and SQLite are now supported 15 16 Chapter 3 MySQL Workbench Editions The Community Edition OSS The Community Edition is the foundation of all MySQL Workbench editions versions that are currently available or those t
463. og e FAQs About Workbench e Learn How To Code For Workbench e Discuss Workbench Topics e Contribute To Workbench The Help Menu The Help menu has the following items Use them to go online and learn more about MySQL Workbench e Help Index Opens a window showing the MySQL Workbench documentation Read search or print the documentation from this window e MySQL com Website Opens your default browser on the MySQL Web site home page e Workbench Product Page Opens your default browser on the MySQL Workbench product page e System Info Displays information about your system which is useful when reporting a bug For more information see Section 8 5 1 10 1 System Info Report a Bug Opens a form to submit a bug to bugs mysql com and optionally attaches the log file to the report Additional information such as the MySQL Workbench version configuration and data directory paths operating system and more are appended to the report but is made private so only those with proper permissions such as MySQL developers can view this helpful debugging information e View Reported Bugs Opens your default browser to see a list of current bugs Locate log file Opens up the directory that contains the MySQL Workbench log files e Check For Updates Opens the MySQL Workbench website using your default browser and checks for a newer version e About Workbench Displays the MySQL Workbench About window 94 The Toolbar
464. okie module contains the following notice Copyright 2000 by Timothy O Malley lt timo alum mit edu gt All Rights Reserved Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the name of Timothy O Malley not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission Timothy O Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL Timothy O Malley BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE Profiling The profile and pstats modules contain the following notice Copyright 1994 by InfoSeek Corporation all rights reserved Written by James Roskind Permission to use copy modify and distribute this Python software and its associated documentation for any purpose subject to the restriction in the following sentence without fee is hereby granted provided that the above copyright notice appears in
465. okup the comparison could fail Without the ability to do a reverse name lookup the replication utilities could report a false negative that the slave is not connected to the master For example if you setup replication using MASTER_HOST ubuntu net on the slave and later connect to the slave with mysqlrplcheck and have the master specified as master 192 168 0 6 using the valid IP address for ubuntu net you must have the ability to do a reverse name lookup to compare the IP 192 168 0 6 and the hostname ubuntu net to determine if they are the same machine The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To check the prerequisites of a master and slave that currently are actively performing replication use the following command mysqlrplcheck master root host1 3310 slave root host2 3311 master on hostl connected slave on host2 connected Test Description Status Checking for binary logging on master pass Are there binlog exceptions pass Replication user exists pass 319 mysqlrplcheck Check Replication Prerequisites Checking server_id values pass Is slave connected to master pass Check master information file pass
466. ole or in part in another publication requires the prior written consent from an authorized representative of Oracle Oracle and or its affiliates reserve any and all rights to this documentation not expressly granted above For more information on the terms of this license or for details on how the MySQL documentation is built and produced please visit MySQL Contact amp Questions For help with using MySQL please visit either the MySQL Forums or MySQL Mailing Lists where you can discuss your issues with other MySQL users For additional documentation on MySQL products including translations of the documentation into other languages and downloadable versions in variety of formats including HTML and PDF formats see the MySQL Documentation Library Chapter 1 MySQL Workbench Introduction MySQL Workbench provides a graphical tool for working with MySQL Servers and databases MySQL Workbench fully supports MySQL Server versions 5 1 and above It is also compatible with MySQL Server 5 0 but not every feature of 5 0 may be supported It does not support MySQL Server versions 4 x MySQL Workbench provides three main areas of functionality e SQL Development Enables you to create and manage connections to database servers As well as enabling you to configure connection parameters MySQL Workbench provides the capability to execute SQL queries on the database connections using the built in SQL Editor This functionality replaces that
467. olumns Render Table Indices Display all the indexes Render Foreign Keys Display all the foreign keys List Foreign Keys that refer to that table Display the tables that foreign keys reference Include DDL code for objects Generates DDL code Clicking the Generate button creates the directory defined in the Output directory text box If you chose to create HTML Basic Frames you will find the following files in this directory basic css The style sheet for the overview html page index html The main page overview htm1 The model overview the navigation links shown in the sidebar restrained css The CSS file used if the Restrained Colors style option was chosen table_details html The main frame of the model report Choosing the HTML Basic Single Page option creates a style sheet and an index htmi file Choosing the HTML Detailed Frames option creates the following files basic css The style sheet for the overview html page This is used if the vibrant style is chosen coated css The CSS file used if the Coated style option was chosen index html The main page overview htm1 Overview information for the report such as report title project name and author overview_list html A summary of schema in the model along with a list of tables contained in each schema 165 Customizing DBDoc Model Reporting Templates e routine _details html List of all routines for the schema e table_details html
468. olumns actor id smallint 5 UN PK Al first_name varchar 45 last_name varchar 45 last_update timestamp 7 7 5 3 Object Browser The Object Browser contains an Actions list and a Schemata list as seen in the following screenshot Figure 7 15 SQL Editor Object Browser Object Browser ACTIONS F Execute SOL File EF Add Schema F Add Table E Add View Ai Add Routine SCHEMAS gt E test gt world Object Browser Actions List The Object Browser contains an Actions list The actions are Execute SQL File Opens an Open File dialog that enables you to select an SQL script to execute e Add Schema Enables you to add a new schema to your server Add Table Enables you to create a new table via the new_table dialog e Add View Enables you to create a new view via the new_view dialog 79 Sidebar e Add Routine Enables you to create a new routine via the new_routine dialog Schemata List The Schemata list shows available schemata on the currently connected server These can be explored to show tables views and routines within the schema Figure 7 16 SQL Editor Schemata Explorer SCHEMAS Lt a p dvd_collection HE sakila bi test 7E world win Tables City Columns ID Pl Name OOOO CountryCode District Population gt ET Indexes je TA Foreign Keys je FI Triggers eE Country CountryLanquage b test gt ia Views bE Routines It is possible to set a schema
469. ommit Result Edits gt E film_category last update 28 Discard Result Edits gt E film_text actor_id 3 gt E inventory ED Export Results gt language C ssessess 4 row Seeeesseseccesceseess gt T payment actor_id 4 first_name JENNIFER gt i renta last_name DAVIS gt E staff last_update 2006 02 15 04 34 33 BE eee 5 row eee actor_id 5 first_name JOHNNY last_name LOLLOBRIGIDA Table actor last_update 2006 02 15 04 34 33 Col Cee 6 row SCC eee eee umns actor_id 6 actor id smallint 5 UN Al PK first_name BETTE first_name varchar 45 last_name NICHOLSON gee waa Last updata 2005 92 15 p lt AEEA ast_update timestamp actor id 7 first_name GRACE last_name MOSTEL last_update 2006 02 15 04 34 33 Vertical Output 11 Improved Visual Explain Improved Visual Explain Figure 2 10 Visual Explain Workbench 5 2 ao FACB COM Vas SELECT CONCAT customer 1last_name Customer first_name AS customer address phone fila title FROM rental INNER JOIN customer ON rental customer_id customer customer_id INNER JOIN address ON customer address_id address address_id INNER JOIN inventory ON rental inventory_id inventory inventory_id INNER JOIN film ON inventory file_id film fila_ia WHERE rental return_date IS NULL AND rental_date INTERVAL film rental_duration DAY lt CURRENT _DATE LIMIT 5 99 12 Improved Server Status Figure 2 11 Visual Explain Workbench 6 0
470. onal actions required Linux Setting up drivers on Linux FreeTDS version 0 92 or greater is required Note that many distributions ship older versions of FreeTDS so it may need to be installed separately Additionally the FreeTDS version provided by distributions may also be compiled for the wrong ODBC library usually to unixODBC instead of iODBC which MySQL Workbench uses Because of that you will probably need to build this library yourself Important using FreeTDS with iODBC R When compiling FreeTDS for use with iODBC the default with the official binaries you must compile it with the nable odbc wide command line option for the configure script Failing to do so will result in crashes and other unpredictable errors 215 Connection Setup 11 4 2 3 A script is provided to compile FreeTDS using the options required for MySQL Workbench You can find it in the usr share mysql workbench extras build_freetds sh directory in Linux or MySQLWorkbench app Contents SharedSupport build_freetds sh folder in the Mac To use it follow these steps 1 Make sure you have the iODBC headers installed In Linux install the 1ibiodbc devel or libiodbc2 dev package from your distribution In Mac OS X the headers come with the system and no additional action is required for this step 2 mkdir freetds to create a directory within the users home directory 3 Copy the build_freetds sh script to freetds A Get the lat
471. onfigured to the given master start Execute the START SLAVE command on all slaves This command requires the slaves 313 option The discover slaves login 812 option is not allowed because it 310 mysql rpladmin Administration utility for MySQL replication might not provide the expected result excluding slaves with the IO thread stopped Optionally the master 313 option can also be used and in this case the utility will perform an additional check to verify if the specified slaves are associated i e replication configured to the given master stop Execute the STOP SLAVE command on all slaves This command requires the s laves 313 option The discover slaves login 312 option is not allowed because it might not provide the expected result excluding slaves with the IO thread stopped Optionally the master 313 option can also be used and in this case the utility will perform an additional check to verify if the specified slaves are associated i e replication configured to the given master switchover Perform slave promotion to a specified candidate slave as designated by the new master 313 option This command is available for both gtid enabled servers and non gtid enabled scenarios This command requires one of the following combinations e master 813 new master 313 and slaves 313 e master 813 new master 313 and discover slaves login 312 Detection of a downe
472. ons from mysql utilities common options import parse_connection Ery conn parse_connection opt server except parser error Server connection values invalid or cannot be parsed Now that we have the connection parameters we create a class instance of the server using the Server Class from the server module and then connect Once again we check for exceptions 242 Introduction to extending the MySQL Utilities from mysql utilities common server import Server server_options Helinin aiueo e EONA role R Usopieee serverl Server server_options Ery serverl connect except UtilError e print ERROR e errmsg The next item is to get a list of all of the databases on the server We use the new server class instance to retrieve all of the databases on the server dba kisti for db in serverl get_all_databases db_list append db 0 None If you wanted to supply your own list of databases you could use an option like the following You could also add an 1se clause which would enable you to either get all of the databases by omitting the databases option or supply your own list of databases for example databases db1 db2 db3 databases action store dest dbs_to_copy parser add_option d type string help comma separated list of databases to include in the copy omit for all databases default None if opt dbs_to_copy is None for db in serverl get_all_database
473. option specifies To run the utility against several servers specify the server 328 option multiple times In this case the utility attempts to connect to each server and read the information To see the MySQL servers running on the local machine use the show servers 328 option This shows all the servers with their process ID and data directory On Windows the utility shows only the process ID and port OPTIONS mysqlserverinfo accepts the following command line options e help Display a help message and exit e basedir lt basedir gt The base directory for the server This option is required for starting an offline server Is also used to access server tools such as my_print_defaults that is required to read the login path values from the login configuration file mylogin cnf 327 mysqlserverinfo Display Common Diagnostic Information from a Server datadir lt datadir gt The data directory for the server This option is required for starting an offline server format lt format gt f lt format gt Specify the output display format Permitted format values are grid csv tab and vertical The default is grid no headers h Do not display column headers This option applies only for csv and tab output port range lt start end gt The port range to check for finding running servers This option applies only to Windows and is ignored unless show servers 828 is given The default range is 3
474. or example to copy a database with the name weird db name with other weird db name the database pair must be specified using the following syntax in non Windows EXAMPLES weird db name other weird db name The following example demonstrates how to use the utility to copy a database named ut il_test toa new database named util_test_copy on the same server mysqldbcopy source root pass localhost 3310 test123 mysql sock destination root pass localhost 3310 test123 mysql sock util_test util_test_copy Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying Copying a COME Source on localhost connected Destination on localhost connected database util_test renamed as util_test_copy TABLE util_test tl table data TABLE util_test t2 table data TABLE util_test t3 table data TABLE util_test t4 table data VIEW util_test vl TRIGGER util_test trg PROCEDURE util_test pl FUNCTION util_test f1 EVENT util_test el GRANTS from util_test If the database to be copied does not contain only InnoDB tables and you want to ensure data integrity of the copied data by locking the tables during the read step add a locking lock all 269 option to the command mysqldbcopy source root pass localhost 3310 test123 mysql sock destination root pass localhost 3310 test123 mysql sock util_test util_t
475. ore connection for future usage as Migration Report Fetch Schemata List The Schemata list is retrieved from both the source and target RDBMS This is an automated and informational step that reports connection related errors and or general log information Press Next to continue Figure 11 5 MySQL Workbench migration Fetch Schemata List File Edit View Database Plugins Scripting Help Migration Task List Fetch Schema List OVERVIEW Overview The following tasks will now be performed Please monitor the execution SOURCE amp TARGET The names of available schemas will be retrieved from the source RDBMS The account used for s the connection will need to have appropriate privileges for listing and reading the schemas you Source Selection want to migrate Target RDBMS connection settings will also be checked for validity Target Selection Schemata Selection Connect to source DBMS gt Reverse Engineer Source O Check target DBMS connection O Retrieve schema list from source OBJECT MIGRATION Source Objects Migration Click Next gt to execute Manual Editing Target Creation Options Create Schemata q Create Target Results DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report Schemata Selection Choose the schemata you want to migrate 204 A visual guide to performing a database migration Schema Name Mapping Method options while migrating Microsoft SQL
476. ore repetitions of the preceding regular expression Match zero or one repetition of the preceding regular expression l Match either the regular expressions from the left or right of Indicates a set of characters to match Note that special characters lose their special meaning inside sets In particular acquires a different meaning if it is the first character of the set matching the complementary set i e all the characters that are not in the set will be matched m Match m repetitions of the preceding regular expression m n Match from m to n repetitions of the preceding regular expression Define a matching group and matches the regular expression inside the parentheses For example ma xm Match a sequence of zero or more a ngg Match a sequence of one or more a maon Match zero or one a Yap ica Match ab or cd iaxy Match a x or y fa f Match any character in the range a to f that is a b c d e or f tf axy m 256 mysqlauditgrep Allows users to search the current or an archived audit log Match any character except a x or y afsp Match exactly five copies of a Gen e Match from two to five copies of a abe Match one or more repetitions of abc This is a brief overview of regular expressions that can be used to define this type of patterns The full syntax is described in the Python re module docs supporting the definition
477. ort databases on a server with GTIDs enabled GTID_MODE ON a warning will be generated if the import file did not include the GTID statements generated by mysqldbexport The utility will also generate a warning if you import databases on a server without GTIDs enabled and there are GTID statements present in the file Use the skip gtid 281 option to ignore the GTID statements To make the most use of GTIDs and export import you should export all of the databases on the server with the a11 276 option This will generate an export file with all of the databases and the GTIDs executed to that point Importing this file on another server will ensure that server has all of the data as well as all of the GTIDs recorded correctly in its logs OPTIONS mysqldbimport accepts the following command line options e help Display a help message and exit e bulk insert b Use bulk insert statements for data e default storage engine lt def_engine gt The engine to use for tables if the destination server does not support the original storage engine on the source server drop first d 280 mysqldbimport Import Object Definitions or Data into a Database Drop each database to be imported if exists before importing anything into it dryrun Import the files and generate the statements but do not execute them This is useful for testing input file validity format lt format gt f lt format gt Specify the input
478. ost port role state gtid_mode health 4 4 4 4 4 4 localhost 3333 MASTER UP ON OK localhost 3332 SLAVE UP ON OK localhost 2334 SLAVE UP ON OK 4 4 4 4 4 4 done To view a detailed replication health report but with all of the replication health checks revealed use the verbose 314 option as shown below In this example we use vertical format to make viewing easier mysqlrpladmin master root localhost 3331 slaves root localhost 3332 root localhost 3333 root localhost 3334 verbose health Getting health for master localhost 3331 Attempting to contact localhost Success Attempting to contact localhost Success Attempting to contact localhost Success Attempting to contact localhost Success Replication Topology Health KREKKKKKKKKKK KKK KKK KKKKKKEK als row KREKKKKKKKKKKKKKKKKKKKKKEEKEK HO Sites lO Callie sits ponc SJal role MASTER state UP gtid_mode ON health OK version 5 6 5 m8 debug log master_log_file mysql bin 000001 master_log_pos 571 IO_Thread SQL_Thread Secs_Behind Remaining_Delay IO Error Num 315 mysqlrpladmin Administration utility for MySQL replication TO Error kkkkxkxkxkxkxkxkkxkxkxkxk xk xkxkxkkkkkxk kxx ee row KKEKKKEKKKKKEKKKKEKKKAKKKKKKKK NO Sie melo Gellunorcits
479. ot use an integer based data type A foreign key that refers to a column with a different data type Duplicated Identifiers Validation e Duplicate object names e Duplicate role or user names Duplicate index or routine names e Consistency Validation Use of the same column with columns of differing data types e Logic Validation A foreign key that refers to a column other than the primary key in the source table e Any object that is object is either read only or write only by role definition e Placeholder objects left over from reverse engineering 8 10 2 MySQL Specific Validation The following list names the MySQL specific validation types and gives examples of specific violations e Integrity Violation e An object name longer than the maximum permitted A foreign key defined for an engine type that does not support foreign keys not yet implemented A view or routine that references a nonexistent table not yet implemented e A default value that does not match a column s data type e An invalid partitioning scheme e Syntax Violation e A routine trigger or view with incorrect SQL syntax A reserved keyword used as an identifier Use of an invalid character 8 11 The DBDoc Model Reporting Dialog Window Commercial Version This dialog window is found by navigating to the Model menu and choosing the DBDoc Model Reporting item Note R The DBDoc Model Reporting item is not available in the MySQL Workbench O
480. ouble clicking a table creates an associative table with a many to many relationship For this tool to function there must be a primary key defined in the initial table Use the Model menu Menu Options menu item to set a project specific default name for the foreign key column see Section 8 5 1 5 4 The Relationship Notation Submenu To change the global default see Section 6 4 5 The Model Tab To edit the properties of a foreign key double click anywhere on the connection line that joins the two tables This opens the relationship editor Mousing over a relationship connector highlights the connector and the related keys as shown in the following figure The film and the film_actor tables are related on the film_id field and these fields are highlighted in both tables Since the i1m_id field is part of the primary key in the film_actor table a solid line is used for the connector between the two tables 116 Creating Foreign Key Relationships Figure 8 16 The Relationship Connector film v fim _id SMALLINT S title VARCHAR 255 description TEXT 9 release_year YEAR language_id TINYINT 3 original_language_id TINYINT 3 m film_actor v rental_duration TINYINT 3 film actor fil actor id SMALLINT S rental_rate DECIMAL 4 2 Fim id SMALLINT S length SMALLIN eee 15 last_update TIMESTAMP replacement_cost DECIMAL 5 2 5 rating ENUM G PG PG
481. over commands The user can specify these with the xec be fore 312 and exec after 312 options The return code of the script is used to determine success thus each script must report 0 Success to be considered successful If a script returns a value other than 0 the result code is presented in an error message The utility permits the user to log all actions taken during the commands The 10g 813 option requires a valid path and file name of the file to use for logging operations The log is active only when this option is specified The option 1og age 313 specifies the age in days that log entries are kept The default is seven 7 days Older entries are automatically deleted from the log file but only if the 10g 313 option is specified The format of the log file includes the date and time of the event the level of the event informational INFO warning WARN error ERROR critical failure CRITICAL and the message reported by the utility The utility has a number of options each explained in more detail below Some of the options are specific to certain commands Warning messages are issued whenever an option is used that does not apply to the command requested A brief overview of each command and its options is presented in the following paragraphs The start stop and reset commands require the slaves 313 option to list all of the slaves in the topology Optionally the master 313 option can be s
482. palette on the left side of the application They may be added to an EER Diagram when in the EER Diagram tab by dragging and dropping them from this palette 8 7 3 2 Adding Views to an EER Diagram Views can also be added to an EER Diagram using the view tool on the vertical toolbar Make sure that the EER Diagram tab is selected then left click the view icon on the vertical toolbar The view icon is the two overlapping rectangles found below the table icon Clicking this icon changes the mouse pointer to a view pointer To change the mouse pointer to a view pointer from the keyboard use the V key Choosing the View tool changes the contents of the toolbar that appears immediately below the main menu bar When the Views pointer is active this toolbar contains a schemata list and a color chart list Use these lists to select the appropriate schema and color accent for the new view Make sure that you associate the new view with a database The color of your view can be changed using the Properties palette Create a view by clicking anywhere on the EER Diagram canvas This creates a new view with the default name view1 To revert to the default mouse pointer click the arrow icon at the top of the vertical toolbar Right clicking a view opens a pop up menu With the exception of the delete item these menu items function as described in Section 8 7 3 1 Adding Views to the Physical Schemata The behavior of the delete option is determin
483. password Default Schema The schema that will be used as default schema New Delete Duplicate MoveUp Move Down Advanced The options here are the same as for the Standard TCP IP connection See Section 7 6 2 Standard TCP IP Connection 7 7 SQL Editor MySQL Workbench 5 2 introduced the SQL Editor facility The SQL Editor can be launched using various action items on the Home window It can also be launched by selecting Database Query Database from the main menu or by using the keyboard shortcut Control U on Windows or Command U on Mac OS X At this point you will be asked to either select a stored connection or enter the details for a new connection After a connection has been made to the server a new tab called SQL Editor schema is displayed 70 Main Menu Figure 7 5 SQL Editor e090 MySQL Workbench _ SQL Editor localhost SCHEMAS a Gul FfACBOOB 4 a mvs MySnippets dvd_collection 1e SELECT FROM world Country sakila 100 s II t Filter Q 4 Edi E E Export Ey eo Code Name Continent Region SurfaceArea IndepYear Popul ABW Aruba North America Caribbean 193 00 fruit 1030 AFG Afghanistan Asia Southern and 652090 00 1919 2272 AGO Angola Africa Central Africa 1246700 00 1975 1287 AIA Anguilla North America Caribbean 96 00 8000 ALB Albania Europe Southern Europe 28748 00 1912 3401 AND Andorra Europe Southern Europe 468 00 1278 7800 ANT Netherlands A
484. pear at the bottom of the routine editor Navigate between different tabs using the mouse or from the keyboard by pressing Control Alt Tab The Routine Groups Tab Use the Routine Groups tab of the routine groups editor to perform the following tasks e Rename the routine group using the Name field e Add routines to the group by dragging and dropping them 123 Creating Layers Add comments to the routine group 8 7 4 2 3 2 The Privileges Tab The Privileges tab of the routine group editor functions in exactly the same way as the Privileges tab of the table editor For more information see Section 8 7 1 3 9 The Privileges Tab Note E Privileges are available only in the Standard Edition of MySQL Workbench 8 7 4 2 3 3 Modifying a Routine Group Using the Properties Palette When you select a routine group on the EER Diagram canvas its properties are displayed in the Properties palette All of the properties accessible from the Properties palette apply to the appearance of a routine group on the EER Diagram canvas For a list of properties accessible through the Properties palette see Section 8 5 12 The Properties Palette 8 7 5 Creating Layers You can add layers to a database only from an EER Diagram Layers are used to help organize objects on the canvas Typically related objects are added to the same layer for example you may choose to add all your views to one layer 8 7 5 1 Adding Layers to a
485. pecified for the utility to check if the 311 mysqlrpladmin Administration utility for MySQL replication specified slaves are associated to the given master before executing the command making sure that the command is only applied to slaves connected to the right replication master The options required for the elect health and gtid commands include the master 313 option to specify the existing master and either the slaves 313 option to list all of the slaves in the topology or the discover slaves login 312 option to provide the user name and password to discover any slaves in the topology that are registered and connected to the master The options required for switchover include the master 313 option to specify the existing master the new master 313 option to specify the candidate slave the slave to become the new master and either the slaves 813 option to list the considered slaves in the topology or the discover slaves login 312 option to provide the user name and password to discover any slaves in the topology that are registered and connected to the master The failover command requires only the s laves 313 option to explicitly list all of the slaves in the topology because it is expected that the master is down when this command is used Use the verbose 314 option to see additional information in the health report and additional messages during switchover or failover
486. pecify the display format for column list output Permitted format values are grid csv tab and vertical The default is grid This option applies only if show list 323 is given e master lt source gt Connection information for the master server in the format lt user gt lt passwa gt lt host gt lt port lt socket gt or lt login path gt lt port lt socket gt e max depth lt N gt The maximum recursion depth This option is valid only if recurse 323 is given num retries lt num_retries gt n lt num_retries gt 322 mysqlrplshow Show Slaves for Master Server NOTES The number of retries permitted for failed slave login attempts This option is valid only if prompt 823 is given prompt p Prompt for the slave user and password if different from the master user and password If you give this option the utility sets num ret ries 322 to 1 if that option is not set explicitly This ensures at least one attempt to retry and prompt for the user name and password should a connection fail e quiet q Turn off all messages for quiet execution This option does not suppress errors or warnings e recurse r Traverse the list of slaves to find additional master slave connections User this option to map a replication topology e show list l Display a column list of the topology e verbose v Specify how much information to display If this option is used the
487. pending on your network connection Connect to hast machine Check location of start stop commands Check MySQL configuration file gement Test Settings Testing host machine settings is done Check that everything is in order then click Next 10 You now have a chance to review the configuration settings so far The information displayed varies slightly depending on platform connection method and installation type 35 Administering a MySQL Server Figure 5 9 Getting Started Tutorial Review Settings Create New Server Instance Profile Specif t Machine n A Review Server Instance Settings Database Connection Test DB Connection Below is a list of all settings collected so far This includes also values taken from templates or default values Check if they match your actual settings and toggle Change Parameters if you need to make any changes to default values For any other change go back to the appropriate wizard page i Pay special attention if you run more than one instance of MySQL on the same machine janagement Native Windows Adminstration enabled Windows host localhost Settings MySQL service name MySQL55 Review Settings MySQL Configuration MySQL Version 5 5 16 Settings Template Path to Configuration File C Documents and Settings All Users Application Data MySQL MySQL Server 5 5 my ini Instance Name in Configuration File mysqld C Change Parameters Review the information
488. perties accessible from the Properties palette apply to the appearance of a view on the EER Diagram canvas For a list of properties accessible through the Properties palette see Section 8 5 12 The Properties Palette 8 7 4 Creating Routines and Routine Groups You can add Routine Groups to a database either from the Physical Schemata section of the MySQL Model page or from an EER Diagram Routines may be added only from the Physical Schemata section of the MySQL Model page To view an existing schema along with its Routines and Routine Groups choose Database Reverse Engineer from the main menu After the schema has been added to the current model you can see the schema objects on the Physical Schemata panel on the MySQL Model page The Routines and Routine Groups are listed there MySQL Workbench unifies both stored procedures and stored functions into one logical object called a Routine Routine Groups are used to group routines that are related You can decide how many Routine Groups you want to create and you can use the Routine Group Editor to assign specific routines to a group using a drag and drop interface When designing an EER Diagram you can place the Routine Groups on the canvas by dragging them from the Catalog Palette Placing individual routines on the diagram is not permitted as it would clutter the canvas 8 7 4 1 Routines 8 7 4 1 1 Adding Routines to the Physical Schemata To add a routine double clic
489. perties accessible through the Properties palette see Section 8 5 12 The Properties Palette There is no property in the Properties palette for changing the font used by a text object To do so choose the Appearance tab of the Workbench Preferences dialog For more information see Section 6 4 8 The Appearance Tab 8 7 8 Creating Images Images exist only on the EER Diagram canvas you can add them only from the EER Diagram window 8 7 8 1 Adding Images to an EER Diagram To add images to an EER Diagram use the Image tool on the vertical toolbar Make sure that the EER Diagram tab is selected then right click the image icon on the vertical toolbar The image icon is the icon just above the table icon Clicking the mouse on this icon changes the mouse pointer to an image pointer You can also change the mouse pointer to an image pointer by pressing the I key Create an image by clicking anywhere on the EER Diagram canvas This opens a file open dialog box Select the desired image then close the dialog box to create an image on the canvas To revert to the default mouse pointer click the arrow icon at the top of the vertical toolbar Right clicking this object opens a pop up menu with the following items e Cut Image e Copy Image e Edit Image e Edit in New Window e Delete Image These menu items function in exactly the same way as they do for other objects on an EER diagram However images are not dat
490. plication after all of the users are copied makes this example a clone and replicate scale out solution e Stop new client connections to the server during the copy Conclusion If you find some primitives missing or would like to see more specific functionality in the library or scripts please contact us with your ideas or better still write them yourselves We welcome all suggestions in code or text To file a feature request or bug report visit http ougs mysql com For discussions visit http forums mysql com list php 155 14 3 Commands 14 3 1 mysql utilities command grep Search Databases for Objects This module provides utilities to search for objects on a server The module defines a set of object types that can be searched by searching the fields of each object The notion of an object field is very loosely defined and means any names occurring as part of the object definition For example the fields of a table include the table name the column names and the partition names if it is a partitioned table Constants The following constants denote the object types that can be searched mysql utilities command grep ROUTINE mysql utilities command grep EVENT e mysql utilities command grep TRIGGER e mysql utilities command grep TABLE e mysql utilities command grep DATABASE e mysql utilities command grep VIEW 245 mysql utilities command proc Search Processes on Servers
491. port Object Definitions or Data into a Database This utility imports metadata object definitions or data or both for one or more databases from one or more files If an object exists on the destination server with the same name as an imported object it is dropped first before importing the new object To skip objects by type use the skip 281 option with a list of the objects to skip This enables you to extract a particular set of objects say for importing only events by excluding all other types Similarly to skip creation of UPDATE statements for BLOB data specify the skip blobs 281 option To specify the input format use one of the following values with the format 281 option These correspond to the output formats of the mysqldbexport utility e sql default Input consists of SQL statements For definitions this consists of the appropriate CREATE and GRANT statements For data this is an INSERT statement or bulk insert if the bulk insert 280 option is specified grid Display output in grid or table format like that of the mysql monitor e cSV Input is formatted in comma separated values format e raw_csv Input is a simple CSV file containing uniform rows with values separated with commas The file can contain a header the first row that lists the table columns The option t able 281 is required to use this format 279 mysqldbimport Import Object Definitions or Data into a Data
492. previously provided by the Query Browser standalone application e Data Modeling Enables you to create models of your database schema graphically reverse and forward engineer between a schema and a live database and edit all aspects of your database using the comprehensive Table Editor The Table Editor provides easy to use facilities for editing Tables Columns Indexes Triggers Partitioning Options Inserts and Privileges Routines and Views e Server Administration Enables you to create and administer server instances MySQL Workbench is available in two editions the Community Edition and the Standard Edition The Community Edition is available free of charge The Standard Edition provides additional Enterprise features such as database documentation generation at low cost For release notes detailing changes made in each release of MySQL Workbench see Appendix C MySQL Workbench and Utilities Change History Chapter 2 What is new in MySQL Workbench 6 0 This section summarizes how MySQL Workbench 6 0 is different than MySQL Workbench 5 2 Note E This manual documents MySQL Workbench through version 5 2 47 but will be updated to reflect MySQL Workbench 6 0 in the future A new home screen A new modernized Home screen where major functionality of MySQL Workbench can be accessed including connections to MySQL servers modeling migration and the command line utilities Figure 2 1 Home Screen Workbench 5 2 MySQL
493. protocol Select this option for WAN connections Use ANSI quotes to quote identifiers If enabled this option overwrites the serverside settings Use SSL if available This option turns on SSL encryption if the dient library supports it SSL CA File Path to Certificate Authority file for SSL SSL CERT File Path to Certificate file for SSL SSL Key File Path to Key file for SSL SSL Cipher Optional list of permissible ciphers to use for SSL encryption New Delete l Duplicate Move Up Move Down Test Connection SSS The Advanced tab includes these check boxes e Use compression protocol If checked the communication between the application and the MySQL server will be compressed which may increase transfer rates This corresponds to starting a MySQL command line client with the compress option 68 Local Socket Pipe Connection e Use SSL if available This option turns on SSL encryption The client library must support this option Note This feature is currently not supported e Use ANSI quotes to quote identifiers Treat as an identifier quote character like the quote character and not as a string quote character You can still use to quote identifiers with this mode enabled With this option enabled you cannot use double quotation marks to quote literal strings because it is interpreted as an identifier Note If this option is selected it overrides the server setting 7 6 3 Local
494. qli PHP extension This extension must be enabled in your PHP distribution for this code to work For additional details see MySQL Improved Extension Mysqli 178 Chapter 10 Server Administration Table of Contents 10 1 Sewer Administration nnrir a tee ie ae nie ieee 179 10 2 New Server Instance 2 0 0 cece cece ee cece cea e teen teers eee ceca eee eter ee ee ee aaeaaa ce eeeeeeseaaaaaaneeeeseeeeaaaaaaeees 180 10 3 Manage Data Import Export 2 00 0 cece cert e eee ee eae eres senate a i e a 180 10 4 0 MANAGE SOCUIILY reiii nnar ori a a deeeta tae iaa a line angie doen dew dnai i EE 180 10 5 Manage Server Instances esssssseseeeenrersnsssstsrrtrttersstsnttnretrsessnttnrttrossnttnrerrerssnernrnnnent 180 10 6 Creating and Managing Server Instances sesesesisssseessrsrrrirrssssrtrrrrtrssssrsrnrrrrsssrsrnrrrrent 180 10 6 1 New Server Instance Wizard sesssesseseeesrsirssssrtirrrsresssrttnrrtrstsusrnrrtnntssrsrnrrrnnnt 180 10 6 2 Manage Server Instances Dialog ccccccceeeeeeeeeeeee ee aeaaeeeeeeeeeeeeaeaaeeteeeeeeeeeaeaaeaees 182 10 7 Server Administration and Configuration ccccccecseeeeeeeeeeeeaeaeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeaeaaeeees 185 1071 THESStanup Tabi oe sii eave aa naana leeeed teed PE Raa O Vata ane en ee 186 10 7 2 The Configuration Tab ccccecececeeeee cece ee ee ee eeeeeeeeeeee ae aaeeeeeeeeeeeseaaaaaeneeeeeeeeeaaaaeeees 187 10 7 32 The Accounts Tab r E e
495. query into the SQL editor This example will use the sakila database with the query being SET last_update 2006 02 14 SELECT actor_id first_name last_name last_update FROM actor WHERE last_update gt last_update 2 While in the SQL editor choose Plugins Utilities Copy as PHP Code lterate SELECT Results from the main menu This will copy PHP code to the clipboard 3 Paste the code to the desired location Additionally PHP code that connects to the MySQL database can also be generated by choosing Plugins Utilities Copy as PHP Code Connect to Server The generated code will look like this 177 Generating PHP code lt php Shost tiocal host U Spork 3306 Ssocket Wig Suser Whyelevyely Spassword Sdbname Vega lat Scon new mysqli host user password dbname port socket or die Could not connect to the database server mysqli_connect_error Scon gt close Squery SELECT actor_id first_name last_name last_update FROM actor WHERE last_update gt Slast_update Sstmt gt bind_param s S last_update if Sstmt Scon gt prepare S query Sstmt gt execute Sstmt gt bind_result S actor_id first_name last_name last_update while Sstmt gt fetch i Oe ite hie ee Gor Gep Sey Hi Sactor_id first_name last_name last_update Sstmt gt close E gt Note that the PHP code uses the mys
496. r and add objects or patterns to the ignore list to exclude them from the export Export MySQL Table Objects 26 Total Objects 26 Selected Export MySQL View Objects 0 Total Objects 0 Selected i a Export MySQL Routine Objects 0 Total Objects 0 Selected d Export MySQL Trigger Objects 0 Total Objects 0 Selected Export User Objects 0 Total Objects 0 Selected fot ic To select a subset of objects to forward engineer use the Show Filter Hide Filter button then select specific objects After you have selected your objects click Next to continue On the Review Script page you may review and edit the SQL script that will be executed 145 Forward Engineering Figure 8 36 Review Script Options pen Review the SQL Script to be Executed Select Objects Review SQL Script SET OLD_UNIQUE_CHECKS UNIQUE_CHECKS UNIQUE_CHECKS 0 SET OLD_FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS FOREIGN_KEY_CHECKS 0 SET OLD_SQL_MODE SQL_MODE SQL_MODE TRADITIONAL CREATE SCHEMA IF NOT EXISTS mydb DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci CREATE SCHEMA IF NOT EXISTS mysql DEFAULT CHARACTER SET latin1 CREATE SCHEMA IF NOT EXISTS test DEFAULT CHARACTER SET latin1 CREATE SCHEMA IF NOT EXISTS world DEFAULT CHARACTER SET latin1 Table mysql columns _priv CREATE TABLE IF NOT EXISTS mysql columns_priv gt Host CHAR 60 CHARACTER SET utf8 COLLATE utf8_bin N
497. r Save Model As menu items to save a model When you save a model its name appears in the title bar of the application If you have made changes to a project and have not saved those changes an asterisk appears in the title bar following the model name When you save a model itis saved as a MySQL Workbench file with the extension mwb Use the Import menu item to import a MySQL data definition DDL script file For example this might be a file created by issuing the command mysqldump no data MySQL Workbench handles the script as follows e Ifthe script does not contain a CREATE DATABASE db_name statement the schema objects are copied to the default schema mydb If the script creates a database a new tab bearing the database name is added to the Physical Schemata section of the MySQL Model page e Ifthe script contains data the data is ignored For details about importing a DDL script see Section 8 7 9 1 Reverse Engineering Using a Create Script Under the Import submenu you can also import DBDesigner4 files There are variety of items under the Export submenu You may generate the SQL statements necessary to create a new database or alter an existing one For more information about these menu items see Section 8 7 10 1 Forward Engineering Using an SQL Script Using the Export submenu you can also export an EER diagram as a PNG SVG PDF or Postscript file For an example of a PNG file see Figure 8
498. r copying databases on the same server An error will be generated When copying data and including the GTID commands you may encounter an error similar to GTID_PURGED can only be set when GTID_EXECUTED is empty This occurs because the destination server is not in a clean replication state To aleviate this problem you can issue a RESET MASTER command on the destination prior to executing the copy Cloning databases that contain foreign key constraints does not change the constraint in the cloned table For example if table db1 t1 has a foreign key constraint on table db1 t2 when db1 is cloned to db2 table db2 t1 will have a foreign key constraint on db1 t2 The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the 270 mysqldbcopy Copy Database Objects Between Servers my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf If any database identifier specified as an argument contains special characters or is a reserved word then it must be appropriately quoted with backticks In turn names quoted with backticks must also be quoted with single or double quotes depending on the operating system i e in Windows or in non Windows systems in order for the utilities to read backtick quoted identifiers as a single argument F
499. r locale The PROGRAMF ILES directory may be c Program Filesorc programme Installing from the Zip File If you have problems running the Installer package an alternative is to install from a Zip file without an installer That file is called mysql workbench version win32 zip To install using the Zip file download the Zip file to a convenient location and decompress the file using a Zip utility You can place the resulting directory anywhere on you system You need not install or configure the application before using it You may want to create a shortcut on your desktop or the quick launch bar 4 3 2 Launching MySQL Workbench on Windows To start MySQL Workbench on Windows select Start Programs MySQL then select MySQL Workbench Alternatively start MySQL Workbench from the command line To view the available command line options issue the command MySQLWorkbench help more from the MySQL Workbench installation directory You will see the following output MySQL Workbench 5 2 34 SE C 2006 2011 by Oracle Corporation All rights reserved Usage MySQLWorkbench options model file 21 Uninstalling MySQL Workbench on Windows Options admin instance Open an admin tab to the named server instance at startup open filename Open the given filename at startup CUMSEY SSEVEI scence Open a DB query tab to the named server connection at startup SUN GIGIENIOE secacece Executes the given Workbench script a
500. r the new instance parser add_option new port action store dest new_port type sString default 3307 help the new port for the new instance default default Server id for the new instance 340 MySQL Utilities copy_server py sample parser add_option new id action store dest new_id type sString default 2 help the server_id for the new instance default default List of databases parser add_option d databases action store dest dbs_to_copy type string help comma separated list of databases to include in the copy omit for all databases default None List of users parser add_option u users action store dest users_to_copy type string help comma separated list of users to include in the copy omit for all users default None Now we process the rest of the arguments opt args parser parse_args Parse source connection values EEV conn parse_connection opt server except parser error Server connection values invalid or cannot be parsed Get a server class instance print Connecting to server server_options eroin since 8 Crema role B Wsrouugee serverl Server server_options EEV serverl connect except UtilError e print ERROR e errmsg Get list of databases from the server if not specified in options print Getting databases Glo_dlausic I if opt dbs_to_copy is
501. ral Public License Version 2 1 February 1999 General Public License applies to certain designated libraries and is quite different from the ordinary General Public License We use this license for certain libraries in order to permit linking those libraries into non free programs When a program is linked with a library whether statically or using a shared library the combination of the two is legally speaking a combined work a derivative of the original library The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom The Lesser General Public License permits more lax criteria for linking other code with the library We call this license the Lesser General Public License because it does Less to protect the user s freedom than the ordinary General Public License It also provides other free software developers Less of an advantage over competing non free programs These disadvantages are the reason we use the ordinary General Public License for many libraries However the Lesser license provides advantages in certain special circumstances For example on rare occasions there may be a special need to encourage the widest possible use of a certain library so that it becomes a de facto standard To achieve this non free programs must be allowed to use the library A more frequent case is that a free library does the same job as widely used non free libraries In
502. ram canvas Moving the mouse while holding down the mouse button changes the view port of the canvas To determine your position on the canvas look at the Model Navigator panel on the upper right If the Model Navigator panelis not open use View Windows Model Navigator to open it 101 The Vertical Toolbar To activate the hand tool from the keyboard use the H key You can also change the view port of an EER diagram using the Model Navigator panel See Section 8 5 9 The Model Navigator Panel 8 6 1 3 The Eraser Tool Use the eraser tool to delete objects from the EER Diagram canvas Change the mouse pointer to the eraser tool then click the object you wish to delete Depending upon your settings the delete dialog box should open asking you to confirm the type of deletion Note E The delete action of the eraser tool is controlled by the general option setting for deletion Before using the eraser tool be sure that you understand the available options described in Section 6 4 5 The Model Tab To activate the eraser tool from the keyboard use the D key You can also delete an object by selecting it and pressing Control Delete or by right clicking it and choosing Delete from the pop up menu 8 6 1 4 The Layer Tool The layer tool is the rectangular icon with a capital L in the lower left corner Use the layer tool to organize the objects on an EER Diagram canvas It is useful for grouping similar objects For ex
503. ree86 Project Inc Corones ielu ANOA 2O T N TOO A RE erea NE Copyright 2004 Nicholas Miell Copyright 2005 Lars Knoll amp Zack Rusin Trolltech Copyright 2005 Trolltech AS Copyright 2007 Luca Barbato Copyright 2008 Aaron Plattner NVIDIA Corporation Copyright 2008 Rodrigo Kumpera Copyright 2008 Andr Tupinamba Copyright 2008 Mozilla Corporation Copyright 2008 Frederic Plourde Copyright 2009 Oracle and or its affiliates All rights reserved Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions merge The above copyright notice and this permission notice including the next paragraph shall be included in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT HALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR NY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN CTION OF CONTRACT TORT OR OTHERWISE ARISING FROM UT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
504. release MySQL Doc File Edit View Database Plugins Scripting Community Help Library Data Modeling YA Create and manage models forward amp reverse engineer compare and synchronize schemas report Open Existing EER Model m Create New EER Model Create EER Model From Existing Database ID fy Create EER Model From SQL Script at You are now ready to test your new server instance BOW Gb MySQL Bug Workbench PlanetMySQL Workbench Reporter Team Blog Forums Configure your database server setup user accounts browse status variables and server logs OQ Server Administration ie Server Administration mysqid localhost Local Type Windows R New Server Instance Manage Import Export Manage Security ig Manage Server Instances 13 From the Home window double click the Server Instance you created The Administrator will open on the Startup configuration page 38 Creating a Model Figure 5 12 Getting Started Tutorial Admin Startup e00 MySQL Workbench Admin mysqid localhost MANAGEMENT Server Status INFO SYSTEM SERVER HEALTH H See Sea Name _mysqld localhost E Status and System Variables d Host localhost ia A Server Logs Server 5 5 15 log Status Running Load Mem 68 Connection Usage Traffic 7 90 KB s Query Cache Hitrate 0 0 Key Efficiency 0 00 CONFIGURATION COACTIS Options File id User Host DB Command Time State Info SECURITY 2 root
505. ript for a tutorial on reverse engineering the sakila database 8 7 9 2 Reverse Engineering a Live Database To reverse engineer a live database choose the Database Reverse Engineer menu item from the main menu This opens the Reverse Engineer Database wizard 128 Reverse Engineering Figure 8 19 Reverse Engineer Database Wizard Connection Opti a ee Set parameters for connecting to a DBMS Stored Connection y Select from saved connection settings Connection Method Standard TCP IP v Method to use to connect to the RDBMS Name or IP address of the server host TCP Name of the user to connect with The user s password The schema that will be used as default sche The first page of the wizard enables you to set up a connection to the live database you wish to reverse engineer You can set up a new connection or select a previously created stored connection Typical information required for the connection includes host name user name and password After this information has been entered or you have selected a stored connection click the Next button to proceed to the next page 129 Reverse Engineering Figure 8 20 Connect to DBMS Connection Options Connect to DBMS and Fetch Information Connect to DBMS The following tasks will now be executed Please monitor the execution Press Show Logs to see the execution logs Connect to DEMS amp Retrieve Schema List from Datab
506. rk but we are lazy at heart and want something that not only copies everything but also finds it for us That is we want a one command solution The good news is that this is indeed possible and very easy to do Let us start by breaking the problem down into its smaller components In a nutshell we must perform these tasks Connect to the original server Find all of the databases Find all of the users e Make a clone of the original server Copy all of the databases e Copy all of the users If you look at the utilities and the modules just listed you see that we have solutions and primitives for each of these operations So you need not even call the MySQL utilities directly although you could Now let us dive into the code for this example The first task is to connect to the original server We use the same connection mechanism as the other MySQL utilities by specifying a server option like this parser add_option server action store dest server type sString default root localhost 3306 help connection information for original server in the form lt user gt lt password gt lt host gt lt port gt lt socket gt Once we process the options and arguments connecting to the server is easy Use the parse_connection method to take the server option values and get a dictionary with the connection values All of the heavy diagnosis and error handling is done for us so we just need to check for excepti
507. rmation about inserting rows see Section 8 7 1 3 8 The Inserts Tab Clicking Next takes you to the SQL Object Export Filter page where you select the objects you wish to export Figure 8 29 SQL Object Export Filter Forward Engineer SQL Script SQL Export Options k 7 amy mae SQL Object Export Filter Filter Objects To exclude objects of a specific type from the SOL Export disable the corresponding checkbox Press Show Filter and add objects or patterns to the ignore list to exclude them from the export Export MySQL Table Objects Show Filter 2 Total Objects 2 Selected C Export MySQL View Objects Show Filter 0 Total Objects 0 Selected C Export MySQL Routine Objects Show Filter 0 Total Objects 0 Selected Export MySQL Trigger Objects Show Filter 0 Total Objects 0 Selected C Export User Objects Show Filter 0 Total Objects 0 Selected 139 Forward Engineering Precise control over the objects to export can be fine tuned by clicking the Show Filter button After the objects to export have been selected it is possible to reduce the expanded panel by clicking the same button now labeled Hide Filter After selecting the objects to export click the Next button to review the script that has been generated Figure 8 30 Review Generated Script Forward Engineer SQL Script Review Generated Script Review SQL Script Review the generated script SET OLD_UNIQUE_CHECKS UNIQUE_CHECKS UNIQU
508. rning if you export databases on a GTID enabled server but use the skip gtid 276 option To make the most use of GTIDs and export import you should export all of the databases on the server with the a11 276 option This will generate an export file with all of the databases and the GTIDs executed to that point Importing this file on another server will ensure that server has all of the data as well as all of the GTIDs recorded correctly in its logs OPTIONS mysqldbexport accepts the following command line options e help Display a help message and exit e bulk insert b Use bulk insert statements for data comment rpl Place the replication statements in comment statements Valid only with the rp1 275 option e display lt display gt d lt display gt Control the number of columns shown Permitted display values are brief minimal columns for object creation full all columns and names only object names not valid for format sql 275 The default is brief e exclude lt exclude gt x lt exclude gt Exclude one or more objects from the operation using either a specific name such as dbi tlora search pattern Use this option multiple times to specify multiple exclusions By default patterns use LIKE matching With the regexp 275 option patterns use REGEXP matching This option does not apply to grants export lt export gt e lt export gt 274 mysqldbexport Export Object D
509. ror 08001 08001 Already connected 202 SQLDriverConnect This means that PostgreSQL is not configured to accept connections from the source IP 224 Chapter 12 Extending Workbench Table of Contents 12 1 GRT and Workbench Data Organization 0 cccceceeeceeeeeeeee eres ee ae ae eeeeeeeeeeeeaeaaeaneeeeeeeeeaeaaea 225 W232 NO OUIGS e a a A tare sdabeaaaeaseassneaoierces 226 123 PIUQUAS rtean AEEA ES EEEE Gane E SEE RAE EEE AA 227 12 4 Adding a GUI to a Plugin Using MFOrmS ccceceeeeeeeee ee eeeeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaeaneeeeeees 228 12 5 The Workbench Scripting Shell cccccceceeseeeeeeee ee ceae eae ee eeeeeesaaeaaaaeaeeeeeeseaaaaaaaaeeeeeeaeaea 229 12 5 1 Exploring the Workbench Scripting Shell cccscseeeeeeeeeeeeeeaeeeeeeeeeeeeeaeaaaaneeeeeees 229 12 5 2 The Shell Window wsxistcsssacocestute naninira Leeetes agra E A AEA E AE Lae EAE AAE E aE aA a 230 12 5 3 The Files Globals Classes and Modules Tabs cccccccccecseeeceeeeeeeeeeeeeeseeeeeees 230 12 6 Tutorial Writing PIUgINS seecssesssiiesano R A ERREA ER 231 MySQL Workbench provides an extension and scripting system that enables the developer to extend MySQL Workbench capabilities While the core of MySQL Workbench is developed using C it is possible to harness this core functionality using both the Lua and Python scripting languages MySQL Workbench also provides access to a cross platform GUI
510. rting data from data csv done To import both data and definitions from the ut il_test database importing the data using bulk insert statements from a file that contains SQL statements use this command mysqldbimport server root localhost import both bulk insert format sql data sql 282 mysqldiff Identify Differences Among Database Objects Source on localhost connected Importing definitions and data from data sql done 14 4 8 mysqldiff Identify Differences Among Database Objects This utility reads the definitions of objects and compares them using a diff like method to determine whether they are the same The utility displays the differences for objects that are not the same Use the notation db1 db2 to name two databases to compare or alternatively just do1 to compare two databases with the same name The latter case is a convenience notation for comparing same named databases on different servers The comparison may be run against two databases of different names on a single server by specifying only the server1 284 option The user can also connect to another server by specifying the server2 284 option In this case db1 is taken from server1 and db2 from server2 When a database pair is specified all objects in one database are compared to the corresponding objects in the other Any objects not appearing in either database produce an error To compare a specific pair of objec
511. ry Log Instances are iterable but the class does not provide multiple independent iterators For example to read the log and print the entries gt gt gt slow_log open var lib mysql mysql slow log gt gt gt log SlowQueryLog slow_log ser Or entry in llog print entry Parameters stream file type a valid file type for example the result of the built in Python function open version Returns Version of the MySQL server that produced the log Return type tuple program Returns Full path of the MySQL server executable Return type str port Returns TCP IP port on which the MySQL server was listening 335 Related tools Return type int socket Returns Full path of the MySQL server Unix socket Return type str start_datetime Returns Date and time of the first read log entry Return type datetime datetime lastseen_datetime Returns Date and time of the last read log entry Return type datetime datetime 14 6 Related tools 14 6 1 mut MySQL Utilities Testing This utility executes predefined tests to test the MySQL Utilities The tests are located under the mysql test directory and divided into suites stored as folders By default all tests located in the t folder are considered the main suite You can select any number of tests to run
512. s db_list append db 0 None else woe Clo alm ej close _cojeny sjollanc Y 3 db_list append db None Notice we are creating a list of tuples This is because the dbcopy module uses a list of tuples in the form old_db new_db to enable you to copy a database to a new name For our purposes we do not want a rename so we leave the new name value set to None Next we want a list of all of the users Once again you could construct the new solution to be flexible by permitting the user to specify the users to copy We leave this as an exercise In this case we do not have a primitive for getting all users created on a server But we do have the ability to run a query and process the results Fortunately there is a simple SQL statement that can retrieve all of the users on a server For our purposes we get all of the users except the root and anonymous users then add each to a list for processing later users serverl exec_query SELECT user host PROM mysql user WHERE user root and user for user in users user_list append user 0 user 1 Now we must clone the original server and create a viable running instance When you examine the mysqlserverclone utility code you see that it calls another module located in the mysql utilities command sub folder These modules are where all of the work done by the utilities take place This enables you to create new combinations of the utilities by calling th
513. s for shema HumanResources Table HumanResources Department migrated Data Transfer Setup Table HumanResources EmployeePayHistory migrated Bulk Data Transfer Table HumanResources JobCandidate migrated Finalizing foreign key migration Migration finished REPET Migrate Selected Objects finished Migration Report Generate SQL CREATE Statements Generating SQL Generate SQL CREATE Statements finished Finished performing tasks Migration Wizard was started Manual Editing There are three sections to edit here which are selected via the View select box on the top right The Show Code and Messages button is available with every view and it will show the generated MySQL code that corresponds to the selected object e Migration Problems This will either report problems or display No mapping problems found It is an informational screen e All Objects An object view that allows you to view and edit the object definitions Double click on a row to modify a target objects name e Column Mappings Shows all of the table column mappings and allows you to individually review and fix the mapping for all column types default values and other attributes 207 A visual guide to performing a database migration Figure 11 10 MySQL Workbench migration Manual Editing All Objects Migration Task List OVERVIEW Q overview SOURCE amp TARGET Y Source Selection Target Selection Y Fetch Schemata List Y Schemata
514. s may contain errors Further a syntax error early on can lead to subsequent syntax errors For these reasons it is possible to limit the number of errors displayed using this option The default is 100 error messages SQL SQL properties that can be set include the SQL_MODE case sensitivity of identifiers and the SQL delimiter used The document property SqlMode defines SQL_MODE for all operations affecting SQL parsing at the document scope The purpose of this option is to preserve the consistency of SQL statements within the document The property has the following functions e Sets the SOL_MODE DBMS session variable to the value stored in the SqlMode property of the document when performing reverse engineering forward engineering or synchronization operations e Honors the SOL_MODE values defined in SqiMode so that SQL parsing is correct Only a subset of all possible SoL_MODE values affect the MySQL Workbench SQL parser These values are ANST_QUOTES HIGH_NOT_PRECEDENCE IGNORE_SPACE NO_BACKSLASH_ESCAPES PIPES_AS_CONCAT Other values do not affect the MySQL Workbench SQL parser and are ignored If the value of SqlMode is not set the default value of the SOL_MODE session variable defined by the server stays unchanged during operations with the server However the MySQL Workbench SQL parser behaves as if SOL_MODE is also not set This may potentially lead to inconsistencies in parsing of SQL state
515. s query cache YES if RTREE indexes are available NO if not These are used for spatial indexes in MyISAM tables Whether mysqld supports SSL connections Is symbolic link support enabled Enable or disable statement profiling How many statements to maintain profiling information for The default storage engine The size of the cache to hold the SQL statements for the binary log during a transaction The size of the host cache Allocation block size for query parsing and execution Each thread that needs to do a sort allocates a buffer of this size Configuration File C PROGRA 1 MySQL ENTERP 1 Monitor nysql my ini mysql Id 188 The Accounts Tab Security Tab Figure 10 6 Administrator Configuration Security Tab Admin mysqld localhost X Task and Object Browser Options File MANAGEMENT Trane End Serer Status z E Startup Shutdown Networking Transactions Log Files General Replication InnoDB MyISAM Performance Security Advanced Security V automatic_sp_privileges Creating and dropping stored procedures alters ACLs E3 Status and System Variables A Server Logs F local_infile Whether LOCAL is supported for LOAD DATA INFILE statements CONFIGURATION o passer Type ofpssord encrypton mad SECURITY read_only Make all nontemporary tables read only Users and Privileges Validate password DATA EXPORT RESTORE s See validate_p
516. s would be deleted Right click a table and select Copy to Clipboard Delete with References Table templates Figure 2 8 Cascading SELECT 000 MYSQL Workbench amp My Local example com DB sakila Hh gaddd Qa amp Management Schemas sar File 3 x SCHEMAS e aB FAOS COM saM Q Filter objects 10 SET customer_ id_ to_select a a 2 SELECT payment vO 3 FROM payment customer v Tables 4 WHERE customer customer_id gt payment customer_id gt I actor 5 AND customer customer_id customer_id_to_select gt T address 6 SELECT rental 7 FROM rental customer gt El category 8 WHERE customer customer_id rental customer_id gt i city 9 AND customer customer_id customer_id_to select gt I country 10 SELECT customer gt custome i 11 FROM customer gt i film Select Rows Limit 1000 WHERE customer customer_id customer_id_to_select gt i a at Copy to Clipboard gt n Send to SQL Editor Name short gt Pg tex Name long gt i invento Create Table Select All Statement gt languag Create Table Like gt Insert Statement gt paymen Alter Table i Update Statement gt T rental Table Maintenance Delete Statement gt ll staff Drop Table Create Statement Object Info Truncate Table Join Selected Tables Table customer Search Table Data Delete with References Columns Select Row References id s Refresh All customer i store_id FTES OR aa
517. sakila database as an example This is a sample database provided by MySQL that you can find by visiting the http dev mysql com doc page selecting the Other Docs tab and looking in the Example Databases section An EER diagram is an invaluable aid to a quick understanding of any database There is no need to read through table definition statements glancing at an EER diagram can immediately indicate that various tables are related You can also see how tables are related what the foreign keys are and what the nature of the relationship is 8 8 4 1 A PNG File of the sakila Database Find following an EER diagram showing all the tables in the sakila database This image was created using the File Export Export as PNG menu item 160 Documenting the sakila Database Figure 8 50 The sakila Database EER Diagram tk_film_category_category gt actor Jd SMALLINT S F film_id SMALLINT S F film_id SMALLINT S category id TINYINT 3 category _id TINYINT 3 a fk_film_actor_actor fk_film_category_film bea fk_film_actor_film fk_film_language_original 1K flm_language language v ee H 7 language id TINYINT 3 F actor Jd SMALLINT S film _id SMALLINT S fk_inventory_film language id TINYINT 3 filmid SMALLINT S FI 1 store_id TINYINT 3 l inventory id MEDIUMINT 8 rental_id INT 11 Le a a inventory_id MEDIUMINT 8 In eng customer
518. schema editor by clicking the x button 8 8 2 1 Creating a New Table Create a new table by double clicking the Add Table icon in the Physical Schemata panel This opens the table editor docked at the bottom of the application If you wish you can undock or dock this editor in exactly the same way as the schema editor window Use the first tab of the table editor to change the name collation and engine You may also add a comment Add columns to the new table by selecting the Columns tab Use the default column name or enter a new name of your choosing Use the Tab key to move to the next column and set the column s data type Altering the table by adding indexes or other features is also easily done using the table editor 8 8 2 2 Creating Other Schema Objects Additional objects such as views or routines can be added in the same way as tables 158 Basic Modeling Any objects you have created can be found in the Catalog palette on the right To view these schema objects select the Catalog tab in the middle palette on the right View all the objects by clicking the button to the left of the schema name Save your changes to a MySQL Workbench Models file mwb extension by choosing Save from the File menu or by using the keyboard command Control S 8 8 3 Basic Modeling On the MySQL Model page double click the Add Diagram icon This creates and opens anew EER Diagram Canvas Figure 8 49 Adding an EER Diagram
519. script with the open model external script or a second database and apply these changes back to the target Synchronize Model Synchronizes your database model with an existing database For more information see Section 8 7 10 3 Database Synchronization Generate Catalog Diff Report Compares your schema model with a live database or a script file Section 8 7 10 4 Creating a Catalog Diff Report 8 5 1 7 The Plugins Menu The Plugins menu lists any plugins that you may have installed For more information about this menu see Section 12 3 Plugins 93 Modeling Menus 8 5 1 8 The Scripting Menu The Scripting menu has these items e Scripting Shell Launches the MySQL Workbench Scripting Shell New Script Opens a New Script File dialogue with options to create a Python Script Lua Script Python Plugin or Python Module Open Script Opens a Open GRT Script dialogue which defaults to the Workbench scripts directory Files are opened into the Workbench Scripting Shell window e Run Workbench Script File Executes the specified script Install Plugin Module File Loads and installs a plugin or module file e Plugin Manager Displays information about the plugins that are are installed and allows disabling and uninstalling the plugins 8 5 1 9 The Community Menu 8 5 1 10 The Community menu has the following items Use them to go online and learn more about MySQL Workbench e Workbench Bl
520. se Engineer Source E Create a batch file to copy the data at another time C Users philip Desktop copy_migrated_tables cmd OBJECT MIGRATION Y Source Objects _ Migration l Truncate target tables ie delete contents before copying data Options Manual Editing Number of tasks to use for data transfer Each task will open a Worker tasks 2 connection to both source and target RDBMSs to copy table rows Target Creation Options Default value 2 7 Create Schemata Y Create Target Results E Enable debug output for table copy DATA MIGRATION Bulk Data Transfer REPORT Migration Report Migration Wizard was started Bulk Data Transfer And now the data is transferred to the target RDBMS Optionally view the logs to confirm Figure 11 16 MySQL Workbench migration Bulk Data Transfer e fos SQL Editor Local instance MyS File Edit View Database Plugins Scripting Help Migration Task List Bulk Data Transfer OVERVIEW overview The following tasks will now be performed Please monitor the execution SOURCE amp TARGET Source Selection amp Prepare information for data copy Target Selection Create shell script for data copy Fetch Schemata List Determine number of rows to copy Y Schemata Selection Copy data to target RDBMS Reverse Engineer Source OBJECT MIGRATION Y Source Objects Y Migration m 7 Manual Editing Target Creation Options Create Schemata Create Target Results Cop
521. se name lookup the comparison could fail Without the ability to do a reverse name lookup the replication utilities could report a false negative that the slave is not connected to the master For example if you setup replication using MASTER_HOST ubuntu net on the slave and later connect to the slave with mysqlrplcheck and have the master specified as master 192 168 0 6 using the valid IP address for ubuntu net you must have the ability to do a reverse name lookup to compare the IP 192 168 0 6 and the hostname ubuntu net to determine if they are the same machine The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To set up replication between two MySQL instances running on different ports of the same host using the default settings use this command mysqlreplicate master root localhost 3306 s lave roott localhost 3307 rpl user rpl rpl master on localhost connected slave on localhost connected Checking for binary logging on master Setting up replication done Se Sh Sh SE OH The following command uses pedant ic 307 to ensure that replication between the master and slave is successful if and only if both servers
522. select one or more suites to restrict the tests exclude suites and tests and specify the location of the utilities and tests The utility requires the existence of at least one server to clone for testing purposes You must specify at least one server but you may specify multiple servers for tests designed to use additional servers The utility has a special test suite named performance where performance related tests are placed This suite is not included by default and must be specified with the suite 337 option to execute the performance tests OPTIONS mut accepts the following command line options e help Display a help message and exit do tests lt prefix gt Execute all tests that begin with prefix force Do not abort when a test fails record Record the output of the specified test if successful With this option you must specify exactly one test to run e Server lt server gt 336 mut MySQL Utilities Testing Connection information for the server to use in the tests in lt user gt lt passwd gt lt host gt lt port lt socket gt format Use this option multiple times to specify multiple servers skip long Exclude tests that require greater resources or take a long time to run skip suite lt name gt Exclude the named test suite Use this option multiple times to specify multiple suites skip test lt name gt Exclude the named test Use this option multiple
523. selected Execute Current SQL script Execute the statement under the keyboard cursor Explain All or Selection Execute the EXPLAIN command on the query under the keyboard cursor Stop the query being executed Halts execution of the currently executing SQL script Note the database connection will not be restarted and open transactions will remain open Toggle whether execution of SQL script should continue after failed statements If the red breakpoint circle is displayed the script terminates on a statement that fails If the button is depressed so that the green arrow is displayed execution continues past the failed code possibly generating additional result sets In either case any error generated from attempting to execute the faulty statement is recorded in the Output tabsheet Commit Commits the current transaction Note All query tabs in the same connection share the same transactions To have independent transactions a new connection must be opened Rollback Rolls back the current transaction Note All query tabs in the same connection share the same transactions To have independent transactions a new connection must be opened Toggle Auto Commit Mode If selected each statement will be committed independently Note All query tabs in the same connection share the same transactions To have independent transactions a new connection must be opened Beautify SQL Beautify reformat the SQL script Find panel
524. sert rows into the table To edit a row click the field you wish to change and enter the new data Right clicking a row displays a menu with the following items e Set Field s to NULL Set the column value to NULL e Delete Row s Delete the selected row or rows Copy Row Content Copies the row to the clipboard Strings are copied quoted and NULL values are preserved Copy Row Content unquoted Copies the row to the clipboard Strings are not quoted and NULL are copied as a space Copy Field Content Copies the value of the selected field to the clipboard Strings are quoted Copy Field Content unquoted Copies the value of the selected field to the clipboard Strings are not quoted Note that the insert editor features a toolbar This has the same functionality as explained in Section 7 7 4 2 Results Tabsheets and Section 7 7 4 3 Live Editing Tabsheets You can also hover the cursor over the toolbar to display tooltips Any rows you add will be inserted when you forward engineer the database if you choose the Generate INSERT statements for tables option 5 0 5 1 and 5 2 versions of MySQL Workbench For 5 0 and 5 1 if a string is entered without leading and trailing quotation Note R When entering string values that there is slightly different behavior between the marks the Inserts Editor adds quoting and escapes characters that require it 114 Creating Foreign Key Relationships However
525. set you must change the font here 63 64 Chapter 7 SQL Development Table of Contents 7 1 Open Connection to Start Querying ceceeeceee ee ae cece eeeeeeee ee ae aaa teeeeeeeeeaeaaeadeeeeeeeeeaeaaaaneeeeees 65 7 2 NeW GOMMECHON secciceeciinc anasecsererecatasusdlaasereteacdassnegecudeacacduisieduasnandeuceacaencsussscectaaseuwsarasenansesins 66 3 Edit Fable Data orninan etic celina elisha dcaeliadue ae Mi eer ees 66 TA Edit SQL SCMPt ta cgaaceaccesssvedersedacteawaiuucendsenecnwa vvedeeds aE ao Ea NE naea N ANSE 66 Vo Manage Connections iiriinanntorarii aranan a a a a aa aiia 66 7 6 Manage DB Connections Dialog sseseeseeesesssssessrtrrrnrrsststttnrrtretsttnnrtnnutssttunnnnrnnnstentnnnnnt 66 7 6 1 The Password Storage Vault cccccceceeeeeee cece ee ae eeeeee ener sees ae aaa teeeeeeeeeaeaaaaneeeeeeeeeeeaaa 67 7 6 2 Standard TCP IP Connection cccccecceceeeeeeeeeee ee cece eeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeeeeseeeeeeaaa 68 7 6 3 Local Socket Pipe Connection cccceeeeeeeeee cece eeeeeeeeeeee ee aa aa eeeeeeeeeeeeaeaaeeneeeeeeeeeaeaae 69 7 6 4 Standard TCP IP over SSH Connection cccceeececeeeeeeeeeeeeeeeaeeeeeeeeeeeeeaeaaeaeeeeeeeeeeeeaea 69 EAS SQL EdItO taeda sects vies divciztee sth ta EA a A EA E dueaegieds led 70 Fel Nes MALIN MO INU sssicensadesudleas sateen nnd na e a e ERA a a EE ai AE Ka ERRAR a Sit 71 Cree TOOD sea a E E T E E EA E 72 7 33 SOL Query Panel
526. sh privileges Emit a FLUSH PRIVILEGES statement after dumping the mysql database disable keys For each table surround the INSERT statements with statements to disable and enable keys force Continue even if we get an sql error order by primary Dump each table s rows sorted by its primary key or by its first unique index WB Admin Opened 10 7 7 The Logs Tab The Logs tab features two subtabs e General e Slow Query Log The General tab shows entries from the server s general log file The Slow Query Log tab displays entries from the server s slow query log file 196 The Logs Tab Figure 10 13 Administrator Logs Tab Admin mysqld 127 0 0 1 X File Edit View Database Plugins Scripting Community Help Task and Object Browser Server Logs peice ats Your current Log Destination is set to FILE Server Status For logs to be viewed within Workbench they must be configured to be sent to TABLE This option is only available in MySQL version 5 1 and newer Fore more information read http dev mysql com doc refman 5 1 en log tables htm Startup shutdown E Status and System Variables CONFIGURATION a Options File SECURITY Users and Privileges DATA EXPORT RESTORE 3 Data Export and Restore WB Admin Opened 197 198 Chapter 11 Database Migration Wizard Table of Contents 11 1 General installation requirements ccccceeeee
527. sisrson cece cece ee cea e etter teense ee aa aaa te seen esse e iaaa aaa aaa iaai eiai 218 11 54 Preparations fcic feieeieaete leet eh eee lee Seale eee ie 218 TAD 25 DIVO MS seer perii En EREE N RENERE EEA EEEE eed cated aveeaan ete ae oes 220 11 5 3 Connection Setup carinis aan aaia aa a aia aaa EEA 220 11 5 4 PostgreSQL Type Mapping 0ccccceeeeeeeceeeeeeeeeee tees aa ea eeeeeeeeeeaeaaeaeeeeeeeeeeeeaaaaeeees 220 6 MYSQE Migration sessie ested deeded dle A Ge dee ele ae 222 11 7 Using the MySQL Workbench Migration Wizard 0 ccccceceeeeseeeeeeeeeeeeeeaaeeeeeeeeeeeeeeaaaaeeeees 222 11 7 1 Connecting to the databases 2 00 00 cece cece eee e ee aeeete eter sete ee aa aaeeeeeeeeeeeeaaaaeeeeeeeeeees 222 11 7 2 Schemata Retrieval and Selection cccecececeeeeeeceeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaneeeeeees 222 117 3 Reverse Engineering vrcur anian EEEN 222 11 7 4 Object SCO CHOM irainaren i aa ea aa E anaa ENAT NE 222 TL75 MOANN sosisini or A EAE A EA E A 223 11 7 6 Manual Editing 0 cceeece cece cece ee ee cece ee ee noanean cree ee ee ae aaeceeeeeeeeeaeaaeaeeeeeeeeeaeaaaaeeeeeeees 223 14 7 7 Target Creation Options nienia ana E ei aie 223 11 7 8 Schema Creation o sssseseesseesesesseesssersrrrsressssrsrntsressssssnnesteosesssnnssteosecssuneneeosesssunns 223 11 7 9 Create Target Results 0 2 0 0 cee cccce cece cee ee eee e ee ee eae ete te ee ee ease ceed testes eeseaaaaaaeeeeeeeeeeaea 223
528. ss Connect to DBMS Select Schemata The following tasks will now be executed Please monitor the execution Press Show Logs to see the execution logs Fetch Object Info amp Reverse Engineer Selected Objects Place Objects on Diagram Select Objects Reverse Engineer Operation Completed Successfully Finished parsing MySQL SQL script Click Next to continue to the next page The final page of the wizard provides a summary of the reverse engineered objects 135 Reverse Engineering Figure 8 26 Results Connection Options Reverse Engineering Results Connect to DBMS Select Schemata Fetch Object Info Summary of Reverse Engineered Objects Select Objects 3 tables from schema world Reverse Engineer Results Click Finish to exit the wizard Before exiting MySQL Workbench be sure to save the schema Choose the File Save menu item to save the reverse engineered database as a MySQL Workbench file with the extension mwb 8 7 9 2 1 Errors During Reverse Engineering During reverse engineering the application checks for tables and views that duplicate existing names and disallows duplicate names if necessary If you attempt to import an object that duplicates the name of an existing object you will be notified with an error message To see any errors that have occurred during reverse engineering you can click the button Show Logs This will create a panel containing a list of messages including an
529. ss2 E distria C city_id E postal_code E phone last_update fafaf Columns ForeignKeys Triggers Partitioning Options Select an index by right clicking it The Index Columns section displays information about the selected index To add an index click the last row in the index list Enter a name for the index and select the index type from the list Select the column or columns that you wish to index by checking the column name in the Index Columns list You can remove a column from the index by removing the check mark from the appropriate column You can also specify the order of an index by choosing ASC or DESC under the Order column Create an index prefix by specifying a numeric value under the Length column You cannot enter a prefix value for fields that have a data type that does not support prefixing To drop an index right click the row of the index you wish to delete then select the Delete Selected Indexes menu item 8 7 1 3 4 The Foreign Keys Tab The Foreign Keys tab is organized in much the same fashion as the Indexes tab and adding or editing a foreign key is similar to adding or editing an index 109 Creating Tables Figure 8 12 The Foreign Keys Tab Foreign Keys Foreign Key Name Referenced Table Foreign Key Options fk_customer_address sakila address On Update fk_cust tore sakila store a ae ee L Foreign Key Comment eel me Foreign Keys Mitel Ms ele S leC lic
530. stall the file using the main menu item Scripting Install Plugin Module File 2 The source file name must have the extension _grt py for example my_module_grt py 3 Some module metadata must be defined This can be done using the Def ineModule function from the wb module from wb import 226 Plugins ModuleInfo DefineModule name MyModule author Your Name version 1 0 4 Functions to be exported require their signature to be declared This is achieved using the export decorator in the previously created Modulelnfo object ModuleInfo export grt INT grt STRING def checkString s For the export statement the return type is listed first followed by the input parameter types specified as GRT typenames The following typenames can be used e grt INT An integer value Also used for boolean values e grt DOUBLE A floating point numeric value e grt STRING UTF 8 or ASCII string data e grt DICT A key value dictionary item Keys must be strings e grt LIST A list of other values It is possible to specify the type of the contents as a tuple inthe form grt LIST lt type or class gt For example grt LIST grt STRING for a list of strings For a list of table objects the following would be specified grt LIST grt classes db table e grt OBJECT An instance of a GRT object or a GRT class object from grt classes Note that these types are defined in the grt module which must be
531. statements that transform the definition of db1 tablel to dbx table3 use this command mysqldiff serverl root hostl server2 root host2 changes for serverl difftype sql db1 tablel dbx table3 serverl on hostl connected server2 on host2 connected Comparing dbl tablel to dbx table3 FAIL Transformation statements Se Sh Sh SE ALTER TABLE dbl tablel ADD COLUMN notes char 30 AFTER a CHANGE COLUMN misc misc char 55 Compare failed One or more differences found To generate a set of SQL statements that transform the definition of dbx table3 to dbl tablel use this command S mysqldiff serverl root hostl server2 root host2 changes for server2 difftype sql db1 tablel dbx table3 serverl on hostl connected server2 on host2 connected Comparing dbl tablel to dbx table3 FAIL Transformation statements Sh Sh Se SE ALTER TABLE dbx table3 DROP COLUMN notes CHANGE COLUMN misc misc char 30 286 mysqldiskusage Show Database Disk Usage Compare failed One or more differences found To generate a set of SQL statements that transform the definitions of dbx table3 and db1 tablel in both directions use this command mysqldiff serverl root hostl server2 root host2 show reverse difftype sql dbl tablel dbx table3 serverl on hosti connected server2 on host2 connected Comparing dbl tablel to dbx table3 FAIL Transformation statements
532. storage or distribution medium does not bring the other work under the scope of this License 3 You may opt to apply the terms of the ordinary GNU General Public 352 GNU Lesser General Public License Version 2 1 February 1999 License instead of this License to a given copy of the Library To do his you must alter all the notices that refer to this License so hat they refer to the ordinary GNU General Public License version 2 nstead of to this License If a newer version than version 2 of the rdinary GNU General Public License has appeared then you can specify hat version instead if you wish Do not make any other change in hese notices Ge Ge ES Gr Gr Once this change is made in a given copy it is irreversible for hat copy so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy ct This option is useful when you wish to copy part of the code of the Library into a program that is not a library 4 You may copy and distribute the Library or a portion or derivative of it under Section 2 in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine readable source code which must be distributed under the terms of Sections 1 and 2 above ona medium customarily used for software interchange If distribution of object code is made by offering access to copy from a d
533. t content struct name workbench model reporting TemplateStyleInfo key styles gt lt value type object struct name workbench model reporting TemplateStyleInfo id 7550655C CD4B 4EB1 8FAB AAEE4 9B2261E struct checksum 0xab08451b gt lt value type string key description gt Designed to be viewed with a fixed sized font lt value gt lt value type string key name gt Fixed Size Font lt value gt lt value type String key previewImageFileName gt preview_basic png lt value gt lt value type String key styleTagValue gt fixed lt value gt lt value gt lt value gt lt value type string key mainFileName gt report txt lt value gt lt value gt lt data gt The file defines wwo objects the TemplateInfo object and the TemplateStyleInfo object These objects contain information about the template that will be displayed in the DBDoc Model Reporting wizard main page Change the object GUIDs that are used in the file In this example there are two that need replacing id BD6879ED 814C 4CA3 A8 69 98 64F83B88DF id 7550655C CD4B 4EB1 8FAB AAEE4 9B2261E Generate two new GUIDS This can be done using any suitable command line tool There are also free online tools that can be used to generate GUIDs Another way to generate GUIDs is by using the MySQL uuID function mysql gt SELECT UUID UUID
534. t 3311 MASTER lloe allinese S332 SLAVE MASTER i localhost 3313 SLAVE MASTER oan Toca lhos tk gt M lt gt SLAVE To produce a column list in addition to the graph specify the show 1list 323 option In this case to specify how to display the list use one of the following values with the format 322 option grid default Display output in grid or table format like that of the mysql monitor e CSV Display output in comma separated values format tab Display output in tab separated format vertical Display output in single column format like that of the G command for the mysql monitor The utility uses of the SHOW SLAVE HOSTS statement to determine which slaves the master has If you want to use the recurse 323 option slaves should have been started with the report host and report port options set to their actual host name and port number or the utility may not be able to connect to the slaves to determine their own slaves OPTIONS mysqlrplshow accepts the following command line options e help Display a help message and exit e discover slaves login lt slave login gt Supply the user and password in the form lt user gt lt passwd gt or lt login path gt for discovering slaves and relay slaves in the topology For example discover joe secret will use joe as the user and secret as the password for each discovered slave format lt format gt f lt format gt S
535. t sql Q Instead of displaying the selected processes emit the SELECT statement that retrieves information about them If the kill connection 304 or kill query 804 option is given the utility generates a stored procedure named kill_processes for killing the queries rather than a SELECT statement sql body Like sq1 305 but produces the output as the body of a stored procedure without the CREATE PROCEDURE part of the definition This could be used for example to generate an event for the server Event Manager When used with a kill option code for killing the matching queries is generated Note that it is not possible to execute the emitted code unless it is put in a stored routine event or trigger For example the following code could be generated to kill all idle connections for user www data S mysqlprocgrep kill connection sql body gt match user www data match state sleep DECLARE kill_done INT DECLARE kill cursor CURSOR FOR SELECT Id User Host Db Command Time State Info FROM INFORMATION_SCHEMA PROCESSLIST WHERE user LIKE www data AND State LIKE sleep OPEN kill cursor BEGIN DECLARE id BIGINT DECLARE EXIT HANDLER FOR NOT FOUND SET kill_done 1 Oop FOORE FETCH kill cursor INIO id KILL CONNECTION id END LOOP kill_loop END CHOSE KIINI ECUR SOE verbose v 305 mysqlreplicate Set Up and Start Replication Between Two Servers Specify how much information t
536. t startup r n python script Executes the given Workbench Python script at startup r n lua script Executes the given Workbench Lua script at startup script scriptfile Executes the given Workbench script file at startup quit when done Quits Workbench once the given script finishes executing T Swrende Cing Geaaace Force the canvas to use software rendering instead of OpenGL SMOVOGO seess enre nre Do not display the splash screen TOG e E E Instruction to save messages other debug info to file Verbose V saccee Print verbose output in the GRT Shell NEES LON eee eee Print the version information SQUEVErSLONM eeen Print the GRI version information help 7n ceesre Print tiles ouLput The MySQL Workbench help output includes a version number a usage message and the option descriptions Use the swrendering option if your video card does not support OpenGL 1 5 The version option can be used to display the MySQL Workbench version number The grtversion can be used to display the GRT Generic RunTime shell version number The other options are self explanatory output to a console window be sure that you pipe the output through the more Note E When using the help and version command line options that display command Otherwise nothing will be displayed 4 3 3 Uninstalling MySQL Workbench on Windows The method for uninstalling MySQL Workbench depends on how you installed MySQL Workbench in the first place
537. tabase Objects Between Servers server2 root root localhost db1l db2 changes for server2 a difftype sql Defn Row Data Type Object Name DIE Count Check TABLE wil pass pass FAIL Data transformations for direction server2 Data differences found among rows UPDATE db2 t1l1 SET b Test 789 WHERE a 1 UPDATE db2 tl1 SET b Test 123 WHERE a 3 DELETE FROM db2 t1 WHERE a 5 INSERT INTO db2 t1l a b VALUES 4 New row Cloll 5 With the difftype sql1 264 SQL generation option set show reverse 264 shows the object transformations in both directions Here is an excerpt of the results mysqldbcompare serverl root root localhost server2 root root localhost dbl db2 changes for serverl show reverse a difftype sql all Defn Row Data Type Object Name DTE Coun Check TABLE ie ll pass pass FAIL Data transformations for direction serverl Data differences found among rows UPDATE db1 tl SET b Test 123 WHERE a 1 UPDATE dbl tl SET b Test 789 WHERE a 3 DELETE FROM dbl tl WHERE a 4 INSERT INTO dbl tl a b VALUES 5 New row Clea2 F Data transformations for direction server2 Data differences found among rows UPDATE db2 tl1 SET b Test 789 WHERE a 1 UPDATE db2 tl1 SET b trest 123 WHERE a 3 DELETE FROM db2 t1 WHERE a 5 INSERT INTO db2 tl a b VALUES 4 New row Clo 5 Database co
538. tabases and Identify Differences 261 14 4 5 mysqldbcopy Copy Database Objects Between Servers ccccecseeeeeeeeneeeeees 267 14 4 6 mysqldbexport Export Object Definitions or Data from a Database 272 14 4 7 mysqldbimport Import Object Definitions or Data into a Database 279 14 4 8 mysqldiff Identify Differences Among Database Objects csseeeeeeeeeeees 283 14 4 9 mysqldiskusage Show Database Disk Usage ccceeeeeeeeeeeeeeeaeeneeeeeeeeeees 287 14 4 10 mysql failover Automatic replication health monitoring and failover 290 14 4 11 mysqlindexcheck Identify Potentially Redundant Table Indexes 08 297 14 4 12 mysqimetagrep Search Database Object Definitions cccceeeeeeeeeeeeeeeeees 300 14 4 13 mysqlprocgrep Search Server Process Lists c cseeeeeeeeeeeeaeeneeeeeeeeeeeeaes 303 14 4 14 mysqlreplicate Set Up and Start Replication Between Two Servers 306 14 4 15 mysqlrpladmin Administration utility for MySQL replication 0 eeeeeeees 309 14 4 16 mysqlrplcheck Check Replication Prerequisites c seceeeeeeeeeeeeeteeeeeees 318 14 4 17 mysqlrplshow Show Slaves for Master Server scceeeeeeeeeeeeeeeeeeeeeeeeeaes 321 14 4 18 mysqlserverclone Clone Existing Server to Create New Server
539. table only for MyISAM Delay Key Updates Use this option to delay the key updates ungi the table is closed This works for MyISAM only Row Options a id be stored The option value can FIXED or X Row Format Don t Use Say aE Gon bi taal to Avg Row Length e average row length for your table You need to set this only for large Min Rows The minimum number of rows you plan to store in the table Max Rows The maximum number of rows you plan to store in the table 2 ve checksum for all rows This makes Use Checksum iso makes k easier to find corrupted tables Storage Options Dec be T for MVISAM s Directory where to put the tables data file This works only for MyISAM tables only and ne Data Directory on some operating s Directory wh le This works y MyISAM tables only and not Index Directory on some operating Merge Table Options Us bl Comma separated list of MyISAM tables that should be used by the MERGE table Enclose the T oe kst with parentheses Merge Method Don t Use The union table which should be used for inserts ee Te ue Coe eM cecil Options which are grouped into the following sections General Options e Row Options Storage Options Merge Table options The following discussion describes these options in more detail General Options Section In the General Options section choose a pack keys option The options are Default Pack None and Pack All You may also encrypt the definition of a table The AUTO_INCRE
540. tatement Diff definitions of two objects Check data consistency of two tables Format list in either GRID or delimited format to a file Format list in a vertical format to a file Print list based on format CSV GRID TAB Or VERTICAI Set up option parser and options common to all MySQL Utilities Add common skip options Check skip options for validity Check format option for validity 240 Introduction to extending the MySQL Utilities add_verbosity Add verbosity and quiet options check_verbosity Check whether both verbosity and quiet options are being used add_difftype Add difftype option add_engines Add engine default storage engine options check_engine_options Check whether storage engines listed in options exist parse_connection Parse connection values Yel Replication Establish replication connection between a master and a slave get_replication_tests Return list of replication test function pointers server get_connection_dictionary Get connection dictionary find_running_servers Check whether any servers are running on the local host SOM CG mes ora ictas Connect to source and destination server Server Connect to running MySQL server and perform server level operations table Index Encapsulate index for a given table as defined by SHOW INDEXES Table Encapsulate table for given database to perform table level operations tools get_tool_path Search for MySQL tool and return its ier IL osen delete_directory Remove dir
541. ted but is not required 2 Altered source versions must be plainly marked as such and must not be misrepresented as being the original software 3 This notice may not be removed or altered from any source ai Ser burton A 29 TreeViewAdv for NET License The following software may be included in this product TreeViewAdv for NET The BSD License Copyright c 2009 Andrey Gliznetsov a gliznetsov gmail com All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met Redistributions of source code must retain the above copyright notice this lst of conditions and the rollowing disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation andor other materials provided with the distribution THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE 376 VSQLite License COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS
542. ter root 127 0 0 Connect AQI2 1O LO wil essa 2 localhost tester root 127 0 4 4 4 4 4 4 4 To display the audit log entries with a specific status use the following command 260 mysqldbcompare Compare Two Databases and Identify Differences shell gt mysqlauditgrep status 1100 1199 1046 SERVER data audit log 4 4 4 4 M STATUS TIMESTAMP NAME SOLTEXT 4 4 4 4 5 5 1046 2012 10 10T15 57 26 Query show tables test 1046 2012 10 10T15 57 36 Query show tables test 1146 2012 10 10T17 44 55 Query select from teste employees where salary gt 500 and sala 1046 2OI2 O i Owl 37 gi Query select from test_encoding where value lt gt amp 4 4 4 4 M Note You can view all successful commands with st atus 0 and all unsuccessful ones with status 1 9999 To display the audit log entries matching several search criteria use the following command shell gt mysqlauditgrep users root start date 0 end date 2012 10 10 event type Query query type SET status 0 pattern Saudit_log SERVER data audit log 4 4 4
543. ter root localhost 3331 314 mysqlrpladmin Administration utility for MySQL replication slaves root localhost 3332 root localhost 3333 root localhost 3334 candidates root localhost 3333 root localhost 3334 elect Electing candidate slave from candidate list then slaves list Best slave found is located on localhost 3332 done To perform failover after a master has failed use the following command mysqlrpladmin slaves root localhost 3332 root localhost 3333 root localhost 3334 candidates root localhost 3333 root localhost 3334 failover Performing failover Candidate slave localhost 3333 will become the new master Preparing candidate for failover Creating replication user if it does not exist Stopping slaves Performing STOP on all slaves Switching slaves to new master Starting slaves Performing START on all slaves Checking slaves for errors Failover complete done To see the replication health of a topology with GTID MODE ON server version 5 6 5 or higher and discover all slaves attached to the master run the following command We use the result of the failover command above mysqlrpladmin master root localhost 3333 slaves root localhost 3332 root localhost 3334 health Getting health for master localhost 3333 Replication Topology Health 4 4 4 4 4 4 h
544. ter with an ANSI C compiler AUTHOR Antoon Bosselaers Dept Electrical Eng ESAT COSIC DATE i March 1996 VERSION 1 0 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Copyright c Katholieke Universiteit Leuven 1996 All Rights Reserved 363 PyODBC License The Katholieke Universiteit Leuven makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose It is provided as is without express or implied warranty of any kind These notices must be retained in any copies of any part of this documentation and or software FERRARA KA RAR I A I AA k k A k k AR k k k k k k k k k k k k k kkk kkk A kk A 24 PyODBC License The following software may be included in this product PyODBC Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR
545. that point e verbose v Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit You must provide connection parameters user host password and so forth for an account that has the appropriate privileges to access all objects in the operation To export all objects from a source database the user must have these privileges SELECT and SHOW VIEW on the database as well as SELECT on the mysqi database Actual privileges needed may differ from installation to installation depending on the security privileges present and whether the database contains certain objects such as views or events Some combinations of the options may result in errors when the export is imported later For example eliminating tables but not views may result in an error when a view is imported on another server For the format 275 export 274 and display 274 options the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 275 specifies the grid format An error occurs if a prefix matches more than one valid value The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utili
546. that relate to the same table For example the film table has two foreign keys that relate to the Language table namely fk_film_language_original and fk_film_language Where more than one relationship exists between two tables the connection lines run concurrently Identifying and nonidentifying relationships are indicated by solid and broken lines respectively For example the foreign key category_id is part of the primary key in the film _ category table so its relationship to the category table is drawn with a solid line On the other hanad in the city table the foreign key count ry_id is not part of the primary key so the connection uses a broken line 161 Printing 8 9 Printing The printing options used to create printouts of your EER Diagrams are found under the File menu To create documentation of your models see Section 8 5 1 5 1 The DBDoc Model Reporting Dialog Window Commercial Version 8 9 1 Printing Options The printing menu items not enabled unless an EER Diagram is active These items are available Page Setup Enables you to choose the paper size orientation and margins Print Sends your EER Diagram directly to the printer This option generates a preview before printing From the preview you can adjust the scale of the view and also choose a multi page view Clicking the printer icon at the top left of this window prints the currently selected EER Diagram Close the print preview window if you
547. the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions H he above copyright notice and this permission notice shall be ncluded in all copies or substantial portions of the Software a HE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND XPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES F MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND ONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT OLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY HETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING ROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE lal ea Bel a OP eal Gel A 20 Paramiko License The following software may be included in this product Paramiko 360 PCRE License You are receiving a copy of Paramiko in both source and object code The terms of the Oracle license do NOT apply to the Paramiko program it is licensed under the following license separately from the Oracle programs you receive If you do not wish to install this program you may delete the Paramiko folder and all its contents This component is licensed under Section A 12 GNU Lesser General Public License Version 2 1 February 1999 A 21 PCRE License The following software may be included in this product PCRE Perl Compatible Regular Expressions Library PCRE LICENCE PCRE is a l
548. the permitted values are not case sensitive In addition values may be specified as any unambiguous prefix of a valid value For example format g 333 specifies the grid format An error occurs if a prefix matches more than one valid value 333 Parsers The path to the MySQL client tools should be included in the PATH environment variable in order to use the authentication mechanism with login paths This will allow the utility to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf EXAMPLES To clone joe aS sam and sally with passwords and logging in as root on the local machine use this command mysqluserclone source root localhost destination root localhost joe localhost sam secretl localhost sally secret2 localhost Source on localhost connected Destination on localhost connected Cloning 2 users Cloning joe localhost to user sam secret1 localhost Cloning joe localhost to user sally secret2 localhost toe done The following command shows all users on the local server in the most verbose output in CSV format mysqluserclone source root localhost list format csv vvv Source on localhost connected user host database joe localhost util_test ape eoGcellno ster sally localhost util_test sam localhost util_test joe user util_test 14 5 Parsers 14 5 1 mysql utilities parser
549. this user a copy For an executable the required form of the work that uses the Library must include any data and utility programs needed for reproducing the executable from it However as a special exception the materials to be distributed need not include anything that is normally distributed in either source or binary form with the major components compiler kernel and so on of the operating system on which the executable runs unless that component itself accompanies the executable It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system Such a contradiction means you cannot use both them and the Library together in an executable that you distribute 7 You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities not covered by this License and distribute such a combined library provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted and provided that you do these two things a Accompany the combined library with a copy of the same work based on the Library uncombined with any other library facilities This must be distributed under the terms of the Sections above b Give prominent notice with the combined library of the fact that part of it is a work based on the L
550. thout at the following conditions retain the above copyright the following disclaimer reproduce the above copyright the following disclaimer in the s provided with the ot be used to endorse or promote without specific prior written HOLDERS AND CONTRIBUTORS INCLUDING BUT NOT EERCHANTABILITY AND FITNESS FOR N NO EVENT SHALL THE COPYRIGHT OWNER OR INDIRECT INCIDENTAL SPECIAL CLUDING BUT NOT LIMITED TO ICES LOSS OF USE DATA OR GHT HOWEVER CAUSED AND ON ANY THEORY OF ETABTETDY OURS TORT WAX OUT UF THE USE QF INCLUDING THIS 368 Python License SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE Any feedback is very welcome http www math keio ac jp matumoto emt html email matumoto math keio ac jp Sockets The socket module uses the functions getaddrinfo and getnameinfo which are coded in separate source files from the WIDE Project http www wide ad jp Gaos teine CC 1995 W996 W987 aiael WOE S oee All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions AIS Wie s 1 Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer 2 Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or
551. timeout lt seconds gt 293 mysqlfailover Automatic replication health monitoring and failover NOTES Maximum timeout in seconds to wait for each replication command to complete For example timeout for slave waiting to catch up to master Default 3 e verbose V Specify how much information to display Use this option multiple times to increase the amount of information For example v verbose vv more verbose vvv debug e version Display version information and exit The login user must have the appropriate permissions to execute SHOW SLAVE STATUS SHOW MASTER STATUS and SHOW VARIABLES on the appropriate servers as well as grant the REPLICATE SLAVE privilege Different permission are required by the failover utility to run successfully for master and slaves In particular users connectioned to slaves and candidates require SUPER GRANT OPTION REPLICATION SLAVE and RELOAD privileges In addition the user connected to the master requires DROP CREATE INSERT and SELECT privileges to register the failover console The utility checks permissions for the master slaves and candidates at startup At startup the console will attempt to register itself with the master If another console is already registered and the failover mode is auto or elect the console will be blocked from running failover When a console quits it deregisters itself from the master If this process is broken the user may overri
552. tion Manage Import Export feature should be used 7 5 Manage Connections Clicking this action item launches the Manage DB Connections wizard This wizard also displays Stored Connections which can be selected and changed as desired This wizard can also be used to create new connections To read more about managing connections see Section 7 6 Manage DB Connections Dialog 7 6 Manage DB Connections Dialog MySQL Workbench provides a Manage DB Connections dialog for creating and managing connections to servers The connections created can then be used from the wizards that must connect to a server such as the wizard used to reverse engineer a live database However it is still possible to set connection parameters from these wizards if required without invoking the Manage DB Connections dialog directly The Manage DB Connections dialog is invoked by selecting Database Manage Connections from the main menu It can also be invoked from any of the wizards requiring access to a live database This is achieved by using the Manage Stored Connections item found in the wizard s Stored Connection list After the Manage DB Connections dialog is launched you are presented with the following dialog which enables you to create or delete connections 66 The Password Storage Vault Figure 7 1 Manage DB Connections Dialog fr E D Manage DB Connections Ea E o o j Stored Connections Connection Nam
553. tion read from the server the account used to connect to the server must have the appropriate permissions to read any objects accessed during the operation If information requested requires file system access but is not available that way the utility prints a message that the information is not accessible This occurs for example if you request log usage but the server is not local and the log files cannot be examined directly To specify how to display output use one of the following values with the format 288 option e grid default Display output in grid or table format like that of the mysql monitor e csv Display output in comma separated values format e tab Display output in tab separated format vertical 287 mysqldiskusage Show Database Disk Usage Display output in single column format like that of the G command for the mysq1 monitor To turn off the headers for csv or tab display format specify the no headers 288 option OPTIONS mysqldiskusage accepts the following command line options help Display a help message and exit all a Display all disk usage This includes usage for databases logs and InnoDB tablespaces binlog b Display binary log usage empty m Include empty databases format lt format gt f lt format gt Specify the output display format Permitted format values are grid csv tab and vertical The default is grid innodb i Display InnoD
554. to anyone to use this software for any purpose including commercial applications and to alter it and redistribute it freely subject to the following restrictions 1 The origin of this software must not be misrepresented you must not claim that you wrote the original software If you use this software in a product an acknowledgment in the product documentation would be appreciated but is not required 2 Altered source versions must be plainly marked as such and must not be misrepresented as being the original software 3 This notice may not be removed or altered from any source distribution Jean loup Gailly jloup gzip org Mark Adler madler alumni caltech edu 378 Appendix B MySQL Workbench FAQ Frequently Asked Questions with answers Questions e B 1 379 How does MySQL Workbench increase import performance e B 2 379 MySQL Workbench 5 0 appears to run slowly How can increase performance e B 3 380 get errors when creating or placing objects on an EER Diagram am using OpenGL rendering AMD processor and ATI graphics hardware e B 4 380 What do the column flag acronyms PK NN UQ BIN UN ZF Al in the MySQL Workbench Table Editor mean Questions and Answers B 1 How does MySQL Workbench increase import performance When a model is exported using the main menu item File Export Forward Engineer SQL CREATE Script some server variables are temporarily set to enable faster SQL import by the server
555. tood before proceeding further The Open ODBC Administrator option will load odbcad32 exe and is used to confirm that the ODBC Driver for SQL Server is installed and to make configuration changes if needed Click Start Migration to continue Source Selection The source is the RDBMS that will be migrated to MySQL Define the connection parameters and related information here by first choosing the Database System as the other parameters will change accordingly to this choice Figure 11 3 MySQL Workbench migration Source Selection Parameters Migration X Migration Task List Source Selection OVERVIEW overview Source RDBMS Connection Parameters SOURCE amp TARGET Database System MySQL w Select a RDBMS from the list of supported systems Target Selection Stored Connection v Select from saved connection settings Fetch Schemata List Connection Method Standard TCP IP v Method to use to connect to the RDBMS Schemata Selection Reverse Engineer Source OBJECT MIGRATION 127 0 0 1 Port 3306 Name or IP address of the server host TCP IP port Source Objects Migration Manual Editing Password Store in Vault The user s password Will be requested later if it s not set Target Creation Options Create Schemata Create Target Results Username root Name of the user to connect with Default Schema The schema to use as default schema Leave blank to select it later DATA MIGRATION Data Transfer Setup Bul
556. toolbar on the left side of an EER Diagram has six foreign key tools one to one non identifying relationship one to many non identifying relationship one to one identifying relationship one to many identifying relationship many to many identifying relationship Place a Relationship Using Existing Columns An identifying relationship is one where the child table cannot be uniquely identified without its parent Typically this occurs where an intermediary table is created to resolve a many to many relationship In such cases the primary key is usually a composite key made up of the primary keys from the two original tables An identifying relationship is indicated by a solid line between the tables and a nonidentifying relationship is indicated by a broken line Create or drag and drop the tables that you wish to connect Ensure that there is a primary key in the table that will be on the one side of the relationship Click on the appropriate tool for the type of relationship you wish to create If you are creating a one to many relationship first click the table that is on the many side of the relationship then on the table containing the referenced key This creates a column in the table on the many side of the relationship The default name of this column is table_name_key_name where the table name and the key name both refer to the table containing the referenced key When the many to many tool is active d
557. ts 5 Creates the migrated objects in the target MySQL server If there are errors you can return to the previous step and correct them and retry the target creation 6 Copy data of the migrated tables from the source RDBMS to MySQL MySQL Workbench provides support for migrating from some specific RDBMS products The Migration Wizard will provide the best results when migrating from such products However in some cases other unsupported database products can also be migrated by using its Generic database support as long as you have an ODBC driver for it In this case the migration will be less automatic but should still work nonetheless 11 2 1 A visual guide to performing a database migration This example will migrate a Microsoft SQL Server database to MySQL and include a screenshot for each step From MySQL Workbench choose Database Migrate to open the migration wizard The opening screen will look like this Overview Figure 11 2 MySQL Workbench migration Overview File Edit View Database Plugins Scripting Help Migration Task List Overview OVERVIEW Overview Welcome to the MySQL Workbench Migration Wizard This wizard will assist you in migrating tables and data from a supported database system to MySQL You can also use this to copy databases from one MySQL instance to another SOURCE amp TARGET Source Selection Target Selection Prerequisites Fetch Schemata List Schemata Selection Reverse
558. ts add an object name to each database name in db obj format For example use db1 obj1 db2 0b 42 to compare two named objects or db1 obj1 to compare an object with the same name in databases with the same name It is not legal to mix a database name with an object name For example db1 obj1 db2 and db1 db2 obj2 are illegal The comparison may be run against a single server for comparing two databases of different names on the same server by specifying only the server1 284 option Alternatively you can also connect to another server by specifying the server2 284 option In this case the first object to compare is taken from server1 and the second from server2 By default the utility generates object differences as a difference report However you can generate a transformation report containing SQL statements for transforming the objects for conformity instead Use the sql value for the difftype 284 option to produce a listing that contains the appropriate ALTER commands to conform the object definitions for the object pairs specified If a transformation cannot be formed the utility reports the diff of the object along with a warning statement See important limitations in the NOTES section To specify how to display diff style output use one of the following values with the difftype 284 option e unified default Display unified format output context Display context format output e differ Display differ style
559. ts all the rights that we gave you You must make sure that they too receive or can get the source code If you link other code with the library you must provide complete object files to the recipients so that they can relink them with the library after making changes to the library and recompiling it And you must show them these terms so they know their rights We protect your rights with a two step method 1 we copyright the library and 2 we offer you this license which gives you legal permission to copy distribute and or modify the library To protect each distributor we want to make it very clear that there is no warranty for the free library Also if the library is modified by someone else and passed on the recipients should know that what they have is not the original version so that the original author s reputation will not be affected by problems that might be introduced by others Finally software patents pose a constant threat to the existence of any free program We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder Therefore we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license Most GNU software including some libraries is covered by the ordinary GNU General Public License This license the GNU Lesser 350 GNU Lesser Gene
560. tware to use reproduce display distribute execute and transmit the Software and to prepare derivative works of the Software and to permit third parties to whom the Software is furnished to do so all subject to the following The copyright notices in the Software and this entire statement including the above license grant this restriction and the following disclaimer must be included in all copies of the Software in whole or in part and all derivative works of the Software unless such copies or derivative works are solely in the form of machine executable object code generated by a source language processor THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE TITLE AND NON INFRINGEMENT IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY WHETHER IN CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE A 5 Cairo License The following software may be included in this product Caire You are receiving a copy of the Cairo in both source and object code in the following DLL libcairo dll or dynamic libraries MySQLWorkbench app Contents Frameworks libcairo 2 dylib and MySQLWorkbench app Contents Frameworks libpixman 1 0 dylib The terms of the Oracle lic
561. tween BeOpen com BeOpen having an office at 160 Saratoga Avenue Santa Clara CA 95051 and the Individual or Organization Licensee accessing and otherwise using this software in source or binary form and its associated documentation the Software 2 Subject to the terms and conditions of this BeOpen Python License Agreement BeOpen hereby grants Licensee a non exclusive royalty free world wide license to reproduce analyze test perform and or display publicly prepare derivative works distribute and otherwise use the Software alone or in any derivative version provided however that the BeOpen Python License is retained in the Software alone or in any derivative version prepared by Licensee 3 BeOpen is making the Software available to Licensee on an AS IS basis BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES EXPRESS OR IMPLIED BY WAY OF EXAMPLE BUT NOT LIMITATION BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY RIGHTS 4 BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR ANY INCIDENTAL SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING MODIFYING OR DISTRIBUTING THE SOFTWARE OR ANY DERIVATIVE THEREOF EVEN IF ADVISED OF THE POSSIBILITY THEREOF 5 This License Agreement will automatically terminate upon a material breach of its terms
562. ty to use the my_print_defaults tools which is required to read the login path values from the login configuration file mylogin cnf If any database identifier specified as an argument contains special characters or is a reserved word then it must be appropriately quoted with backticks In turn names quoted with backticks must also be quoted with single or double quotes depending on the operating system i e in Windows or in non Windows systems in order for the utilities to read backtick quoted identifiers as a single argument For example to export a database with the name weird db name it must be specified as argument using the following syntax in non Windows weird db name EXAMPLES To export the definitions of the database dev from a MySQL server on the local host via port 3306 producing output consisting of CREATE statements use this command mysqldbexport server root pass localhost skip GRANTS export DEFINITIONS util_test Source on localhost connected Exporting metadata from util_test DROP DATABASE IF EXISTS util_test 276 mysqldbexport Export Object Definitions or Data from a Database CREATE DATABASE util_test USE util test TABTE IUE MECE sitet CREATE TABLE El a char 30 DEFAULT NULL ENGINE MEMORY DEFAULT CHARSET latinl TABLE utaletestat2 CREATE TABLE t2 a char 30 DEFAULT NULL ENGINE MyISAM DEFAULT CHARSET latinl TABLE util_test t3 CREATE TABLE E3
563. up_name Copy routine_group_name Edit Routine 122 Creating Routines and Routine Groups 8 7 4 2 2 8 7 4 2 3 8 7 4 2 3 1 Edit in New Window e Copy SQL to Clipboard e Delete routine_group_name The Edit Routine Group item opens the routine group editor which is described in Section 8 7 4 2 3 The Routine Group Editor The cut and paste items are useful for copying routine groups between different schemata Deleting a routine group from the MySQL Model page removes the group but does not remove any routines contained in that group Any routine groups added to the Physical Schemata also show up in the Catalog palette on the right side of the application They may be added to an EER Digram by dragging and dropping them from this palette Adding Routine Groups to an EER Diagram To add routine groups to an EER Diagram use the Routine Groups tool on the vertical toolbar Make sure that the EER Diagram tab is selected then right click the routine groups icon on the vertical toolbar The routine groups icon is immediately above the lowest toolbar separator Clicking the mouse on this icon changes the mouse pointer to a routine group pointer You can also change the mouse pointer to a routine pointer by pressing the G key Choosing the Routine Group tool changes the contents of the toolbar that appears immediately below the menu bar When the Routine Groups pointer is active this toolbar contains
564. urce Refreshes the current result set from the data source e Search for substring within data Searches the data for the string entered in the search box 7 7 4 3 Live Editing Tabsheets It is possible to edit data in real time using the Live Editing tabsheets The live editor is the default view type so it will be displayed after running a SELECT query or by right clicking a table in the Schema Viewer and choosing Edit Data Table The top part of the result set may be resized to reveal the SELECT query that it originated from This query can be altered to show only columns you want which might mean adding a WHERE clause In addition to the controls offered by the Results tabsheet the Live Editor tab features some additional controls These controls are highlighted in the following screenshot Figure 7 11 SQL Editor Live Editing Tabsheet Navigation Controls fi Query 1 x ul rf Ac alsa mE 1 SELECT FROM world Country 100 29 1 Filter Q Code Name SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld ABW Aruba North America Caribbean 193 00 hu 103000 78 4 828 00 793 00 AFG Afghanistan Asia Southern and 652090 00 1919 22720000 45 9 5976 00 nut AGO Angola Africa Central Africa 1246700 00 1975 12878000 38 3 6648 00 7984 00 AIA Anguilla North America Caribbean 96 00 HULL 8000 76 1 63 20 nuu ALB Albania Europe Southern Europe 28748 00 1912 3401200 71 6 3205 00 2500 00 AND Andorra Europe Souther
565. urce code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of menendezpoo com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER alg N ae N CONTRACT STRICT LIABILITY OR TORT INCLUDING EGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF HE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE A 14 iODBC License The following software may be included in this product iODBC In accordance with the terms of the iODBC licensing scheme set forth below
566. use it to access the Workbench Scripting Shell Scripting Library functions and global functions and objects To see the available commands type You can also cut and paste text to and from the shell window The Snippets tab is a scratch pad for saving code snippets This makes it easy to reuse code and does away with the need to retype it at the command line If you have opened script files each will have its own tab to the right of the Snippets tab These tabs will be labeled with the names of the script files or Unnamed for snippets without a name As with the Snippets tab you can cut and paste to or from any of the tabs This gives you the opportunity to test code from the command line Right clicking on a snippet opens a dialog with options to Execute Snippet Send to Script Editor or Copy To Clipboard While individual commands can be entered into the shell it is also possible to run a longer script stored in an external file using the main menu item Scripting Run Workbench Script File When scripts are run outside of the shell to see the output use the main menu item View Output It is also possible to run script files directly from the shell For details on running script files type run at the Workbench Scripting Shell prompt The following message is displayed Help Topics GPE General information about the Workbench runtime scripting Practical information when working on scripts and modules for Workbench wbdata Su
567. ut context Display context format output differ Display differ style format output 262 mysqldbcompare Compare Two Databases and Identify Differences sql Display SQL transformation statement output To specify how to display output for changed or missing rows use one of the following values with the format 264 option e grid default Display output in grid or table format like that of the mysql monitor e CSV Display output in comma separated values format e tab Display output in tab separated format e vertical Display output in single column format like that of the G command for the mysql monitor The changes for 263 option controls the direction of the difference by specifying the object to be transformed in either the difference report default or the transformation report designated with the difftype sql 264 option Consider the following command mysqldbcompare serverl root hostl server2 root host2 difftype sql db1 dbx The leftmost database db1 exists on the server designated by the server1 264 option host1 The rightmost database dbx exists on the server designated by the server2 264 option host 2 changes for server1 263 Produce output that shows how to make the definitions of objects on server1 like the definitions of the corresponding objects on server2 changes for server2 263 Produce output that shows how to make the de
568. ve or replace the files libglib 2 dylib libgmodule 2 dylib and libgthread 2 dylib on Mac OS X but the Oracle program might not operate properly or at all without the library This component is licensed under Section A 12 GNU Lesser General Public License Version 2 1 February 1999 A 11 Glitz License The following software may be included in this product Gilt Copyright 2004 David Reveman Peter Nilsson Permission to use copy modify distribute and sell this software and its documentation for any purpose is hereby granted without fee provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation and that the names of David Reveman and Peter Nilsson not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission David Reveman and Peter Nilsson makes no representations about the SUbieeloililwey Gye claws SOMEAWEUES TOE any PUrposSe TENS provided as is without express or implied warranty DAVID REVEMAN AND PETER NILSSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL DAVID REVEMAN AND PETER NILSSON BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLI
569. vent type 257 status status 258 and matching patterns pattern 257 Any of these search options can be combined and used together with the retrieved records resulting from all passed in options being true The pattern 257 supports two types of pattern matching standard SQL used with the SQL LIKE operator SQL patterns and standard REGEXP POSIX regular expression patterns This utility always requires an audit log file to be passed in so the AUD T_LOG_FILE argument is searched as a full path and file name for the audit log file If not specified a notification concerning this 254 mysqlauditgrep Allows users to search the current or an archived audit log requirement will be printed And if format 257 is passed in without search parameters then all the records of the audit log are displayed in the specified format The file stats 257 option is not considered a search criteria and is used to display the file statistics of a specified audit log Other search options will be ignored when the file stats 257 option is used except the format 257 option will continue to format the results accordingly To specify the format of the generated results use one of the following values with the format 257 option 1 GRID default Display output in grid or table format like that of the mysql monitor 2 CSV Display output in comma separated values format 3 VERTICAL Display output in sin
570. view of its objects by clicking the button to the left of the schema name Expand the tables list in the same way You can add tables to the EER canvas by dragging them from the Catalog panel dropping them onto the canvas Drop the address table and the city table onto the canvas Figure 8 47 Adding Tables to the Canvas address v address_id SMALLINT m city v address VARCHAR 50 city id SMALLINT address2 VARCHAR S0 city YARCHAR SO bi astri oe etry country_id SMALLINT cty Jd SMALLINT PEE last_update TIMESTAMP postal_code VARCHAR 10 gt phone VARCHAR 20 gt last_update TIMESTAMP gt gt MySQL Workbench automatically discovers that address city_id has been defined as a foreign key referencing the city city_id field Drop the count ry table onto the canvas and immediately you should see the relationship between the count ry table and the city table To view all the relationships in the sakila database see Figure 8 50 The sakila Database EER Diagram 157 Using the Default Schema Click the Properties tab of the panel on the lower right then click one of the tables on the canvas This displays the properties of the table in the Properties window While a table is selected you can use the Properties window to change a table s properties For example entering FF0000 for the color value will change the color accent to red Changing the color of a table is a good way
571. views triggers procedures functions and events A count for each object type can be shown with the vv option The check is performed using a series of steps called tests By default the utility stops on the first failed test but you can specify the run ali tests 264 option to cause the utility to run all tests regardless of their end state Note Using run ali tests 264 may produce expected cascade failures For example if the row counts differ among two tables being compared the data consistency will also fail The tests include the following 1 Check database definitions A database existence precondition check ensures that both databases exist If they do not no further processing is possible and the run all tests 264 option is ignored 2 Check existence of objects in both databases The test for objects in both databases identifies those objects missing from one or another database The remaining tests apply only to those objects that appear in both databases To skip 261 mysqldbcompare Compare Two Databases and Identify Differences this test use the skip object compare 264 option That can be useful when there are known missing objects among the databases Compare object definitions The definitions the CREATE statements are compared and differences are presented To skip this test use the skip diff 264 option That can be useful when there are object name differences onl
572. w Commercial Version 91 Modeling Menus 8 5 1 5 2 8 5 1 5 3 The Validation Submenus Commercial Version The Model menu has two validation submenus Validation and Validation MySQL Use these submenus for general validation and MySQL specific validation of the objects and relationships defined in your model Note R These items are not available in the MySQL Workbench OSS version The Validation submenu has these items e Validate All Performs all available validation checks e Empty Content Validation Checks for objects with no content such as a table with no columns e Table Efficiency Validation Checks the efficiency of tables such as a table with no primary key defined Duplicate Identifiers Validation Checks for duplicate identifiers such as two tables with the same name e Consistency Validation Checks for consistent naming conventions e Logic Validation Checks for example that a foreign key does not reference a nonprimary key column in the source table The Validation MySQL submenu has these items e Validate All Performs all available validation checks e Integrity Validation Checks for invalid references such as a table name longer than the maximum permitted e Syntax validation Checks for correct SQL syntax e Duplicate Identifiers Validation Additions Checks for objects with the same name For detailed information about validation see Section 8 10 MySQL Workbench Schema Validatio
573. ween different schemata Since layers are not schema objects no confirmation dialog box opens when you delete a layer regardless of how you have configured MySQL Workbench Deleting a layer does not delete schema objects from the catalog Adding Objects to a Layer To add an object to a layer drag and drop it directly from the Catalog palette onto a layer If you pick up an object from an EER diagram you must press Control as you drag it onto the layer otherwise it will not be locked inside the layer Locking objects to a layer prevents their accidental removal You cannot remove them by clicking and dragging to remove an object you also must press the Control key while dragging it As a visual cue that the object is being locked the outline of the layer is highlighted as the object is dragged over it If you drag a layer over a table object the table object will automatically be added to the layer This also works for multiple table objects Layers cannot be nested That is a layer cannot contain another layer object 8 7 5 2 Modifying a Layer Using the Properties Palette When you select a layer on the EER Diagram canvas its properties are displayed in the Properties palette The properties accessible from the Properties palette apply to the appearance of a layer on the EER Diagram canvas In some circumstances you may want to make a layer invisible Select the layer and in the Properties palette set the visib
574. y error messages than may have been generated Click the Hide Logs button to close the panel 136 Forward Engineering Figure 8 27 Message Log Reverse Engineer Database Connection Options r Reverse Engineering Progress Connect to DBMS Select Schemata The following tasks will now be executed Please monitor the execution Press Show Logs to see the execution logs Fetch Object Info Raye Sines Reverse Engineer Selected Objects Select Objects Place Objects on Diagram Reverse Engineer Operation Completed Successfully Finished parsing MySQL SQL script Message Log Started parsing MySQL SOL script Created MySQL Schema world Created MySQL Table world city Created MySQL Table world country Created MySQL Table world countrylanquage Created MySQL View world cityview Created MySQL Routine world FnGreeting Created MySQL Routine world country_hos Created MySQL Routine world world_record_count Finished parsing MySQL SQL script Totally processed statements successful 8 errors 0 warnings 0 If you wish to import an object with the same name as an existing object rename the existing object before reverse engineering If you import objects from more than one schema there will be a tab in the Physical Schemata section of the MySQL Model page for each schema imported You cannot reverse engineer a live database that has the same name as an existing schema If you wish to do this f
575. y forms with or without modification are permitted provided that the following conditions are met 344 Bitstream Vera License Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission HIS SO FTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTO ND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED IPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE RE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE IABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR ONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF UBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS NTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN ONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE BILITY OF SUCH DAMAGE RS AS IS TO THE Hey zZ POHNAH PR M O n n A 3 Bitstream
576. y provides a command line environment for running MySQL Utilities The mysqluc utility hence console allows users to execute any of the currently installed MySQL Utilities command The option ut ildir 831 is used to provide a path to the MySQL Utilities if the location is different from when the utility is executed The console has a list of console or base commands These allow the user to interact with the features of the console itself The list of base commands is shown below along with a brief description Command Description help utilities Display list of all utilities supported help lt utility gt Display hele Sor a scecitiic utility help help commands Snow Enis List exit quit Exit the console set lt variable gt lt value gt Store a variable for recall in commands show options Display list of options specified by the user on launch show variables Display list of variables lt ENTER gt Press ENTER to execute command lt ESCAPE gt Press ESCAPE to clear the command entry lt DOWN gt Press DOWN to retrieve the previous command lt UP gt Press UP to retrieve the next command in history lt TAB gt Press TAB for type completion of utility option or variable names lt TAB gt lt TAB gt Press TAB twice for list of matching type completion context sensitive One of the most helpful base commands is the ability to see the options for a given utility by typing help lt utility gt When the
577. y that you want to ignore Check table row counts This check ensures that both tables have the same number of rows This does not ensure that the table data is consistent It is merely a cursory check to indicate possible missing rows in one table or the other The data consistency check identifies the missing rows To skip this test use the skip row count 264 option Check table data consistency This check identifies both changed rows as well as missing rows from one or another of the tables in the databases Changed rows are displayed as a diff style report with the format chosen GRID by default and missing rows are also displayed using the format chosen To skip this test use the skip data check 264 option You may want to use the skip xxx options to run only one of the tests This might be helpful when working to bring two databases into synchronization to avoid running all of the tests repeatedly during the process Each test completes with one of the following states pass The test succeeded FAIL The test failed Errors are displayed following the test state line SKIP The test was skipped due to a missing prerequisite or a skip option WARN The test encountered an unusual but not fatal error The test is not applicable to this object To specify how to display diff style output use one of the following values with the difftype 264 option e unified default Display unified format outp
578. yet for Python v3 1 237 Introduction In this Manual you will find from an overview to a deep description of all the utilities and commands that are part of the MySQL Utilities 14 2 Introduction 14 2 1 Introduction to MySQL Utilities What are the MySQL Utilities It is a package of utilities that are used for maintenance and administration of MySQL servers These utilities encapsulate a set of primitive commands and bundles them so they can be used to perform macro operations with a single command They can be installed via MySQL Workbench or as a standalone package The utilities are written in Python available under the GPLv2 license and are extendable using the supplied library They are designed to work with Python versions 2 6 or later and there is no support yet for Python v3 1 How do we access the MySQL Utilities There are two ways to access the utilities from within the MySQL Workbench Either use Plugins Start Shell for MySQL Utilities from the main Workbench toolbar or click the MySQL Utilities icon from the main Workbench page Both methods will open a terminal shell window and list the available commands Figure 14 1 Starting MySQL Utilities from Workbench amp MySQLWorkbench File Edit View Database Plugins Scripting Community Help e00 Start Shell for MySQL Utilities o amp Y Workbench Central ve Welcome to MySQL Workbench By gog Jg lt a age What s New in This
579. ying HumanResources EmployeeDepartmentHistory DATA MIGRATION Data Transfer Setup Bulk Data Transfer REPORT Migration Report Migration Wizard was started Migration Report And finally the migration report is available and summarizes the entire migration process 211 Migrating from supported databases 11 2 2 Figure 11 17 MySQL Workbench migration Migration Report iL Worki SQL Editor Local instance MyS Migration Xx File Edit View Database Plugins Scripting Help Migration Task List OVERVIEW Q Overview SOURCE amp TARGET Source Selection Target Selection Fetch Schemata List Y Schemata Selection Y Reverse Engineer Source OBJECT MIGRATION Y Source Objects Y Migration Manual Editing MigrationReport Date Thu Oct 11 11 23 31 2012 Source Microso Serve I Migration 1 Summary Number of migrated schemata 1 1 HumanResources Source Schema HumanResources Target Creation Options Y Create Schemata Y Create Target Results DATA MIGRATION Data Transfer Setup 2 Migration Issues Bulk Data Transfer 7 lame note Collation Latin1_General_CS_AS migrated to utf8_general_ci GroupName note Collation Latini_General_CS_AS migrated to utf8_general_d te jal note Default value is getdate so type was changed from DATETIME to TIMESTAMP NationalIDNumber note Collation Latin1_General_CS_AS migrated to utf8_general_c LoginID note Collation Latin1_General_CS_AS
580. ype Comment SMALLMONEY DECIMAL CHAR CHAR LONGTEXT Depending on its length MySQL Server 5 5 and above can have CHAR columns with a length up to 255 characters Anything larger is migrated as LONGTEXT NCHAR CHAR LONGTEXT Depending on its length MySQL Server 5 5 and above can have VARCHAR columns with a length up to 65535 characters Anything larger is migrated to one of the TEXT blob types In MySQL character set of strings depend on the column character set instead of the datatype VARCHAR VARCHAR Depending on its length MySQL Server 5 5 MEDIUMTEXT and above can have VARCHAR columns with a LONGTEXT length up to 65535 characters Anything larger is migrated to one of the TEXT blob types NVARCHAR VARCHAR Depending on its length MySQL Server 5 5 MEDIUMTEXT and above can have VARCHAR columns with a LONGTEXT length up to 65535 characters Anything larger is migrated to one of the TEXT blob types In MySQL character set of strings depend on the column character set instead of the datatype DATE DATE DATETIME DATETIME DATETIME2 DATETIME Date range in MySQL is 1000 01 01 00 00 00 to 9999 12 31 23 59 59 Note fractional second values are only stored as of MySQL Server 5 6 4 SMALLDATETIME DATETIME DATETIMEOFFSET DATETIME TIME TIME TIMESTAMP TIMESTAMP ROWVERSION TIMESTAMP BINARY BINARY Depending on its length MEDIUMBLOB LONGBLOB VARBINARY VARBINARY Depending on its length MEDIUMBLOB LONGBLOB TEXT VARCHAR Depending on its length
581. yright notice and this permission notice shall be included in all copies or substantial portions of the Software HE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR MPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS R COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY HETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE G val S fa Scintilla includes some files copyright Apple Computer Inc Disclaimer IMPORTANT This Apple software is supplied to you by Apple Computer Inc Apple in consideration of your agreement to the following 374 ScintillaNET License terms and your use installation modification or redistribution of this Apple software constitutes acceptance of these terms If you do not agree with these terms please do not use install modify or redistribute this Apple software In consideration of your agreement to abide by the following terms and subject to these terms Apple grants you a personal non exclusive license under Apple s copyrights in this original Apple software the Apple Software to use reproduce modify and redistribute the Apple Software with or without modifications in source and or binary forms provided that if you redistribute the
582. ys generates a new selection To drag multiple objects from the Catalog Tree to the EER diagram canvas you must perform the operation as follows 1 Click the first item in the tree 2 Hold the Shift key click the last item and do not release the Shift key 3 Keep the Shift key depressed and commence the dragging operation 4 Release the Shift key before you release the mouse button to drop selected objects onto the canvas This procedure also applies to use of the Control key when selecting multiple nonadjacent elements in the Catalog Tree You can toggle the sidebar on and off using the Toggle Sidebar button which is located in the top right of the application 8 5 11 The Layers Palette 8 5 11 1 This palette shows all the layers and figures that have been placed on an EER diagram If a layer or figure is currently selected an X appears beside the name of the object and its properties are displayed in the Properties palette This can be especially useful in determining which objects are selected when you have selected multiple objects using the various options under the Select menu item For more information on this topic see Section 8 5 1 2 The Edit Menu Selecting an object in the Layers palette also adjusts the view port to the area of the canvas where the object is located Finding Invisible Objects Using the Layers Palette In some circumstances you may want to make an object on an EER diagram invisible Select

Download Pdf Manuals

image

Related Search

Related Contents

when ordering parts, be sure to state serial  Scheda tecnica accessorio Estro DF  COLT TWIN - Pride Mobility Products  User manual for CaneLCA Eco-efficiency Calculator V1.01  fitxa salquisa 2007 acaricidas ok.FH10    Samsung WW85J5410GX User Manual  DEVG - Senior Design  9U MTCA.4 Shelf    

Copyright © All rights reserved.
Failed to retrieve file