Top Banner
Overview of User Interfaces Saturday, 30 January 2010 09:56 MySQL provides three main GUI client programs for use with MySQL Server. The manuals for these GUI tools are available online . - EMS SQL Manager for MySQL is a high performance tool for MySQL database administration and development. - SQL Maestro for MySQL Overview : is the premier MySQL admin tool for MySQL database management, control and development. - SQLyog MySQL GUI is the most powerful MySQL manager and admin tool, combining the features of MySQL Query Browser, Administrator, phpMyAdmin and other MySQL Front Ends and MySQL GUI tools in a single intuitive interface. - MySQL Query Browser : This graphical tool is used for creating, executing, and optimizing queries on MySQL databases. - MySQL Administrator : This tool is used for administering MySQL servers, databases, tables, and user accounts. - MySQL Migration Toolkit : This tool helps you migrate schemas and data from other relational database management systems for use with MySQL. - Other MySQL GUI Tools In addition, we will also explore the popular phpMyAdmin tool. Establishing a Connection Before using MySQL Administrator and the Query Browser, we must establish a connection to the correct MySQL server (and schema). The following information is required to make a connection: 1 / 16
16

Overview of User Interfaces - MySQL Tools

Feb 03, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

MySQL provides three main GUI client programs for use with MySQL Server. The manuals forthese GUI tools are available online .

- EMS SQL Manager for MySQL is a high performance tool forMySQL database administration and development. - SQL Maestro for MySQL Overview : is the premier MySQL admin tool for MySQLdatabase management, control and development. - SQLyog MySQL GUI is the most powerful MySQL manager and admin tool, combining the features of MySQL Query Browser, Administrator, phpMyAdmin and otherMySQL Front Ends and MySQL GUI tools in a single intuitive interface. - MySQL Query Browser: This graphical tool is used for creating, executing, and optimizingqueries on MySQL databases. - MySQL Administrator: This tool is used for administering MySQL servers, databases,tables, and user accounts. - MySQL Migration Toolkit: This tool helps you migrate schemas and data from otherrelational database management systems for use with MySQL. - Other MySQL GUI Tools

In addition, we will also explore the popular phpMyAdmin tool.

Establishing a Connection

Before using MySQL Administrator and the Query Browser, we must establish a connection tothe correct MySQL server (and schema).

The following information is required to make a connection:

1 / 16

Page 2: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

- STORED CONNECTION: Under Windows, you can give a preconfigured connectionname, containing often used connection parameters, saving typing every time. - On Linux - After giving all additional parameters, you choose from a list box the entrySAVE THIS CONNECTION. Then a dialog appears in which you can give the connection aname. - SERVER HOST: Network host name or IP of the computer on which the MySQL serveris running. If it is a local computer, use localhost. - PORT: By default, the connection takes place via the TCP/IP protocol, where the MySQL default port 3306 is used. Use another port number if MySQL server is configured to use one. - USERNAME AND PASSWORD: MySQL user name and the associated password. Thepassword is not stored with connection data for reasons of security and must be supplied eachtime. - DEFAULT SCHEMA (Query Browser): Name of the database on which you'll executeSQL commands. You may leave the field empty and choose a database later with FILE |CHANGE DEFAULT SCHEMA. - DETAILS: In rare cases it is necessary to input optional connection parameters in this field. If the MySQL server is configured without TCP/IP for security reasons, under Windowsenter the name of the Named Pipe; under Linux, enter the file name of the Socket File.

You can store often-used connection parameters into predefined connection settings, asshown:

MySQL Query Browser

2 / 16

Page 3: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

The main purpose of the MySQL Query Browser is to help you in composing and testing SQLcommands. Additionally, the program offers some auxiliary functions: you can insert data intotables, alter data in tables, test regular expressions (for the SQL operator REGEX), readMySQL help texts, etc.

To become familiar with the MySQL Query Browser, input a simple SQL command. SQLkeywords are shown automatically in color. Execute the command with the EXECUTE button.

The first window in Query Browser provides you the capability of writing your scripts and seeing the results in the window. You can manage your schemas, manage users, etc.

Query browser is divided into many sections for achieving these tasks.

