MySQL for Excel enables you to load and edit MySQL data directly from Microsoft Excel. Changes are immediately committed if the Auto-Commit option is enabled, or done manually by pressing Commit Changes.
The Edit MySQL Data feature exists as of MySQL for Excel 1.1.0.
The example below uses the
category table of
sakila database, but the screen
will look the same for any table. Within MySQL for Excel, Open
a MySQL Connection, click the
schema, Next, select the
category table, click Edit MySQL
Data, then choose Import to
import the data into a new Microsoft Excel worksheet for editing.
The background color represents the status of each cell, and there are four distinct colors that are used while editing table data:
Table 3.1. Background cell colors
|White||Default color for all cells. This is either the original data, or the data after Refresh from DB is clicked.|
|Blue||Cells that were committed with success.|
|Green||Cells that were modified but have not yet been committed.|
|Red||Cells that generated an error when a commit was attempted. An error dialog is also displayed while the commit is attempted.|
|Yellow||Cells that accept new data. Data entered here is inserted into the MySQL table.|
In our example, the blue "Drama" field was changed and then committed first, then the green "Gaming" field was changed but not committed, and then Auto-Commit was enabled before changing the "9" to a "10" in column 10, which generated an error because this commit would have added a duplicate value as primary key.