Administrator MySQL
Administrator MySQL
MySQL Administrator
Copyright © 2004 MySQL AB
Abstract
• Conversion to other formats is allowed, but the actual content may not be altered or edited in any way.
• You may create a printed copy for your own personal use.
• For all other uses, such as selling printed copies or using (parts of) the manual in another publication, prior written agreement
from MySQL AB is required.
Please email docs@mysql.com for more information or if you are interested in doing a translation.
Table of Contents
1. Introduction to MySQL Administrator ......................................................................... 1
2. Installing MySQL Administrator ................................................................................ 2
2.1. Introduction ................................................................................................. 2
2.2. Installing Under Windows .............................................................................. 2
2.3. Installing Under Linux ................................................................................... 2
2.4. Installing Under Mac OSX .............................................................................. 3
3. Starting MySQL Administrator .................................................................................. 4
3.1. Introduction ................................................................................................. 4
3.2. Connection Dialog ......................................................................................... 4
3.3. Configure-service Mode ................................................................................. 5
4. Main Window ......................................................................................................... 8
4.1. Introduction ................................................................................................. 8
4.2. Sidebar ........................................................................................................ 8
4.3. Working Area ............................................................................................... 9
4.4. Menus ....................................................................................................... 10
4.4.1. File ................................................................................................ 10
4.4.2. Edit ................................................................................................ 10
4.4.3. View .............................................................................................. 10
4.4.4. Tools .............................................................................................. 10
4.4.5. Help ............................................................................................... 11
5. Server Information ................................................................................................. 12
6. Service Control ..................................................................................................... 13
6.1. Introduction ............................................................................................... 13
6.2. Start/Stop Service ........................................................................................ 13
6.3. Configure Service ....................................................................................... 13
7. Startup Variables ................................................................................................... 16
7.1. Introduction ............................................................................................... 16
8. Server Connections ................................................................................................ 17
8.1. Introduction ............................................................................................... 17
8.2. Threads ..................................................................................................... 17
8.3. User Connections ........................................................................................ 17
9. User Administration ............................................................................................... 18
9.1. Introduction ............................................................................................... 18
9.2. User Accounts ............................................................................................ 18
9.3. User Information ......................................................................................... 20
9.4. Global Privileges ......................................................................................... 21
9.5. Schema Privileges ....................................................................................... 22
9.6. Table Column Privileges ............................................................................... 22
10. Health ................................................................................................................ 23
10.1. Introduction .............................................................................................. 23
10.2. Connection Health ..................................................................................... 23
10.3. Memory Health ......................................................................................... 23
10.4. Creating Custom Health Graphs ................................................................... 24
10.5. Status Variables ........................................................................................ 26
10.6. System Variables ....................................................................................... 26
11. Server Logs ........................................................................................................ 28
11.1. Introduction .............................................................................................. 28
11.2. Error Log ................................................................................................. 29
11.3. Slow Log ................................................................................................. 29
11.4. General Log ............................................................................................. 29
12. Backup .............................................................................................................. 30
12.1. Introduction .............................................................................................. 30
12.2. Backup Project .......................................................................................... 30
iv
MySQL Administrator
v
MySQL Administrator
vi
List of Figures
3.1. Connection dialog ................................................................................................. 4
3.2. Switching to configure-service mode ........................................................................ 6
3.3. Configure-service mode .......................................................................................... 6
4.1. MySQL Administrator main window ........................................................................ 8
4.2. Marked area between sidebar and working area ........................................................... 9
9.1. User accounts ..................................................................................................... 18
9.2. User Information tab ............................................................................................ 20
10.1. The Graph Settings dialog ................................................................................... 24
11.1. Displaying entries from the middle of the General Log ............................................. 28
13.1. The Restore Content tab ...................................................................................... 34
14.1. The Replication Status section .............................................................................. 35
16.1. The MySQL Table Editor .................................................................................... 39
16.2. The column editor .............................................................................................. 40
16.3. The index editor ................................................................................................ 41
16.4. The Confirm Table Edit dialog ............................................................................. 43
17.1. Options dialog .................................................................................................. 45
17.2. Options dialog: Connections ................................................................................ 46
A.1. The MySQL System Tray Monitor ......................................................................... 51
C.1. Error message dialog ........................................................................................... 59
vii
Chapter 1. Introduction to MySQL
Administrator
MySQL Administrator is a program for performing administrative operations, such as configuring your
MySQL server, monitoring its status and performance, starting and stopping it, managing users and con-
nections, performing backups, and a number of other administrative tasks.
You can perform most of those tasks using a command line interface such as that provided by mysql-
admin [http://dev.mysql.com/doc/mysql/en/mysqladmin.html] or mysql
[http://dev.mysql.com/doc/mysql/en/mysql.html], but MySQL Administrator is advantageous in the fol-
lowing respects:
• It provides a better overview of the settings that are crucial for the performance, reliability, and se-
curity of your MySQL servers.
• It displays performance indicators graphically, thus making it easier to determine and tune server
settings.
MySQL Administrator is designed to work with MySQL servers versions 4.0 and higher.
MySQL Administrator is to a large extent the result of feedback MySQL AB has received from many
users over a period of several years. However, if you find it's lacking some feature important to you, or
if you discover a bug, please use our MySQL Bug System [http://bugs.mysql.com] to request features or
report problems.
1
Chapter 2. Installing MySQL
Administrator
2.1. Introduction
MySQL Administrator runs on Windows, Linux, and Mac OSX. You can find MySQL Administrator
for the operating system of your choice on the MySQL Downloads
[http://dev.mysql.com/downloads/administrator/] page.
MySQL Administrator is installed through the use of a Windows Installer (.msi) installation package,
which can be used to install the MySQL Administrator on all Windows operating systems. The MSI
package in contained within a ZIP archive named mysql-administrator-version-win.msi,
where version indicates the MySQL Administrator version.
The Windows Installer engine was updated with the release of Windows XP; those using an older ver-
sion can reference this Microsoft Knowledge Base article
[http://support.microsoft.com/default.aspx?scid=kb;EN-US;292539] for information on upgrading to the
latest version.
To install MySQL Administrator, right-click on the MSI file and select Install. The installation will be-
gin automatically after the installer prompts you for your installation preferences. During installation,
you can choose if you want the installer to place a shortcut in the Start menu, and/or an icon on the
desktop.
If you are having problems running the installer, you can download a ZIP file without an installer as an
alternative. That file is called mysql-administrator-version-win-noinstall.zip. Using
a ZIP program, unpack it to a directory of your choice. You may want to create shortcuts to MySQLAd-
ministrator.exe for your desktop or quick launch bar.
To install MySQL Administrator, first download the installation tarball. The tarball file is called
mysql-administrator-version-linux.tar.gz, where version indicates the MySQL
Administrator version (for example 1.0.12).
2
Installing MySQL Administrator
This installs the application binary in /opt/mysql-administrator/bin. Change into that direct-
ory and run mysql-administrator to start the application.
Once the copy is complete, you may eject the disk image.
3
Chapter 3. Starting MySQL
Administrator
3.1. Introduction
The way you start MySQL Administrator depends on the operating system you are using:
• On Windows, start MySQL Administrator by double-clicking its desktop icon, or by selecting its
item from the Start menu. Alternatively, you can open a DOS window and start it from the com-
mand line:
C:\> C:\program
directory\MySQL\MySQL Administrator 1.0\MySQLAdministrator.exe
program directory is the default directory for programs on your machine, for example
C:\Program Files or C:\programme. If your path contains spaces, you should enclose the
command within quote characters. For example:
• On Mac OSX, navigate to the MySQL Administrator installation directory and double-click on the
MySQL Administrator icon.
As an alternative to connecting to a running MySQL server, you can run MySQL Administrator in con-
figure -service mode.
4
Starting MySQL Administrator
Note that MySQL Administrator will not work with MySQL servers prior to version 4.0. If you try to
connect to an older server, an error message will appear, telling you that this is not possible.
If the server connection is successfully established, all of the values filled in the fields of the connection
dialog will be saved for future connections (see the section that describes how MySQL Administrator
stores connection information). The Password field, however, will always be empty: For security reas-
ons, the password is not stored along with the other options, unless you explicitly specify otherwise in
the Gen eral Options section of the Options dialog.
You can change any of the values in the connection profiles just by overwriting the existing values with
new ones. Similarly, if you select another connection profile, you can change any of its values. When
you click the OK button after changing a profile's values, the changes are stored permanently if a suc-
cessful connection to the MySQL server is established. However, the preferred method for changing a
profile is to click the ... button next to the Connection drop-down box. That brings up an Options dia-
log window that has a Connections section for modifying connection profiles. You can find the val-
ues you can set in the Connection dialog window in the description of the Connections section of the
Options dialog (see Options dialog).
Alternatively, you can run MySQL Administrator in configure-service mode. This is useful in the fol-
lowing cases:
• When you want to start a MySQL server from within MySQL Administrator. Obviously, you cannot
connect to a server that is not running, so you will have to use the configure-service mode to start
5
Starting MySQL Administrator
that server. Note that, at the moment, you can only start servers on the same machine where MySQL
Administrator is running (that is on the local host).
To start MySQL Administrator in configure-service mode, hold down the CTRL key in the Connection
dialog. The Cancel button will toggle to Skip when that key is pressed.
Clicking on the Skip button will skip the normal mode, thus starting MySQL Administrator in config-
ure-service mode.
6
Starting MySQL Administrator
Under Installed Services in the sidebar, you can select the service that you wish to configure, or
the server that you want to stop or start. In configure-service mode, as opposed to normal mode, there is
only a subset of the sections in the sidebar avaiable:
• The Service Control section allows you to start and stop a MySQL server, and to configure the Win-
dows service managing that server.
• The Startup Variables section allows you to set variables for server startup.
7
Chapter 4. Main Window
4.1. Introduction
After you have successfully connected to your MySQL server, the main window of MySQL Adminis-
trator appears (see figure). The main window contains a sidebar, a working area, and menus with sub-
menus.
4.2. Sidebar
The sidebar consists of the following sections:
• Server Information: Information about the MySQL server you are connected to, about MySQL Ad-
ministrator and the machine that it runs on, and about your connection.
• Service Control: Start and stop the MySQL server. On Windows, you can also configure the MySQL
service.
• Startup Variables: Configure the startup variables for the MySQL server.
8
Main Window
• Server Connections: View or kill current connections to the MySQL server (also called threads).
• User Administration: Administer existing users, add new users, and delete existing users.
• Health: Graphical displays of a number of usage or hitrate values that affect server performance, and
a hierarchical view of system and status variables.
• Backup: Plan and administer backup projects, select the databases to be backed up, and start the
backup process.
• Replication Status: View information about replication master and slave servers.
• Catalogs: View information about databases, tables, columns, indexes, and rows; optimize tables.
You can change the width of the sidebar in the main window by dragging the separator between sidebar
and working area. To hide the sidebar completely, click on the marked area in the separator (located in
the vertical center of it). To make the sidebar visible again, double-click the marked area (which then
forms the left margin of the main window).
9
Main Window
4.4. Menus
4.4.1. File
4.4.1.1. New Instance Connection ...
Opens the Connection dialog, allowing you to open another connection to a MySQL server. You may
open an arbitrary number of connections. MySQL Administrator opens a new main window for each
successfully established connection. Connections may be to the same or different servers. Multiple con-
nections may be opened using the same profile or different profiles.
4.4.1.4. Close
Closes the MySQL Administrator window and terminates the connection to the MySQL server that had
been established in that window. If you have opened more than one instance (program window, or pro-
cess) of MySQL Administrator, this command will not close the other windows.
4.4.2. Edit
The Cut, Copy, and Paste commands allow you to cut, copy, or paste selected text in the working area.
4.4.2.1. Options
Opens the Options dialog window.
4.4.3. View
The View menu selects sections from the sidebar. Selecting an item from this menu is the same as click-
ing the section with the same name from the sidebar.
4.4.4. Tools
The Tools menu starts other programs.
10
Main Window
4.4.5. Help
4.4.5.1. Online Help
Opens a window displaying the MySQL Administrator section of the MySQL reference manual.
11
Chapter 5. Server Information
Provides basic information about connection, server, and client.
• User: Username used for the current connection to the MySQL server.
• Host: The hostname of the machine where the MySQL server runs. This is either identical to
the name listed in Network Name, or it is localhost. The former indicates that you are
connecting to a server that either runs on a remote machine, or that you have specified a host-
name different from localhost when connecting. The latter indicates that the MySQL server
runs on the same machine where MySQL Administrator runs.
• Port: The port used for the connection to the MySQL server.
• Server Information
Information about the MySQL server and the host where it is running.
• Network Name: The hostname of the machine where the MySQL server runs.
• IP: The IP number of the host where the MySQL server runs.
• Client Information
Information about MySQL Administrator and the client host on which it is running.
• Version: The version of MySQL Administrator, and the version number of the MySQL client/
server protocol.
• Network name: The name of the host where MySQL Administrator runs.
• Operating System: Information about the operating system on which MySQL Administrat-
or runs.
12
Chapter 6. Service Control
6.1. Introduction
This section allows you to start and stop the MySQL server you have connected to. At the moment, this
is only possible if the server is running on the same machine where MySQL Administrator runs. In fu-
ture releases, MySQL servers will have an Instance Manager that allows you to also start and stop
MySQL servers on remote machines. Also, you can start and stop the server only if a service has been
configured. If the server runs as a stand-alone application, the Service Control section is not available.
The Configure Service tab is available only for MySQL servers that run under Windows.
Under Log Messages, you will find messages that the MySQL server produces when it starts or
stops. Messages produced by the server during startup look something like this:
The details and format of the messages might vary depending on the version of the MySQL server you
are using and its configuration.
Note that if you have more than one MySQL server running as a Windows service, you should run
MySQL Administrator in configure -service mode to administer these services. In normal mode, you can
13
Service Control
only administer the Windows service listed first in the Windows service manager, no matter which serv-
er you are connected to.
Note that the settings in the Server Features group take effect only after restarting the MySQL server.
• Service Settings
• Launch MySQL server automatically: If checked, the Windows service starts the
MySQL server automatically on operating system startup.
• Display Name: The display name of the Windows service (not the service name!) as it will
appear in the Windows services manager when displaying the properties of that service.
• Service Description: The description of the Windows service as it will appear in the
Windows services manager.
• Option File
• Config Filename: You can enter the pathname of the server option file. MySQL will enter
that information in the Windows registry, and the Windows service starting the MySQL server
will use that file, rather than the default file (C:\windows installation
directory\my.ini). Note that this is available for MySQL servers as of version 4.0.3 only.
Details about the server option files can be found in the Creating an Option File
[http://dev.mysql.com/doc/mysql/en/Windows_create_option_file.html] section.
• Section Name: Setting a value other than mysqld is most useful when running multiple
servers; see Running Multiple Servers on Windows
[http://dev.mysql.com/doc/mysql/en/Multiple_Windows_servers.html].
• Server Features
Note that all server features will only take effect after the MySQL server has been restarted.
• Support for InnoDB: If checked, the MySQL server is started with support for InnoDB
tables. If unchecked, it doesn't start the InnoDB storage engine; this saves memory, but InnoDB
tables cannot be used. If this checkbox is unchecked and greyed out, it means that your MySQL
server isn't compiled with support for InnoDB tables. (This is, for example, true for some ver-
sions that run under a commercial license.) You can find more information on InnoDB tables in
the MySQL Storage Engines and Table Types
[http://dev.mysql.com/doc/mysql/en/Storage_engines.html] section.
Be careful when disabling this option! If any databases on the MySQL server contain InnoDB
tables, disabling this option makes those tables inaccessible.
• Support for BDB: If checked, the MySQL server is started with support for BDB tables. If
unchecked, it doesn't start the BDB storage engine; this saves memory, but BDB tables cannot be
used. If this checkbox is unchecked and greyed out, it means that your MySQL server isn't com-
piled with support for BDB tables. (This is, for example, true for non-max versions.) You can
find more information on BDB tables in the MySQL Storage Engines and Table Types
[http://dev.mysql.com/doc/mysql/en/Storage_engines.html] section.
Be careful when disabling this option! If any databases on the MySQL server contain BDB
tables, disabling this option makes those tables inaccessible.
• Named Pipes: On operating systems of the Windows NT family, including Windows NT,
Windows 2000, and Windows XP, you may use named pipes to connect to a MySQL server run-
ning on the local machine, rather than connecting via TCP/IP. If this option is checked, named
14
Service Control
pipe connections are allowed. Note that named pipes are slower than TCP/IP in many Windows
configurations. See the Selecting a MySQL Server type
[http://dev.mysql.com/doc/mysql/en/Windows_select_server.html] section for details.
• Debug Information (slow): If checked, the MySQL server is started with an option that
allows for easier debugging of problems. Using this option slows down the server significantly,
so it is recommended only for debugging purposes. If the MySQL server has not been compiled
with debugging support, this option is greyed out. See the mysqld Command-line Options
[http://dev.mysql.com/doc/mysql/en/Server_options.html] section for details.
• Path to Binary: Contains the pathname of the MySQL server binary file as it is listed in the
Windows service manager (for example C:\mysql\bin\mysqld-max-nt). Note that the
the Windows service manager does not display the .exe extension.
15
Chapter 7. Startup Variables
7.1. Introduction
This section allows you to set variables that the MySQL server reads on startup. These variables are
stored in the option file of the server. On Windows, the option file is called my.ini, and it is located in
the Windows installation directory (for example, C:\WinNT\my.ini). Note that it can alternatively
be stored in C:\, in which case it is named my.cnf. Also note that there can be more than one option
file. On operating systems other than Windows, the option file is called my.cnf, regardless where it
resides. On Windows, MySQL Administrator allows you to store the option file in any location you spe-
cify. You can find more information on the MySQL option files in the Using Option Files
[http://dev.mysql.com/doc/mysql/en/Option_files.html] section.
Note that the server reads variables stored in the option files only at server startup. After changing an
option file, you must restart the server for the changes to take effect. You can do this using the Stop
Server and Start Server buttons in the Service Control section.
16
Chapter 8. Server Connections
8.1. Introduction
This section allows you to view and manage the current connections to the server (also called threads). If
you have the PROCESS privilege, you can see all threads. If you have the SUPER privilege, you can also
terminate threads other than your own. (Note that the SUPER privilege is available for MySQL servers
as of version 4.0.3 only.) Otherwise, you can see your own threads only. You can find more information
about threads in the SHOW PROCESSLIST
[http://dev.mysql.com/doc/mysql/en/SHOW_PROCESSLIST.html] section. For more information on
the PROCESS and the SUPER privilege (and other available privileges as well), see Privileges Provided
by MySQL [http://dev.mysql.com/doc/mysql/en/Privileges_provided.html].
Note that you will see an additional thread for the user under which you are connected when you have
clicked the Health section within your current MySQL Administrator session. The values displayed in
that section are retrieved from the MySQL server via a separate connection.
8.2. Threads
This tab allows you to view all connections to the server (threads). Initially, those are sorted by their
PID (MySQL process identification number), but you can change that order by clicking on the appropri-
ate headings (User, Host, etc.). You can select a thread by clicking on it. You can select more than
one thread using mouse or keyboard.
To reload the process list from the server, press the Refresh button.
If you have selected one or more threads, you can terminate them by clicking the Kill Thread button, or
by right-clicking on that thread. Remember that you need the PROCESS privilege to see threads other
than your own, and the SUPER privilege to kill threads other than your own. Furthermore, note that
MySQL Administrator imposes a restriction that prevents you from terminating your own threads. On
Windows, using the Kill Thread button on your own threads does not have an effect; on Linux, that but-
ton is disabled when selecting your own threads.
Clicking on a user will enable the Kill User button, which allows you to terminate all threads of that user
with a single click. That command is also available by right-clicking on the username. Clicking on an in-
dividual thread in the lower box will enable the Kill Thread button, which is used to terminate a connec-
tion. That command is available by right-clicking on a thread, too.
To reload the user list from the server, press the Refresh button.
17
Chapter 9. User Administration
9.1. Introduction
This section allows you to administer existing users, add new users, and delete existing users. For more
information on the MySQL user account management and privilege system, see the MySQL User Ac-
count Management [http://dev.mysql.com/doc/mysql/en/User_Account_Management.html] section.
If you are an experienced MySQL user, you will notice that users are not listed the typical MySQL way
(user@host ), but rather with their usernames only. If double-clicking on a username does not show
subcategories for that user, this means that the user's privileges are not restricted to a specific host, or
hosts. If there are subcategories, the user's privileges are restricted to a specific host, or set of hosts. You
may assign various (and different) sets of privileges, depending on the host from which the user con-
nects to the MySQL server. That concept is described in detail in the Access Control, Stage 1: Connec-
tion Verification [http://dev.mysql.com/doc/mysql/en/Connection_access.html] section.
Note that MySQL Administrator has a different concept of what a user is than MySQL has. In MySQL,
a user is always identified by a username/host combination. This means that, for example, 'bri-
an'@'%' may be a user completely different from 'brian'@'localhost'. The former might be
Brian Miller, while the latter might be Brian Schultz. That distinction does not hold true for
MySQL Administrator: User brian is always a particular user, no matter from which host he connects
to the MySQL server. That said, 'brian'@'%' may still have privileges different from 'bri-
an'@'localhost'.
18
User Administration
For example, you might have a user called superuser. If double-clicking on that username shows two
subcategories, localhost and athena, this means that the user has a specific set of privileges if he/
she connects from localhost, and a (probably different) set of privileges if he/she connects from
athena.
Right-clicking on a username, or on one of the subcategories a user might have, provides access to the
following commands:
• Add a new User: Selecting this command adds a new user with the default name New User to
the user list. You will have to fill in at least a username in the MySQL User field of the User In-
formation tab, which, after applying this change, will also rename that user in the user accounts list.
• Add Host from which the User can connect: Allows you to specify a host from
which the user can connect. This command is unavailable if you highlight a subcategory.
• Remove Host from which the User can connect: Allows you to remove a host from
which the user can connect. If there are no sub-categories, the user will be removed (you will be
prompted to confirm the removal).
• Clone User: Makes a copy of the selected user, including all subcategories. The new user is
called New User until you specify another name in the MySQL User field of the User Informa-
tion tab. With that command, you can therefore create a user with identical privileges.
• Delete User: Allows you to delete the selected user. You will be prompted to confirm that you
really want to delete that user.
19
User Administration
• Refresh User List: Rereads the user list from the MySQL server. This is helpful when other
users (on other connections) are editing user accounts. Note that selecting that command will col-
lapse all subcategories.
Note that all fields will be stored only when you click the Apply Changes button. If you don't want to
save your changes, click the Discard Changes button.
The values you enter in the fields of this tab are stored on the MySQL server. The fields in the Login In-
formation group of this tab are stored in the user table of the mysql database, while the fields in the
Additional Information group are stored in the user-info table of the mysql database. The latter ta-
ble is created the first time you add a new user, or change an existing user. Its contents may look like
this:
20
User Administration
• Login Information
• MySQL User: Username that is specified when connecting to the MySQL server. Note that this
username has nothing to do with usernames you might use elsewhere on your operating system.
It is recommendable not to use special characters or spaces for that username.
• Password: Password that is specified when connecting to the MySQL server. Note that this
password has nothing to do with passwords you might use elsewhere on your operating system.
It is recommendable not to use special characters or spaces for that password. It is, however, re-
commendable to use non-trivial passwords. A very trivial password might be abcde, while a
non-trivial password might be lEtusMak3iThartdoGesz. Note that it is not mandatory to
specify a password, although it is highly recommendable to do so.
• Confirm Password: Fill in the password once again to make sure you do not accidentally in-
troduce a typo.
• Additional Information
• Full Name: As opposed to the username in MySQL User, the full name may contain any
characters, including spaces.
• Contact Information: More contact information, like postal address, or messenger in-
formation.
• Icon: Rather than using the default icon, you may select a different icon by pressing the Load
from Disk button. You can either use one of the buttons that are shipped with MySQL Adminis-
trator , or use an icon of your own. In the latter case, be aware that the icon has to be exactly 48
by 48 pixels in size, and its file format has to be PNG (portable network graphics).
Under Assigned Privileges, you find the global privileges assigned to the selected user. For more in-
formation about those privileges, see the Privileges Provided by MySQL
[http://dev.mysql.com/doc/mysql/en/Privileges_provided.html] section. Global means that those priv-
ileges apply to the MySQL server in general (like the Shutdown privilege), or to all databases on the
21
User Administration
Privileges not assigned to the user are listed under Available Privileges. You can remove privileges by
selecting them in the left box, and then clicking the > button. Removed privileges will appear in the
Available Privileges box. You can assign privileges by selecting them in the Available Privileges box,
and then clicking the < button.
Privileges not assigned to the user are listed under Available Privileges. You can remove privileges by
selecting them in the left box, and then clicking the > button. Removed privileges will appear in the
Available Privileges box. You can assign privileges by selecting them in the Available Privileges box,
and then clicking the < button.
To access the tables, double-click on the schema (database) name containing that table. You will not see
and cannot grant privileges on a schema level in this tab; if you want to do that, use the Global Priv-
ileges tab instead. Also, you cannot select more than one table at a time.
If you want to grant privileges on a column level, double-click on the table name; this will give you ac-
cess to its columns. You cannot select more than one column at a time.
Privileges not assigned to the user are listed under Available Privileges. You can remove privileges by
selecting them in the left box, and then clicking the > button. Removed privileges will appear in the
Available Privileges box. You can assign privileges by selecting them in the Available Privileges box,
and then clicking the < button.
22
Chapter 10. Health
10.1. Introduction
The Health section of MySQL Administrator allows you to graphically monitor the real-time status of
your MySQL server. A selection of pre-made status graphs are available, and you can easily create your
own status graphs and organize them into custom pages and groups.
The default graphs provide graphical information about the MySQL server's current performance, load,
and memory usage. Additional pages list all server variables, divided into pages for status variables and
system variables. Note that clicking on the status pages will open an additional connection to the
MySQL server, which you can see when viewing threads and users in the Server Connections section.
We'll begin by covering the different pre-made status graphs, and then describe how to create your own
status graphs yourself. Finally we'll describe the pages in the Health section dedicated to the various
status and system variables.
• Connection Usage: Displays a percentage of the maximum number of simultaneous clients al-
lowed (threads connected / max_connections). If this value gets close to 100%, it could
indicate that you should increase the value of max_connections, which you can do in the Startup
Variables section. The maximum number of connections since MySQL Administrator was loaded is
also shown. For more information on server connections, see the SHOW VARIABLES
[http://dev.mysql.com/doc/mysql/en/SHOW_VARIABLES.html] and Too many connections
Error [http://dev.mysql.com/doc/mysql/en/Too_many_connections.html] sections of the reference
manual.
• Traffic: This is a representation of the bytes_sent status variable. This does not represent
total bytes sent since server startup, but instead represents the current number of bytes sent (the
bytes_sent variable is a cumulative total). The initial maximum value of the graph is 102400,
this maximum value will be automatically increased as needed.
• Number of SQL Queries: This is a representation os the com_select status variable. This
does not represent total queries since server startup, but instead represents the current number of
queries (the com_select variable is a cumulative total). The initial maximum value of the graph is
10, this maximum value will be automatically increased as needed.
• Query Cache Hitrate: When in use, the query cache of the MySQL server stores the text of a
SELECT query together with the corresponding result that was sent to the client. If an identical
query is later received, the server will retrieve the results from the query cache rather than parsing
and executing the same query again. The hitrate indicates the ratio of queries that were cached and
23
Health
queries that were not cached. The higher the hitrate, the better the performance of the server regard-
ing SELECT queries. See the MySQL Query Cache
[http://dev.mysql.com/doc/mysql/en/Query_Cache.html] section for details.
• Key Efficiency: The horizontal bar graph indicates how much of the allocated key buffer is in
use. If a fairly large percentage of the key buffer is in use you may wish to increase the
key_cache_size setting in the Startup Variables section. The line graph is an indication of the
number of key_read_requests that resulted in actual key_reads. The higher the hitrate the
more effective your key buffer is. A low hitrate can indicate that you need to increate the size of
your keycache.
The first step in creating custom health graphs is to create a new page in the Health section to store
your graphs. To create a new page right-click anywhere in the working area and choose the Add a Page
option. You will be prompted for a page name and description and a new page will be created.
Once you have created a new page, you will need to create a group. All graphs are located within
groups. For example, the Key buffer usage and Key buffer hitrate graphs are both loc-
ated within a group titled Key Efficiency. To create a group, right-click within your newly created
page and choose the Add a Group option.
To create a custom graph, right-click within a group and choose the Add a graph option. The following
dialog will appear:
24
Health
The Line-Graph is appropriate for showing trends over time, while the Bar-Graph option will be more
appropriate for showing percentage information. If you choose to create a bar-graph, you will need to
choose a caption for your graph. Captions are not allowed for line-graphs.
25
Health
The data on your graph is set using the Value Formula. You can create a formula using any of the
variables available in the Status Variables and System Variables tabs. To use the value of a variable,
wrap the variable name in square brackets (i.e. [com_select]), if you want the relative value of the
variable prepend the square brackets with a ^ character.
For example, if we wanted to graph the percentage of temporary tables that were created on disk we
could use the following formula:
[created_tmp_disk_tables] / [created_tmp_tables]
If we wanted to track the number of temporary tables created on a continious basis, we could use the fol-
lowing as our formula:
^[created_tmp_tables]
After creating your formula, select the Value Unit that best represents your data. You can choose
from Percentage, Count, Byte, and Seconds. In our examples we would have used Percent-
age for the first example, and Count for the second. You can also assign a caption to the value.
Once your formula is assigned you should configure the Max. Value and Min. Value for the
graph, so that your data is spread evenly across your graph. You can set arbitrary values based on your
estimates of how large the values will grow, and check the Autoextend Max. Value option to allow
MySQL Administrator to automatically increase the Max Value setting automatically to prevent your
data from extending off of your graph.
You can also set the Max. Value option by way of a formula assigned in the Max Formular field. The
same syntax applies in this field as applies in the Value Formula field. For example, if you were creating
a bar graph tracking the number of temporary disk tables created, you could use
[created_tmp_disk_tables] as the Value Formula and [created_tmp_tables] as the
Max. Formular.
For each category, and each subcategory, the status variables are listed in the right box of the working
area, together with their values, and with a short explanation. The status variables are described in detail
in the SHOW STATUS [http://dev.mysql.com/doc/mysql/en/SHOW_STATUS.html] section of the refer-
ence manual.
Use the Refresh button to make MySQL Administrator retrieve the variables and their values once
again.
Right-clicking in the right box allows you to copy variables to the clipboard.
26
Health
For each category, and each subcategory, the system variables are listed in the right box of the working
area, together with their values, and with a short explanation. The system variables are described in de-
tail in the SHOW VARIABLES [http://dev.mysql.com/doc/mysql/en/SHOW_VARIABLES.html] sec-
tion of the reference manual.
System variables that can be set at runtime are marked as editable, that is they are prefixed with an icon
different from the variables that cannot be set at runtime. Double-clicking on editable variables will
open a dialog where you can specify another value for the variable. The changes you make will take ef-
fect as soon as you click the OK button in that dialog. Click Abort if you want to keep the current value.
Changes made in this manner will only persist until the server is restarted, after which the server will re-
vert to it's startup settings. In MySQL Administrator, system variables are set on a global level only.
Note that you need appropriate privileges to change variables globally. You can find more information
on global variables in the SET Syntax [http://dev.mysql.com/doc/mysql/en/SET_OPTION.html] section.
Use the Refresh button to make MySQL Administrator retrieve the variables and their values once
again.
Right-clicking in the right box allows you to copy variables to the clipboard.
27
Chapter 11. Server Logs
11.1. Introduction
The Server Logs section provides easy access to the various log files generated by the MySQL serv-
er. You can access the server's error log, slow query log, and general log using this section.
This section has one tab for each of the log files, and each tab is split into two boxes. Above the boxes,
there is a bar which allows you to navigate through larger log files by breaking the log file into individu-
al pages. Clicking in the bar will display the individual pages. The light blue area represents the portion
of the log file you are currently viewing.
Figure 11.1. Displaying entries from the middle of the General Log
You can only view log files that are stored on the machine where MySQL Administrator is running, you
cannot view log files on a remote machine.
Also note that some tabs may be disabled. If a tab is disabled it indicates that the log file in question has
not been enabled on the MySQL server. You can enable the various log files in the Startup Variables
section.
28
Server Logs
The left box (labeled Events of page x / y) displays the major events that have occured on the
current page of the log file. The right box (labeled Page Content) displays the detailed lines of the
log file. By clicking on an event in the left box, the first detailed entry of the event will be highlighted in
the right box.
In addition to the log file tabs, the Server Logs section has four action buttons for managing log in-
formation:
• Open Other File will allow you to open a log file other than the currently active log file. This can be
useful in situations where you rotate your log files as it allows you to open log files that have been
rotated out of active use.
• Search opens a dialog where you can specify a search term to look for in the log file. If it's found, it
will be marked as selected in the right box. This command is also available by right-clicking in the
right box and choosing the Search ... option.
• Save Log Page opens a dialog that allows you to specify the path and file name where the current
page of the log file should be stored. By default, MySQL Administrator suggests ErrorLog.txt,
SlowLog.txt, or GeneralLog.txt as a filename. Note that executing this command does not
affect the actual log file in any way; it just creates a copy of the current log file contents that you
may store for documenting or analyzing. This command is also available by right-clicking in the
right box and choosing the Save log Page ... option.
29
Chapter 12. Backup
12.1. Introduction
This section allows you to create backup projects, and to perform backups. This section will produce
backup files that are plaintext and composed of multiple SQL statements that can be executed to restore
your database, similar to the output generated by the mysqldump utility. For more information on
mysqldump, see the mysqldump section [http://dev.mysql.com/doc/mysql/en/mysqldump.html] of
the reference manual.
Existing backup projects are listed in the lower left area of the sidebar. If there are many backup
projects, the field with the magnifying-glass icon can be used to filter the projects you are looking for.
Typing in t or T, for example, will set the filter to projects whose names begin with a t. The filter
works in a case-insensitive fashion.
You can update the list of backup projects by right-clicking on a project and choosing the Refresh
Backup Projects option from the drop-down menu. You can delete a backup project by right-clicking on
the project and choosing the Delete Backup Project(s) option from the drop-down menu.
If you are not working from a previously saved backup project, click the New Project button to create a
new backup project. You cannot begin configuring a backup operation without either loading an existing
project or creating a new project.
Once you have configured your backup project, you can click the Save Project button to save your
project for future use. To start your backup, click the Execute Backup Now button. You will be promp-
ted for a path and filename for the backup file, after which the backup operation will begin.
You can name your project by filling out a name in the Project Name field. If you have enabled the Add
Date/Time to Backup Files option in the Administrator Options dialogue, then the
date and time of the backup will be appended to the project name automatically. See Section 17.5.3,
“Backup” for more information on setting this option.
Specify a name that clearly denotes the project, such as Full Backup or World Only. The project
name may contain arbitrary characters, including spaces.
To choose the databases and tables that will be backed up, select the database from the schemata list and
click the > button. Once the database is in the Backup Content list, you can un-check specific tables
that you do not wish to back up.
30
Backup
Lock all tables will cause all tables within the backup to be locked simultaneously to prevent
writing. This will prevent users from writing to the tables during the backup operation and will ensure
that the tables are in a consistent state. This option is recommended for MyISAM tables.
Single transaction will begin a transaction before reading from the tables. Because of the In-
noDB versioning system this will allow all tables to be read in a consistent state. This method is recom-
mended when backing up InnoDB tables.
Normal Backup will lock each table individually when performing the backup. While this can have
less impact on the actions of users during the backup operation, these is a potential for tables to be
backed up in an inconsistent state in relation to one another. This method is not recommended unless the
risk on inconsistency in minimal.
No CREATEs will supress CREATE DATABASE statements. This can be useful if you need to restore
the data to a different database than it was backed up from.
No EXTENDED INSERTS will supress the default behavior of combining multiple inserts into a single
statement (for example INSERT INTO test VALUES ('1',Some
data',2234),('2','Some More Data',23444)). While the EXTENDED INSERT syntax is
more efficient both in terms of storage and execution, it is not compatible with most RDBMSes.
Complete INSERTs will produce full INSERT statements that include a column list (i.e. INSERT
INTO tablename(columnA, columnB) VALUES(valueA, valueB)). Without this option
the column list will be omitted.
Comment
ANSI Quotes will cause all table and database names to be quoted with ANSI style double quotes in-
stead of back-ticks.
Disable keys will add an ALTER TABLE ... DISABLE KEYS statement to the backup file be-
fore the INSERT statements that populate the tables. This allows for faster recovery by loading all data
before rebuilding the index information.
12.4. Schedule
Backup operations can be scheduled to be executed on a regular basis using the Schedule tab. Backup
operations can be scheduled to execute on a daily, weekly, or monthly basis.
The enable scheduling for your backup project, check the Schedule this backup project checkbox. You
will need to choose a target directory for the backup files to be placed and choose a name for the backup
files. You can browse for a target directory by clicking the ... button.
If you have enabled the Add Date/Time to Backup Files option in the Administrator
Options dialogue, then the date and time of the backup will be appended to the file name automatic-
ally. See Section 17.5.3, “Backup” for more information on setting this option.
Once you have decided on a file name and target directory, you can set the regularity of the backup op-
eration. Regardless of you choice of daily, weekly, or monthly backups, you can set the time that the
31
Backup
backup will occur by settiong the Time option. Set the backup time in a 24 hour format (i.e. 23:30).
When you select the Execute Backup Weekly option, a set of check boxes representing the days
of the week will be displayed. Check the boxes corresponding to the days on you want to perform the
backup.
When you select the Execute backup monthly option, a list of dates will appear, allowing you to
choose which day of the month you want to perform the backup.
Click the Save Project button to save your preferences. After your project is saved it will be executed at
the next scheduled interval. To run the backup operation immediatly click the Execute Backup Now but-
ton.
32
Chapter 13. Restore
13.1. Introduction
The Restore section helps with disaster recover by allowing you to restore backup files created with
mysqldump or with the Backup section of MySQL Administrator. See Chapter 12, Backup for more
information on creating backups with MySQL Administrator.
13.2. General
In this tab, you specify which backup file should be used for the restore procedure, along with informa-
tion such as the backup file character set and format, and the target location for restored tables.
To set any options on this tab, you must first open a backup file by clicking the Open Backup File button
at the bottom of the section. When all options are set, you can click the Start Restore button to begin the
restore process.
• File to restore: Specify path and filename of the backup file. You can browse for that file by
clicking the Open Backup File button.
• Target Schema: You can choose the Original Schema option to have all tables restored in-
to their original databases. You can also choose the New Schema... option to restore all tables
into a new database. Finally you can choose from one of the existing databases in the drop-down list
to force all tables to be restored to that database.
• Backup Type: At the moment, the only available option is SQL Files. Those are backup files
containing SQL statements such as those produced by mysqldump.
• Force - Continue even if we get an sql error: This will cause a restore opera-
tion to continue executing even if errors are encountered during the restore operation.
• File Charset: Backup files created with MySQL Administrator are encoded in the utf8 char-
acter set. Backup files created with other tools such as winmysqladmin may be encoded with oth-
er character sets. Before a backup file can be successfully imported you will need to specify its char-
acter set.
If you do not know the character set of your backup file, click the Auto-Detect Character Set button
to have MySQL Administrator attempt to determine it automatically.
After clicking the Analyze Backup File Content button, a list of all databases and tables contained with-
in the backup file will be displayed.
33
Restore
To prevent a database or table from being restored, un-check the box next to the object's name.
34
Chapter 14. Replication Status
14.1. Introduction
The Replication Status sections give you a visual overview of your MySQL replication master
and slaves. You can tell which slave machines are connected to the master and which ones are offline
through the server status icons beside each machine.
For a slave server to show in the Replication Status screen, it must register itself with the master
server. To have a slave server register itself with the master, set the report-host option in your serv-
er configuration (my.cnf/my.ini) file. See http://dev.mysql.com/doc/mysql/en/Replication_Options.html
for more information.
You can also set the value in the Replication tab of the Startup Variables section of MySQL
Administrator.
35
Replication Status
All servers are listed in the main area of the Replication Status section, along with their server
ID, Port, and current status.
New servers that are not currently being monitored will have an exclamation mark as their status sym-
bol, and will be listed as a New Instance in the Status section of their entry.
Servers that are currently being monitored and are online will have a green status icon and will be listed
as Available in the Status section of their entry.
Servers that are currently not in contact with the master server will have a red status icon and will be lis-
ted as Not Available.
There will be a slight delay between a slave machine going offline and having its status updated to allow
for an adequate timeout in the communications between master and slave.
To start monitoring a new server that is not currently being monitored, click the Add Instance to Monit-
oring List button. To stop monitoring a server that is currently being monitored, click the Remove In-
stance from monitoring List button.
36
Chapter 15. Catalogs
15.1. Introduction
This section allows you to view catalogs, schemata, tables and their properties, and to perform a number
of operations on tables. Existing catalogs and schemata are listed in the lower left area of the sidebar. If
there are many schemata on your MySQL server, the field with the magnifying-glass icon may be handy
for filtering the schemata you are looking for. Typing in t or T, for example, will set the filter to
schemata whose names begin with a t. The filter works in a case-insensitive fashion.
Select the database that you wish to view. Right-click on any database and choose the Refresh Schemata
List option to refresh the database list. Clicking on a database will cause the Schema Tables and
Schema Indices tabs to be populated with the tables and indexes of the selected database.
To create a new database, right-click on an existing database and choose the Create New Schema option.
The tables are ordered by table name initially, but you may change that sorting by clicking on the appro-
priate headings (Type, Row Format, etc.).
To drop a table, right-click on the table and choose the Drop Table option from the pop-up menu. To
create a table you can either click the Create Table button at the bottom of the window, or right-click on
a table and choose the Create Table option from the pop-up menu.
To edit a table's columns and indexes, right-click on the desired table and choose the Edit Table option
from the pop-up menu. This will launch the MySQL Table Editor, which you can use to modify the ta-
ble. See Chapter 16, The MySQL Table Editor .
To edit a table's actual data, right-click on the table and choose the Edit Table Data option. This will
launch the MySQL Query Browser and load the table's data into the result area of the MySQL Query
Browser.
You may select more than one table at a time in order to perform operations on multiple tables. For the
selected tables, you can perform the following operations by either clicking the Maintenance button at
the bottom of the table list or by right-clicking on one of the selected tables and choosing one of the fol-
lowing options from the Maintenance sub-menu of the pop-up menu:
• Optimize Table: This corresponds to the OPTIMIZE TABLE SQL command and should be
used if you have deleted a large part of a table or if you have made many changes to a table with
variable-length rows (tables that have VARCHAR, BLOB, or TEXT columns). Deleted records are
maintained in a linked list and subsequent INSERT operations reuse old record positions. You can
use this command to reclaim the unused space and to defragment the datafile. Note that table optim-
ization works for MyISAM and BDB tables only. For more information see the OPTIMIZE TABLE
section [http://dev.mysql.com/doc/mysql/en/OPTIMIZE_TABLE.html] of the reference manual.
• Check Table: This corresponds to the CHECK TABLE SQL command and is used to diagnose
table problems. For more information see the CHECK TABLE section
[http://dev.mysql.com/doc/mysql/en/CHECK_TABLE.html] of the reference manual.
37
Catalogs
• Repair Table: This corresponds to the REPAIR TABLE SQL command and should be used in
case of table problems. Note that this command works for MyISAM tables only. For more informa-
tion see the REPAIR TABLE section [http://dev.mysql.com/doc/mysql/en/REPAIR_TABLE.html]
of the reference manual.
Clicking on a table name will display its properties in the details area when the details area is active. To
display the details area, click the Details >> button.
To see the columns that form a given index, double-click on the index.
38
Chapter 16. The MySQL Table Editor
16.1. Introduction
The MySQL Table Editor is a component of both the MySQL Query Browser and MySQL Administrat-
or, and allows for the visual creation and modification of tables.
The MySQL Table Editor can be accessed from the MySQL Query Browser by right-clicking on a table
within the database browser and choosing the Edit Table option, or by right-clicking on a database with-
in the database browser and choosing the Create New Table option.
The MySQL Table Editor can be accessed from MySQL Administrator through the Catalogs screen.
Once you have selected a database, right-click on a table and choose the Edit Table option from the
drop-down menu. You can also select a table and click the Edit Table button to access the MySQL Table
Editor.
Regardless of the tab you have active, you can always edit the table name, the database it belongs to, and
the table comment.
39
The MySQL Table Editor
• Columns and Indices: Use the Columns and Indices tab to create and modify the table's column and
index information. You can also create FOREIGN KEY relationships using this tab.
• Table Options:Use the Table Options tab to choose the storage engine used by the table and the ta-
ble's default character set.
• Advanced Options: Use the Advanced Options tab to configure advanced options such as per-table
storage directory, MERGE and RAID table options, and table/row length options.
Each of these areas are discussed in further detail in the following sections.
To change the name, data type, default value, or comment of a column, double-click on the value you
wish to change. The value becomes editable and you can the complete your changes by pressing the
Enter key.
To modify the flags on a column (UNSIGNED, BINARY, ASCII, and so on) check and uncheck the
boxes corresponding to the flag you wish to change.
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 dia-
mond. To add or remove a column from the primary key, you can click on the icon.
40
The MySQL Table Editor
To add an index, click the + (plus) button below the index list. You will be prompted for an index name
and then the new index is created. To drop an index, select the index and click the - (minus) button to
drop the index from the index list.
Use the Index Name and Index Kind dialogs to modify the name and type (UNIQUE, FULLTEXT, and
so on) of the index.
To add columns to an index, either click and drag the column to the Index Columns box or select the
column you wish to add and click the + (plus) button to the right of the Index Columns box. You can re-
move a column from the index by selecting the column and clicking the - (minus) button to drop the
column from the index.
To change an index to only refer to a column prefix (such as with the CHAR and VARCHAR string data
types), select the index column you wish to prefix in the Index Columns box and then click the arrow
icon to the right of the Index Columns box. Select the Set Index Column Length option from the drop-
down menu that appears. You can set the desired prefix length in the dialog that appears.
To add a foreign key, click the + (plus) button below the foreign key list. You will be prompted to name
the new foreign key, and it is then be added to the list.
To drop a foreign key, select the foreign key and click the - (minus) button below the foreign key list.
The foreign key is then dropped from the foreign key list.
You can modify the name of the foreign key, its ON DELETE, and its ON UPDATE actions using the
dialogs provided in the Foreign Key Settings section of the tab.
To establish a foreign key relationship, choose a table from the Ref. Table drop-down list. The columns
that can be referenced as foreign keys are listed in the area below, and you can drag a column from the
column editor to the Column section to the left of the column you wish to reference.
41
The MySQL Table Editor
All settings that are available in the Column Editor are also available in the Column Details tab, and in
addition you can also configure the column character set and column default collation from the Column
Details tab.
To change the storage engine for your table, click on the radio button next to the desired storage engine.
To change the default character set or collation of your table, choose a new option from the drop-down
list of available character sets.
The Advanced Options tab is divided into several sub-sections, each of which is described in the
upcoming sections of this manual.
The AUTO_INCREMENT and delayed key update behaviors apply only to MyISAM tables.
To set the row format, choose the desired row format from the drop-down list. See ht-
tp://dev.mysql.com/doc/mysql/en/MyISAM_table_formats.html for more information on the different
row formats that are available. This option only applies to MyISAM tables.
When you expect a table to be particularly large, use the Avg Row Length, Min Rows, and Max Rows
options to enable the MySQL server to better accommodate your data. See ht-
tp://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html for more information on how to use these op-
tions.
This option is only available for MyISAM tables and is not available for servers running under the Win-
dows operating system.
42
The MySQL Table Editor
You can also specify the action the server should take when users attempt to perform INSERT state-
ments on the merge table. See http://dev.mysql.com/doc/mysql/en/MERGE.html for more information
on MERGE tables. [http://dev.mysql.com/doc/mysql/en/MERGE.html]
For more information on using RAID support with MyISAM, see ht-
tp://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html
To apply the changes you have made, click the Apply Changes button. The Confirm Table Edit
dialog will appear.
43
The MySQL Table Editor
You can click the Execute button to confirm the changes and have them applied, or click the Cancel but-
ton to discard the changes. You can also click the Discard Changes button in the main MySQL Table
Editor window to discard all changes you have made.
You can also copy the proposed changes to the clipboard for further editing by highlighting the ALTER
TABLE or CREATE TABLE statement, right-clicking and choosing Copy from the drop-down menu.
44
Chapter 17. Options Dialog
17.1. Introduction
The Options dialog allows you to configure connection profiles, general program settings, and more.
You can open the Options dialog window using one of the following methods:
• In the main application window select Options ... from the Tools menu.
In the sidebar of that dialog, you can select the section you wish to configure. There are three action but-
tons in the lower right corner of the window:
• Close closes the Options dialog window. If you have not applied or discarded your changes, you
45
Options Dialog
• Store Window Positions: When an application is started the next time, its recent window
positions will be reused.
• Show Tip of Day: If checked, a pop-up window with the tip of the day appears at program star-
tup.
• Store Passwords: If checked, passwords are stored in the user's connection profile. In this case,
you can select the password storage method:
Plaintext means they are stored without encryption; this can be insecure. Obscured means
they are encrypted using a weak algorithm. This encryption method, however, is operating system
independent. Selecting OS Specific will use the default encryption method provided by your op-
erating system. The default option is Plaintext.
• Data Font: The font used for all query and table data displayed.
• Code Font: The font used for all queries entered by the user..
• Ignorelist: Whenever you check the Do Not Show This Message Again option on er-
ror and message prompts, they are added to this list. If you would like a particular message to be
shown again, click the Remove button after selecting the message from the list.
You may change the font and font size of any of the application fonts by clicking the Choose ... button
to the right of the font.
17.3. Connections
The Connections section allows you to create, edit, and delete connection profiles. The center box
displays a list of currently available profiles, together with a history of connections that were made
without being stored in a profile. You can collapse or expand both the Connections and History
trees by double-clicking them.
Connections are automatically added to the History tree whenever you establish a connection to a
MySQL server without using one of the profiles stored under the Connections tree. They do not ap-
pear in the drop-down box of the Connection dialog, but you can use any of them by manually typing
their name into the Connection box of the Connection dialog.
46
Options Dialog
To edit an existing connection profile, click on its name and change the values that appear in the Con-
nection Parameters and Advanced Parameters tabs, then click on the Apply Changes but-
ton to save your changes.
When you select a connection profile from either the Connections or History trees, the Connec-
tion Parameters tab displays the following fields:
• Connection: The connection profile label. This is the name by which you refer to the profile and
that appears in the Connection drop-down box of the Connection dialog. It may contain any char-
acters, including spaces. Choose distinctive names so that you can easily tell which profiles they
refer to. The names can help you distinguish connections to different MySQL servers, or connections
as different MySQL users to a given server.
• Password: The password used to connect to the MySQL server. Note that passwords are not stored
in the connection profile, unless you specify otherwise in the General Options section.
• Hostname: The name of the host machine where the MySQL server runs, or its IP address.
• Port: The TCP/IP port that the MySQL server listens to on the host machine.
• Type: Specifies the protocol used to connect to the database server. The default protocol is MySQL
(which uses the native MySQL protocol). The other protocols listed are not currently available.
• Schema: The default database for a connection when using the MySQL Query Browser.
47
Options Dialog
• Notes: You can use this field to enter comments or additional information describing the connec-
tion profile.
Note that the Advanced Parameters tab may not be available in some of the first releases of
MySQL Administrator. If that is the case in the version you are using, you can still set those parameters
in the Connection dialog. Use the Details ... button of that dialog to display the Advanced Connec-
tion Options.
When you select a connection profile from either the Connections or History list, the Advanced
Parameters tab displays the following checkboxes:
• Use compressed 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 tool with the --compress option.
• Ignore spaces after function names, make them reserved words: Nor-
mally, any refereence to a function name in an SQL statement must be followed immediately by an-
opening parenthesis. If this option is checked, spaces may appear between the function name and the
parenthesis, like this:
COUNT (*)
Enabling this option has the effect that function names become reserved words. This option corres-
ponds to starting a MySQL command-line tool with the --ignore-spaces option.
• Enable LOAD DATA LOCAL handling: By default, the LOCAL option of the LOAD DATA
statement is disabled for security reasons. Enabling this option will allow to load data from the local
machine (the machine where the client GUI application is running). This option corresponds to start-
ing a MySQL command-line tool with the --local-infile=1 option. (Note that this option is
ineffective unless the MySQL server allows LOCAL handling.)
17.4. Editors
The Editors section is used to configure options specific to the different editors available within the
MySQL GUI Suite. At the time of writing this is limited to the MySQL Table Editor.
• Show SQL command before applying changes toggles whether the MySQL Table Edit-
or will show you the ALTER TABLE statement it is about to execute for confirmation when you
click Apply Changes.
• All columns Not Null per default determines whether the MySQL Table Editor will
48
Options Dialog
designate columns as being NOT NULL by default when creating new columns.
• All integer columns unsigned per default sets whether integer columns are de-
clared UNSIGNED by default when creating new columns.
• PK Naming dictates the format that should be used to name PRIMARY KEY columns that are auto-
matically generated. the %tablename% portion will be replaced with the name of the appropriate
table.
• Index Naming sets the name automatically generated for new indexes. The %nr% string will be
replaced with an automatically incrementing number.
• FK Naming configures the name used when creating new foreign keys.
• Def. Datatype is the default datatype assigned to all new columns that are not part of a
PRIMARY KEY.
17.5. Administrator
The Administrator section allows you to specify options that affect the behavior of the MySQL
Administrator. The Administrator section is divided into three sub-sections that will be discussed
further in the sections that follow.
• Show Global Privileges: If checked, the Global Privileges tab will be visible in the User
Administration section. In that tab, you can grant users global privileges (as opposed to privileges on
a database, table, or column level only). This may affect security. See The MySQL Access Privilege
System [http://dev.mysql.com/doc/mysql/en/Privilege_system.html] for details. If unchecked, the
Global Privileges tab will not be visible in the User Administration section.
• Use Peak Level Indicator: This will display a thin yellow line on the health graphs indic-
ating the highest value recorded by the graph.
• Reset peak Level after a number of ticks: If this box is not checked, the Peak
Level Indicator will be permanently positioned at the highest value ever recorded on the
health graph. With this box checked, the Peak Value Indicator will be reset after a period of
time indicated by the Time after the Peak level resets option. Use this option if you
would like to know the peak level over an interval rather than the peak level overall.
• Time after the Peak level resets: When the Reset peak Level after a
49
Options Dialog
number of ticks option is set, this determines the amount of time (in ticks) that will pass be-
fore the Peak Level Indicator will be reset.
17.5.3. Backup
The backup options configure how MySQL Administrator performs backup operations.
• Add Date/Time to Backup Files: This determines whether the date and time of the
backup operation are added to the name of the backup file. See the backup section for more informa-
tion.
50
Appendix A. The MySQL System Tray
Monitor
The MySQL System Tray Monitor is a tool that allows you to monitor the status of your local mysql
server through an indicator that resides in the system tray. The MySQL System Tray Monitor also gives
quick access to the various MySQL GUI tools through its context menu.
To start the MySQL System Tray Monitor, you can either execute the MySQLSystemTrayMonit-
or.exe application that resides in your MySQL Administrator installation directory, or choose the
MySQL System Tray Monitor option of the Tools menu.
Once the MySQL System Tray Monitor is running, it resides in the system tray and provides visual
status information for your MySQL server. A green icon is displayed at the top left corner of the
MySQL System Tray Monitorif the MySQL server is running, and a red icon is displayed if the service
is stopped. In addition, the CPU load may optionally be displayed along the right side of the MySQL
System Tray Monitor.
If you right-click on the MySQL System Tray Monitor, a pop-up menu will appear, listing all installed
MySQL services and their individual statuses. For each service, the following options are available:
• Shutdown Instance: this will begin the shutdown operation on the selected running service.
• Configure Instance: this will launch the MySQL Administrator in configure service mode
for the currently selected instance. See Configure Service Mode for more details.
• Monitoring Options: currently the Monitoring Options submenu has one available op-
51
The MySQL System Tray Monitor
tion: Ignore Instance State. Ignore Instance State will cause the MySQL System
Tray Monitor to stop monitoring the selected service.
In addition to the service controls, you can also start the MySQL Query Browser and MySQL Adminis-
trator from the pop-up menu.
The Manage MySQL Instances option of the Actions menu can be used to start MySQL Ad-
ministrator in configure service mode so you can manage your server configurations. See Configure Ser-
vice Mode for more details.
The Monitor Options menu has two options, which affect the general behavior of the MySQL Sys-
tem Tray Monitor. Display CPU Load determines whether the CPU usage is displayed on the right
of the MySQL System Tray Monitor. Launch Monitor after Login sets the MySQL System
Tray Monitorto launch when you log into Windows.
52
Appendix B. Installing From Source
B.1. Introduction
Normally, you will want to install the MySQL GUI tools from binaries. We put a lot of effort into mak-
ing sure that our binaries are built with the best possible options. If, for whatever reason, you wish to
compile the tools yourself, follow these instructions.
Our public BitKeeper trees that contain the MySQL GUI tools source code can be retrieved by the fol-
lowing BitKeeper commands:
You will need the mysql-gui-common tree regardless of which GUI tools you intend to build. The
mysql-gui-common tree contains source and graphics files used for all MySQL GUI tools.
You can also download the source for the various GUI tools from the downloads page
[http://dev.mysql.com/downloads].
B.3.1. Prerequisites
To compile the MySQL GUI tools from source under Windows, you need Borland Delphi 7, Microsoft
Visual Studio.NET 2003, and some libraries which are available on the internet as open source software.
Make sure the programs DCC32.exe and DEVENV.exe /? can be launched from the command line.
• glib-2.0
• libxml-2
• pcre-1.4
53
Installing From Source
• Lua 5.0.2
The source files and libraries should be placed into the following tree structure:
Working Directory
|
|- mysql-administrator
|- mysql-gui-common
|- mysql-query-browser
|- mysql-gui-win-res
|
|-include
| |
| |-glib-2.0
| |-java
| | |
| | |-win32
| |
| |-libxml
| |-lua
| |-mysql
| |-pcre
| |-windows
|
|-lib
|
|-glib-2.0
|-java
|-libxml
|-lua
|-mysql
|-pcre
|-windows
• build_debug.cmd
• build_release.cmd
• build_commercial.cmd
Execute one of those to generate a runtime image of the application. It will be generated in a
54
Installing From Source
bin\windows directory.
• png
• SynEdit
• TNT
• UniCodeEditor
• VirtualTreeview
Then doubleclick each *.dpk file outlined below. It will open Delphi. Press compile and install to in-
stall the components. Repeat this for each *.dpk file.
• SynEdit\Packages\SynEdit_D7.dpk
• TNT\Packages\TntUnicodeVcl_D70.dpk
• VirtualTreeview\Packages\VirtualTreesD7D.dpk
• UniCodeEditor\Packages\UniCodeEditorD7.dpk
These components have to be installed via the Install option of the Component menu. Click on the
Browse button and select the the files below. Press OK after each file.
• png\PNGImage.pas
After installing the components you can open the projects as outlined below.
To build the application from the Delphi 7 IDE simply doubleclick the edit_xxxx.cmd. This will
launch Delphi 7 and open the file. To generate the complete runtime image select Build All Projects op-
tion from the Project menu.
Like for building from command line there are three different files.
• edit_debug.cmd
• edit_release.cmd
55
Installing From Source
• edit_commercial.cmd
Opening the Delphi project not using the edit_*.cmd script will lead to incorrect project settings and
problems while building the projects.
• gtk-2.x
• gtkmm-2.0 or gtkmm-2.2
• libglade-2.x
• libxml-2.6.x
• pcre-1.4
• autoconf-2.54, automake-1.7.x
In addition, you will need gtkhtml-3.0.x to build the MySQL Query Browser.
1. cd mysql-gui-common
2. sh ./autogen.sh
3. ./configure --prefix=/opt/mysql-administrator
4. make
5. make install
The --prefix option can have whatever value you want, normally one would specify /usr/local
(the default) or /usr, but for making precompiled binaries, something in /opt might be more appro-
priate.
56
Installing From Source
After you have successfully built mysql-gui-common, you can build the individual tools (in this ex-
ample we will build mysql-administrator):
1. cd mysql-administrator
2. sh ./autogen.sh
3. ./configure --prefix=/opt/mysql-administrator
4. make
5. make install
• Many libraries do not come with their static (lib*.a) versions shipped, so we need to build them
ourselves.
• Some libraries depend on data files and modules from the original package, esp. in case of gtk/
gnome. Problems don't just appear when the user don't have these data files installed; things may not
work if they use distributions that put data files in different paths.
The current solution is to build a partially static binary, with the most common libraries left dynamically
linked (glibc and gtk). gtkmm, gtksourceview, gtkhtml and dependencies (like gnome) are
being linked statically. The ideal solution would be to build custom binaries for each major/chosen dis-
tribution, but we don't have time/resources for that at the moment.
1. Look at the source/linux/static_make script for all the files that should be removed/
moved out of /usr/lib.
That's needed to force the linker to look for the static version of each library and also to explicitly list
the dependency libs that were otherwise linked to the dynamic libs.
The contents of each subdir is the entire bk tree for each tool (Windows specific files and bk metadata
57
Installing From Source
are optional, of course). You must make a tar.gz file and put it in /usr/src/redhat/SOURCES (or
whatever is your rpm SOURCES directory).
That should build the srpm and rpm files for the tool.
58
Appendix C. Troubleshooting
Application Errors
C.1. Troubleshooting Connection Errors
If an error occurs when you select a connection profile and attempt to establish a connection to the
MySQL server named in the profile, a window containing error information will be displayed (see fig-
ure).
Normally, this means either that the credentials specified in the profile are wrong (wrong username,
wrong password), or that you do not have privileges to connect to the MySQL server from the client ma-
chine. You can find more information about the error in the Causes of Access denied Errors
[http://dev.mysql.com/doc/mysql/en/Access_denied.html] section of the reference manual.
However, another cause of connection failure is that there might be a network problem that prevents you
from reaching the machine where the MySQL server is running. For this reason, the error dialog
provides a PING button. Clicking this button will send an ICMP PING request to the MySQL server
host machine. If the host machine is available over the network, you will see something like this:
This would indicate that the machine is reachable, and that the cause of connection failure is not a net-
work problem.
59
Troubleshooting Application Errors
If, under Linux, messages and captions appear very big, your display resolution is probably set too high.
Use gnome-font-properties to change your default font to a smaller value or go to Details
and set your resolution to 72 or some other more appropriate value.
60
Appendix D. How Connections Are
Stored
On Windows, connection profiles are stored in C:\Documents and
Settings\UserName\Application Data\MySQL directory, where UserName is the name of
the current Windows user. On Linux, the files are stored in the ~/.mysqlgui directory. The settings
are stored in a file called mysqlx_user_connections.xml. The contents of that file look like
this:
<?xml version="1.0"?>
<user_connections>
<last_connection>1</last_connection>
<password_storage_type>2</password_storage_type>
<user_connection>
<connection_name></connection_name>
<username>root</username>
<hostname>localhost</hostname>
<port>3306</port>
<schema></schema>
<advanced_options/>
<storage_path></storage_path>
<notes></notes>
<connection_type>0</connection_type>
<storage_type>2</storage_type>
<password></password>
</user_connection>
...
You can edit the file manually, but take care not to invalidate the XML. When applying changes by edit-
ing and saving the file, those changes will show up the next time you open the Connections section of
the Options Dialog. You do not need to restart your application for the changes to take effect.
As a database administrator, you may also edit the file according to your preferences, and then copy it to
any other machine running the MySQL GUI tools. This makes it easy to have identical connection pro-
files on all machines, without having to set up those profiles individually. All XML configuration files
for the MySQL GUI Tools are cross-platform compatible and can be transferred between Windows and
Linux machines.
61
Appendix E. XML Files Common to the
MySQL GUI Applications
On Windows, XML files common to all MySQL GUI applications are stored in the C:\Documents
and Settings\UserName\Application Data\MySQL directory, where UserName is the
name of the current Windows user. On Linux, the files are stored in the ~/.mysqlgui directory.
62
Appendix F. XML Files Used by MySQL
Administrator
Besides the documentation you are just reading (which is written in DocBook XML), MySQL Adminis-
trator uses a number of XML files for internal purposes.
<textgroup id="MySQLVariables">
<text id="status-var-group-General">
<trans xml:lang="en">General</trans>
<trans xml:lang="de">Allgemein</trans>
</text>
<text id="status-var-Uptime">
<trans xml:lang="en">How many seconds the server has been
up.</trans>
</text>
...
<textgroup id="Form-InstanceForm">
<text id="FileMI">
<trans xml:lang="en">&File</trans>
<trans xml:lang="de">&Datei</trans>
</text>
<text id="NewConnectionMI">
<trans xml:lang="en">&New Connection
...</trans>
<trans xml:lang="de">&Neue Verbindung
...</trans>
</text>
<text id="SaveConnectionMI">
<trans xml:lang="en">&Save Connection
...</trans>
<trans xml:lang="de">Verbindung &speichern
...</trans>
</text>
63
XML Files Used by MySQL Administrator
<text id="CloseMI">
<trans xml:lang="en">Clos&e</trans>
<trans xml:lang="de">Be&enden</trans>
</text>
</textgroup>
...
• A description (called text) does not necessarily have to be translated (see status-
var-Uptime). If it isn't, English will be used instead.
<textgroup id="ResourceStrings">
<text id="OKBtn">
<trans xml:lang="en">OK</trans>
</text>
<text id="CancelBtn">
<trans xml:lang="en">Cancel</trans>
<trans xml:lang="de">Abbruch</trans>
</text>
...
64
Appendix G. Notes for Translators
You may find that the MySQL GUI tools and/or their documentation are not available in your preferred
language. If you would like to translate the software, or its documentation, or participate in that transla-
tion, please contact the MySQL documentation team before starting your translation!
The MySQL documentation team's address is <docs@mysql.com>. In your mail, please state what
you would like to translate (the tools, their documentation, or even the whole MySQL reference manual
if you dare), and give some information regarding your background:
The format used for both software and documentation is DocBook XML. From that base format, all other
available formats (HTML, CHM, PDF, etc.) are being generated. It would be a pity if you started trans-
lating, say, the HTML version of this documentation, because we will not be able to use it in that format.
Also, you might find that someone else has already done (or is in the process of doing) that translation.
So, once again, please contact the MySQL documentation team first!
65
Appendix H. Third-party Software Used
by the MySQL GUI Tools
The MySQL GUI tools incorporate PCRE and PNG support through the use of third-party libraries.
66