Mysql workbench show error log

6.1.1 Server Logs

The Administration - Server Logs tab displays log information for the MySQL server represented by each connection tab. For each connection, the Administration - Server Logs tab includes additional tabs for the general error logs and the slow logs (if available).

With a valid connection established, and the connection tab for it open, you can access log information from either the Navigator area or by clicking and then from the menu.

Error Log File

The following figure shows an example of entries within the Error Log File tab. For more information, see The Error Log.

Figure 6.2 Navigator Administration: Instance: Server Logs: Error Log

Mysql workbench show error log


Slow Log File

The next figure shows an example of entries within the Slow Log File tab. For more information, see The Slow Query Log

Figure 6.3 Navigator Management: Instance: Server Logs: Slow Log

Mysql workbench show error log



MySQL Workbench saves configuration, cache, and log-related files and directories on your system. These files are saved in a directory assigned to the current user as defined by MySQL Workbench. The following table shows the default file path by platform.

Table 3.1 Default Local Configuration Base File Path

Operating SystemFile Path
Windows %AppData%\MySQL\Workbench\
macOS ~username/Library/Application Support/MySQL/Workbench/
Linux ~username/.mysql/workbench/

The next table provides a brief description of these directories and files.

Table 3.2 Local MySQL Workbench Files and Directory Descriptions

Directory or FileDescription
cache/ General behaviors are stored per-connection in *.cache files, and column widths as *.column_widths files.
log/ Log files include MySQL Workbench startup information, and also per-connection SQL action results performed in MySQL Workbench.
scripts/, modules/, and libraries/ Saved user scripts, modules, and libraries that enables you to extend MySQL Workbench capabilities.
sql_history/ Queries executed in MySQL Workbench are stored here, and are available from within MySQL Workbench.
sql_workspaces/ Configuration details, such as the tab order or schema tree, are stored here by connection instance.
snippets/ Saved SQL snippets are stored here. For additional information, see Section 8.1.5, “SQL Additions - Snippets Tab”.
audit_cache/ Cache storage by the Audit Log inspector. For additional information, see Section 6.6, “MySQL Audit Inspector Interface”.
connections.xml Saved MySQL server connection information, as seen on the home screen tab. For information about backing up and restoring this file, see Section 9.1.1.1.7, “The Tools Menu”.
server_instances.xml Stores your MySQL server information, as it relates to your MySQL connections.
wb_options.xml Stores your preferences, both configured and default.
wb_state.xml Stores the previous user-interface state. You can delete this file if you encounter a problem with the MySQL Workbench user interface.


cache/ Directory

The cache/ directory contains cache files in the user's MySQL Workbench directory. All cache files are stored as SQLite 3 databases, and they are not meant to be edited outside of MySQL Workbench. The types of cache files are:

  • *.column_widths:

    These are the saved column widths after adjusting columns in the SQL editor's results grid. The fields include column_id, stored as column_name::db_name::table_name, and width, stored as an integer of character length.

  • *.cache:

    This information (schemas, engines, and other global information) serves as a quick lookup source for the SQL editor's auto completion functionality, and is implicitly updated whenever the schema tree is updated.

All cache/ file names begin with the MySQL connection name. For example, the column width file is named Local_instance_3306.column_widths for a MySQL connection named "Local Instance 3306".

Cached files remain after a connection is either renamed or deleted.

log/ Directory

MySQL Workbench start up and SQL actions are logged and stored in the log/ directory. This directory is in the user's MySQL Workbench directory.

Note

To find these text files, select from the menu.

  • wb*.log:

    Debugging information is generated when MySQL Workbench is started and unexpectedly stopped. Information includes paths used, modules and plugins loaded, system information, and more. The log files are useful when reporting a MySQL Workbench bug.

    The log files rotates when MySQL Workbench is started, in that wb.log is renamed to wb.1.log, wb.log is reset, and the previous wb.1.log file is renamed to wb.2.log, and so on, all the way up to wb.9.log.

  • sql_actions_*.log:

    A log of all SQL execution results but without the data, for debugging purposes.

    The SQL editor's SQL history does not originate from here, as it is stored in the sql_history directory.

scripts/, modules/, and Libraries/ Directories

Custom user script, module, and library files are stored in the scripts, modules, and libraries directories. These user files are accessible from the file browser in the Workbench Scripting Shell. For additional information about user scripts, see Section C.5, “The Workbench Scripting Shell”. For more information about user modules, see Section C.2, “Modules” and Section C.3, “Plugins and Tools”.

sql_history/ Directory

SQL statements executed in the SQL editor are saved in the sql_history directory. They are stored as plain text files that are separated one per day (such as 2015-12-15) and they contain your MySQL Workbench SQL statement history for all MySQL connections. For additional information, see Section 8.1.7, “Output Panel”.

sql_workspaces/ Directory

Workspace information is saved to the sql_workspaces directory by connection automatically. MySQL Workbench generates a subdirectory that persists between work sessions for each connection tab that you open. It uses the name of the connection, appended with a sequential number, to represent the order of each connection tab. For example, opening two connection tabs for a connection named Local instance MySQL80 creates two subdirectories: local_instance_MySQL80-1.autosave and local_instance_MySQL80-2.autosave. The file extension changes from .autosave to .workspace when you close the connection tab.

snippets/ Directory

SQL snippets used by the SQL editor are stored in the snippets directory. These files include bundled snippets (such as "SQL DDL Statements") and custom snippets saved under the My Snippets tab. For additional information, see Section 8.1.5, “SQL Additions - Snippets Tab”.


How do I show errors in MySQL Workbench?

To cause MySQL Workbench to show error messages, I had to change a preference. From the Workbench menu, click "Edit" -> "Preferences..." Open the "SQL Queries" tab. Check "Confirm Data Changes".

How do I view MySQL error logs?

On Ubuntu systems, the default location for the MySQL is /var/log/mysql/error. log . In many cases, the error logs are most easily read with the less program, a command line utility that allows you to view files but not edit them: sudo less /var/log/mysql/error.

How do I view the slow query log in MySQL Workbench?

To enable the slow query log, type the following command at the mysql> prompt: Copy SET GLOBAL slow_query_log = 'ON'; There are additional options that you can set for the slow query log: By default, when the slow query log is enabled, it logs any query that takes longer than 10 seconds to run.

Where can I see information about command execution or errors in MySQL Workbench?

The Action Output panel displays a summary of the communication between the active MySQL connection in MySQL Workbench and the MySQL server, and can refer to errors or general information.