Complete database administration package MySQL Workbench
Recently I covered the MySQL GUI tool MySQL Administrator (see the article "Create a database with MySQL Administrator"). However, this tool was just given the official EOL (End of Life) announcement by the MySQL dev team. Although this is sad news for a tool that had recently become my standard for working with databases, this death knoll has lead me to another, even better, tool MySQL Workbench.
MySQL Workbench replaces all of the MySQL GUI tools, adds numerous power-user features, and wraps them up into a tool that any DBA (data base administrator) will be drooling over. This tool is not just about power, it's also about being one of the best cross-platform, visual database design tools around. And even in beta release, the MySQL Workbench shows it might well succeed in that quest.
In this article I will introduce you to this tool. You will see how MySQL Workbench is install as well as how to connect to a server and create a database.
You will not find the beta version of MySQL Workbench in your repositories. Instead you will have to download the necessary installation package from the Workbench download page. From that page you can select from the following platforms:
- Mac OSX
You can also download the source code and install from that method. Download your preferred file and install the package. Be careful. If you are installing on Ubuntu 9.10 you will want to click on the Development Releases tab and download the latest version. I installed version 5.2.11 and had great success on 9.10. The stable release, however, wasn't so successful (it would install but couldn't connect to the necessary mysqlclient libraries). You might also find that, to install the development release on Ubuntu 9.10, you will have to also install python-paramiko and python-pexpect. Both of these can be found within Synaptic.
Starting the workbench
Once installed, you will find the MySQL Workbench located (at least in GNOME) in the Programming sub-menu of the Applications menu. When you first start the workbench you will see the very well laid out home screen (see Figure 1). From the first look it is obvious we are dealing with a serious dba tool.
The first thing that you must do is open a connection to your database server. For simplicity's sake I am going to demonstrate connecting to localhost.
To do this click the New Connection link, which will bring up a the DB Connections Manager (see Figure 2). Since this will be a localhost connection, the only thing you should have to edit is your root user password. Remember, this is the MySQL administrator password (not your system admin password). Before you click OK it is best to click the Test Connection button. This way you will know, immediately, if your connection is successful. When you see that it is successful, click the OK button to make the connection and dismiss the window.
The next step is to double-click on the new connection you just made (listed in the Open Connection... window in the main window). When you double click the target connection the SQL Editor will open in a new tab (see Figure 3). When this tab opens you will see all of the current databases listed in the tabs in the lower pane. If you click on a database (Schema) you will see all tables included on that database.
To create a new database all you have to do is click on the "+" symble in the upper right corner of the lower left pane. When you click this a new window will open where you have to enter the following information:
- Name: Give the db a name.
- Default Collation: What is the default character set used. For example: A Drupal database uses utf8_general_ci.
- Comments: (Optional) Any comments you want to add to the db.
When you finish entering the information click Apply which will then open yet another window. This next window displays the SQL statement to be executed. You can review that statement and make changes if necessary. If the statement is correct click Apply Changes to create the database.
You might not see the database appear in the lower pane immediately. You might have to close the SQL Editor tab and then re-open the connection to see your new database.
We've just scratched the surface on a tool that will serve all of your MySQL database needs from now until this tool sees its EOL (which hopefully won't be for a long, long time). The MySQL developers have really scored big with this tool.Advertisement