Practice
Windows users are close to and fond of the graphical interface (GUI). It's not alien to *nix users either, to be fair, but we're used to seeing servers as text consoles (the core installation of Windows Server 2008, by the way, is not an analog of the Unix text console - it's basically just a GUI with a CMD stretched over it, when you get down to it).
Despite the fact that many MySQL administrators handle this server just fine from the command line, or if not, then through phpmyadmin, on Windows you'll probably want to see something resembling SQL Server Management Studio or Enterprise Manager.
MySQL developed such a utility and makes it available to Windows users (and not only them). For free, of course.
So, we open the site www.mysql.com, go to the "Downloads" section and click the "Download" link under the "MySQL Workbench (GUI Tool)" heading. On the page that opens we pick the option we need (I recommend MSI) and download it.
Yes, it's only available as x86-32 (32-bit), but this utility's functionality has been tested on Windows Server 2008 R2 (which, as you know, is natively 64-bit) - everything works.
Installation
To install this utility you need the .NET Framework 4 Client Profile. Don't worry - that's not the whole .Net Framework 4 - you won't have to install that whole beast. The utility gets by with Framework 3.5
You can download and install the Client Profile from here:
http://www.microsoft.com/downloads/ru-ru/details.aspx?FamilyID=e5ad0459-cbcc-4b4f-97b6-fb17111cf544
After installing the Client Profile - run the Workbench installer. The installation is as simple as it gets - a couple of questions, one of which is where it should actually be installed, and then we have a working utility for managing MySQL.
First steps
If you've worked with Enterprise Manager in SQL Server 2000 or SQL Management Studio in SQL Server 2005/2008+, then the gist of the work will be more or less clear to you.
After launching, you'll immediately see a locally connected MySQL server. You log in as the root user. Naturally, you need to know this user's password (the equivalent of sa in MS SQL).
You see three large areas - from left to right:
a) Server database management
b) EER modeling
c) Administration (start/stop/status, users, etc.)
To connect to the console you need - click on the server's name in that console and enter the password of the user you're logging in as.
Footnote. In the database management console you won't see the system databases. They're hidden. Only user databases will be visible.
At the top you can see a panel with tabs. It shows the open windows (i.e. you can open several windows at once, for example, working with several database consoles from different servers).
To connect to other (non-local, for example) database servers you need to create "connections" via "New connection" for the database management console or "New server instance" for the administration console.
You can manage existing connections (for example, change the address, port, user, etc.) via "Manage Connections" or "Manage server instances" respectively.
Administration
Clicking on the server you need (let's start, of course, with "localhost") in the 3rd panel on the "home" tab and entering the password for root, we end up in the server administration panel.
On the "Server Status" page we see the server's current status: resources consumed, the status (I almost said "daemon"...) of the service, current connections to the server, etc.
Startup/Shutdown: Accordingly, on this page we can stop the server or start it up again.
Status and system variables: Here we can look inside the server's state in real time.
Server logs: If the logs are configured to be shown in a table, they'll be visible here. But if the logs are being written to a file - too bad, the console won't show them.
Options file: Without digging into the my.cnf file or its equivalent on this MySQL installation, we can easily manage options right from here - from the graphical interface. The "Apply" button in the bottom right is used to save changes. Don't forget that the server requires a restart (the MySQL server, not Windows Server) for the changes to take effect.
Users and privileges: From here we manage the users of this server. From here we create them, allow them to work with one database or another, create other users, delete them, and assign passwords.
Data export and restore: Essentially, this is a backup or database migration tool. From here we can export or import selected databases to/from a file.
Managing databases (SQL Editor)
Having selected the server we need in the leftmost panel, we end up in the database management console.
From here we can create, modify and delete databases, tables, records in tables, stored procedures and views.
Reminds you a bit of Microsoft's SQL Management Studio, doesn't it?
Databases in Workbench are called Schema. Initially the list of schemas is empty - system databases aren't shown to administrators of the graphical utility (unlike the text console, where system databases can be managed just like regular ones... which, of course, can lead to trouble).
The "Add schema" item is used to create a database. Clicking it takes you to the database creation window, where you'll be asked the standard questions - database name, collation (comparison), encoding.
After creation, the schema will appear in the list of schemas. To select it - double-click on it. The triangle to the left of the name lets you "expand" the schema and see its contents.
The "Add table" item is used for adding a table. The schema must already be selected. Clicking it opens the table creation window in front of you. It's noticeably more packed with options than the database creation window. Here you're asked to set the table name, its structure, key fields, indexes, etc.
Through "Add view" we can, accordingly, create a table view.
"Add routine" gives us the ability to create a stored procedure for this database.
All the elements of a database become visible once you click the triangle to the left of its name in the list. From here we can see the tables, views and stored procedures (Tables, View and Routines respectively). Right-clicking on an element gives you a list of actions you can perform on it. For example, for a table you can choose to view the first 1000 records (Select rows - Limit 1000), call up the table editor to change data in it (Edit table rows), copy some of the table's data to the clipboard (Copy to clipboard), open some data in the built-in SQL editor (Send to SQL Editor), or create a new table, modify this one, or delete it.
Learning by doing
This topic isn't meant to be a manual for Workbench - it's just written as an answer to the question "Is there a GUI for MySQL, and what tool is it". Working with Workbench is quite simple and intuitive (for someone familiar with technical English and MySQL in general, of course). So - I'll pass the baton to you. The tool, as I already said, is easy to learn.
Applies to: MySQL + Windows (Server)
Comments