1. Query Area - This area allows for inputting your desired query. 2. Result Area - This area shows the results after the query is executed. 3. Query Toolbar - Basic buttons for executing queries. 4. Advanced Toolbar - Contains transaction buttons like Start, Commit, Rollback, QueryBuilding buttons like Select, From, Where, Group Byand other operations. 5. Object Browser - View databases, tables, views, bookmarks, and history. 6. Information Browser - Part of the sidebar to look up syntax, built-in functions,parameters, etc 7. Edit/Navigation Bar - Bottom bar to go into Edit mode and navigate the result set.

Keyboard Shortcuts

A few keyboard shortcuts make using the MySQL Query Browser more efficient andconvenient:

- Ctrl+Return executes the current SQL command (like EXECUTE). - Ctrl+Shift+Return executes the command but shows the result in a new dialog sheet.This has the advantage that the results of previous commands remain available. - F11 changes the arrangement of the individual windows and enlarges the input region

3 / 16

Page 4: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

for SQL commands. This makes it easier to enter long SQL commands. If you press F11 again,the standard layout is restored. - F12 closes the individual windows except for the current result region. This makes iteasier to read extensive results. Pressing F12 again restores the original window layout.

Main Query Window

This window allows for input and execution of SQL Commands. One can type in a query, buildit using buttons, or open a saved query from files as shown:

Execute the query and see results:

Query Toolbar

4 / 16

Page 5: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

This toolbar contains some query and navigation related buttons.

The simplest way to use Query Browser is to write in a query into the SQL Query Area andclick the Executebutton. The navigation buttons are a great help in browsing through the history of your queries.If the query succeeds, the results are available in the currently active result area.

Result Area

The following image shows the view of the Result Area from a query:

All query results are displayed in the result area. Within this area you can use multiple tabs. Individual result areas can be split either vertically or horizontally. New tabs can be created either by choosing the Execute in New Tab option on the query bar or by clicking the New Tabbutton at the top of the result area. In addition, you can also right-click on the current result

5 / 16

Page 6: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

area and choose the Add New Tabsheet (Ctrl+T) option. The result sets of some queries donot display well in the Results Area.

For a better view of the results of such queries, right-click the row you wish to view and choose the View Field in Popup Editor option from the menu. The result area can be used to review and edit the results of a query, with editing permitted as long as the query is based on a single table and there is sufficient key information to uniquely identify rows.

Advanced Toolbar

A view of the Advanced Toolbar to form a query:

This area contains a set of buttons for transaction control, query management, and querybuilding.

The left panel of the Advanced Toolbar contains the transaction control buttons. The buttons allow you to start, commit, and roll back a transaction. The center panel provides buttons forquery management. The Explain button can be used to get the EXPLAIN output for the currentquery from the MySQL server. The next panel contains the query building buttons to build aquery visually by clicking on the tables and columns that you wish to involve in your query.

The next panel contains the query building buttons. You can use these buttons to build a query visually by clicking on the tables and columns that you wish to involve in your query, using specialized mouse pointers to indicate which part of the query the different fields and tables occupy. The right most panel contains the Create View button, that allows for creating a viewfrom the current query.

SQL Commands with Mouse Clicks

6 / 16

Page 7: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

Using various arrow buttons of the Toolbar, you can assemble SQL commands with minimaltyping effort. The following click sequences provide an example:

- Click on the button SELECT. - Expand table film to see its columns. - Click on the columns title, rating, and rental_rate of the film table. - Click on the button WHERE. - Click on the column film_id of the film table. - Type in =101 (for the WHERE condition) from the keyboard. - Click on the button ORDER. - Click on the column title of the film table.

Note: If you do not see SELECT buttons, click on the menu option VIEW and select MaximizeQuery Edit or press F11.

From the mouse clicks (and minimal typing) above, the MySQL Query Browser forms thefollowing command:

SELECT f.`title`, f.`rating`, f.`rental_rate` FROM film fWHERE f.`film_id`=101 ORDER BY f.`title` - f is an alias for the flim table. MySQL Query Browser does not use the optional AS. - Execute: Click on the EXECUTE button or hit Ctrl+Enter to run the SQL statement andsee its results. - Save: Select FILE | SAVE AS from the menu to save the query to a file. - Exporting results: With FILE | EXPORT RESULTSET you can export the most recentresult of SELECT commands in the formats CSV, HTML, XML, and Excel. - View BLOBs: The content of BLOB columns are not displayed by default. You can viewBLOB data in a separate editor window, even dump the blob to a file.

- Explain Query: The button EXPLAIN gives internal, execution-related information about

7 / 16

Page 8: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

