How to refresh a table in mysql workbench
Asked Answered
D

3

5

I inserted data to mysql table 'table1' using java.But in the table in the workbench doesn't updated.When I retrive that table using java,inserted data using java will be shown.How to refresh my 'table1' table in workbench when I insert new data using java?

Detraction answered 21/10, 2016 at 2:13 Comment(0)
A
11

Workbench doesn't automatically refresh table data on INSERT or UPDATE etc, so assuming you're viewing the table in question you should have a 'Navigator' pane open to the left.

If you expand the database you're working on, and find the relevant table there should be a few icons to the right of the table name. Click on the table symbol with the lightning bolt to execute a SELECT * on the table.

Referring to the image below it is the 'Select' button.

Navigator Pane

Ardel answered 21/10, 2016 at 2:20 Comment(1)
is there a keyboard shortcut to update the Object navigator contents?Phosphocreatine
H
1

Assuming that you viewed the table by clicking on the view-table button as pointed below 👇

image pointing the view-table button on the side bar, the select query in the editor and the table-contents in the view-pane

This will write a query for you in the editor and view the table contents.

Now suppose you updated the table via any means (any orm, mysql command line, etc.). To show the latest contents of the table just press

Ctrl + Enter
(might differ for other OS(s))

This will re-run the query in the editor and hence, you will get the latest contents.

⚠ Caution: If the cursor is on any other query in the editor, it will run that query.

Holman answered 13/10, 2021 at 5:53 Comment(1)
Also, avoid ctrl-enter if there are any DELIMITER in the sql window, I have seen that cause it to execute unexpected things.Lissome
F
0

These answers, while correct, are not optimal because they will create a new tab. Instead, just hit the Refresh button just above the table output (next to the Result Grid label), which will re-execute the original query.

Fromenty answered 31/8, 2023 at 20:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.