the planned execution of the most recent SQL command by MySQL. The meaning of variousaspects of the Explain Plan is discussed in another lesson.

- Updating Data: We can execute UPDATE, INSERT, DELETE, and other data alteringcommands. - Transactions: With InnoDB tables, we can execute transaction-oriented commands viabuttons for START TRANSACTION | COMMIT | ROLLBACK. - Refresh: In a multi-session, multi-user situation, the displayed result set may be refreshedto get the latest matching rows. - Multiple Result Regions: With FILE | NEW QUERY TAB you open an additional SQL inputfield and result region. In this way you can test several SQL commands in parallel.

History and Bookmarks for SQL Commands

The MySQL Query Browser stores all executed SQL commands automatically in a History List, available in the sidebar to the right of the window. With drag and drop you can move thecommand into the input region and execute it with a double click.

8 / 16

Page 9: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

You can give frequently used statements a Caption with Ctrl+B and store them in the bookmarklist. The list of Bookmarks is available in the sidebar:

Using Scripts: Executing Several Commands

Open a SQL script input area with FILE | NEW SCRIPT TAB. There you can specify severalSQL commands separated by semicolons. You can then execute these commands all at once(EXECUTE button) or step by step (SCRIPT menu).

These scripts represent several ordinary SQL commands, not stored procedures. Thecommands can be stored as a *.sql file using the FILE menu. The history and bookmarkfunctions, however, are not available.

MySQL Help - Information Browser

The MySQL Query Browser can also be used for reading MySQL help. The help texts are accessible via the lists SYNTAX and FUNCTIONS in the sidebar. These are extracts from the online documentation.

9 / 16

Page 10: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

The Information Browser provides access to all information that is not directly related to actual data within your database. - The Syntax Browser - A convenient reference to MySQL query syntax, it is your quickhelp in finding the correct syntax for building up the queries. - The Function Browser - The Function Browser is a quick reference to the variousfunctions built into MySQL. - The Parameter Browser - The Parameter Browser provides different local, global, anddynamic parameters that can help build your queries. - Local parameters affect the query in the current query window only. - Global parameters affect all queries. - Dynamic parameters are generated automatically from existing queries. - The Transaction Browser - A single transaction could be made up of many queries. TheTransaction Browser lists all queries that make up a single transaction and serves as a historyfor a single transaction. Object Browser

In the Object Browser, you can view the databases and their various components in a nestedtree-style.

- Database Browser - The Database/schemata Browser is the primary screen of theObject Browser. You can use the Database Browser to select tables and fields, edit tables,create new tables and databases, and drop tables and databases. The Database Browser canbe used to set the default database, which is required before you can issue queries againsttables. - Result Browser - You can place your more commonly used queries in bookmarks so thatyou can quickly retrieve them and re-use them later. To add a query to your bookmarks,highlight and drag it from the query area into the bookmark browser. Your bookmarks can beorganized into folders and subfolders to help with management of your queries. The Bookmark Browser is one of a number of XML files use for internal purposes by the Query Browser. - The History Browser - With the History Browser you can browse through all the queriesyou have previously issued. You can create bookmarks from history items by right-clicking ona selected history item and choosing the Add History Item as Bookmark menu option.

10 / 16

Page 11: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

The Script Editor

This is the area where your current script is being edited.

The Script Editor displays within an individual tab and allows for execution of a script containingmultiple statements.

The Script Debugging Buttons

The following buttons are available when using the Script Editor:

- Execute: Execute the script from the beginning to the end of the script. - Continue: Execute the script from the current position or beginning and stop for errors orbreak points. - Step: Continue executing the next statement; functions will be executed but not steppedinto. - Pause: Pauses script execution and highlights on the next statement to be executed. - Stop: Terminate execution of the script.

Changing Data in SELECT Results

With simple SELECT queries containing data from only one table (no JOINs) and without GR

11 / 16

Page 12: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

OUP BYor aggregation functions, the results can be changed. To do so, click on the EDIT button at thebottom of the table. This button is available only for results that can be changed.

To edit the contents of the result area you must enable edit mode through the use of the Edit button at the bottom of the result area. Any edits you make are not immediately applied, butinstead you need to click the Apply Changes button next to the Edit button. Clicking theDiscard Changes button throws away any changes you have made to the data.

To change a table field, you must activate it with a double-click. You simply add new records to the end of the table. To delete a record (a row), execute DELETE ROWS with the right mousebutton. Changes take effect only after you click the button APPLY CHANGES.

Stored Procedures

The MySQL Query Browser makes available a number of elementary functions for input ofstored procedures, which are functions composed of several SQL commands that arecontrolled directly by the MySQL server. Stored procedures are a characteristic of the MySQL server, while scripts belong to the MySQL Query Browser. We will discuss stored procedures in greater detail in a later lesson.

MySQL Administrator

12 / 16

Page 13: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

While the MySQL Query Browser helps in assembling and trying out SQL commands, theMySQL Administrator helps with administrative tasks related to management of a MySQLserver. The various operations one can perform using the Administrator are covered in a laterlesson.

One common task you may perform with the Administrator is adding users to schemas. Or, youcan view the health and general statistics of the server:

MySQL Migration Toolkit

Organizations around the globe increasingly view MySQL as a viable, cost-efficient alternativeto the expensive databases that have drained corporate budgets for years. Yet the cost andeffort needed to move existing and generally large data stores can be daunting anddiscouraging.

The MySQL Migration Toolkit provides a well-planned wizard that can provide valuablemigration assistance by accelerating and streamling the process while reducing problems andissues.

Presently, the MySQL Migration Toolkit is able to handle migrating the majority of schemas anddata from Oracle, Microsoft Access, Microsoft SQL Server, Sybase and MaxDB. In addition,you can also migrate data from any database supporting a standard JDBC driver.

13 / 16

Page 14: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

A Brief Overview of the Migration Process

According to MySQL documentation, migrating data from an external relational databasemanagement system to MySQL is outlined as an eight-step process as shown:

The Migration Process

The Migration View:

1. Source/Target Selection: Specify the connection parameters for the source and target database servers. 2. Object Selection : Select the objects (tables, views, stored procedures) that will be migrated. 3. Object Mapping : Choose the method used for mapping and transforming the objects. 4. Manual Editing : Manually edit the new objects to ensure a proper transformation. 5. Schema Creation : The MySQL Migration Toolkit physically creates the transformed object on the target MySQL server. 6. Data Mapping : Convey any changes that need to be made to the data as it is migrated. 7. Bulk Transfer : The MySQL Migration Toolkit transfers the data from the source server to the target server. 8. Summary (Final step) : MySQL Migration Toolkit generates a summary report of the migration process for review.

phpMyAdmin

Although not a product offered by MySQL, phpMyAdmin is such a valuable administration toolthat it certainly bears mentioning here. A web-based MySQL administration application writtenin PHP, phpMyAdmin is used by thousands of developers and is practically a staple amongweb hosting providers around the globe. It's not only very stable (it has been in developmentsince 1998), but also feature-rich thanks to an enthusiastic development team and usercommunity.

14 / 16

Page 15: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

phpMyAdmin is a PHP-based tool to perform the administration of MySQL over the Web. It canbe used to create/drop databases, create/drop/alter tables, delete/edit/add fields, execute aSQL statement, define keys, manage privileges, and export data into various formats.

phpMyAdmin offers a number of compelling features:

-

phpMyAdmin is browser based, allowing you to easily manage remote MySQL databases fromanywhere you have access to the web. SSL is also transparently supported, allowing forencrypted administration if your server offers this feature.

-

Administrators can exercise complete control over user privileges, passwords, and resourceusage, as well as create, delete, and even copy user accounts.

-

Real-time interfaces are available for viewing uptime information, query and server trafficstatistics, server variables, and running processes.

-

Developers from around the world have translated phpMyAdmin's interface into 50 languages,including English, Chinese (traditional and simplified), Arabic, French, Spanish, Hebrew,German, and Japanese.

-

phpMyAdmin offers a highly optimized point-and-click interface that greatly reduces thepossibility of user-initiated errors.

15 / 16

Page 16: Overview of User Interfaces - MySQL Tools

Overview of User InterfacesSaturday, 30 January 2010 09:56

phpMyAdmin is released under the GNU General Public License. The official phpMyAdminweb site offers sourcedownloads, news, mailing lists, a live demo, and more.

User Interfaces MySQL Conclusion

In this lesson of the MySQL tutorial, we learned about various user interfaces that can be usedfor querying, managing, importing and exporting data in MySQL.

To continue to learn MySQL go to the top of this page and click on the next lesson in thisMySQL Tutorial's Table of Contents.

16 / 16