Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Workbench - how to diagnose query failure problems

I have loaded MySQL and MySQL workbench on my PC, and am using it to build up my SQL skills, accessing only data stored on and served by the PC itself.

When a query fails the only message I get is one telling me it failed because of an error.

Is there any way to get more helpful information about what problem the software detected that caused it to raise the error message?

I am using WorkBench 6.0 on linux mint Rebecca. I am also using it on the same PC (dual-boot) on windows 7, although I don't know the windows WorkBench version right now because I'm writing this from linux. In both cases no info is provided about why the query failed. In WorkBench 6.0 on linux all I get is a 'Query Interrupted' message. On windows I just get a white cross on a red circle telling me there's an error and that I need to correct my code.

If the best solution is to use something other than WorkBench I'm quite open to that. I'm starting to wonder whether WorkBench is not the best tool for this type of activity aimed at developing sql query skills. The docn spends a lot of time talking about forward and reverse engineering and models, and I think I've got the general idea of what that is, but all I want to do is read in tables from csv files, manipulate and analyse them, then write out some result tables. I wanted a GUI that would also let me browse the tables, and highlight syntax errors in the code editing window, and thought that WorkBench would be the tool to do that, but it looks like it might be aimed at doing much more than that, and may be an unnecessarily complex environment for what I'm trying to do.

Thank you

like image 211
Andrew Kirk Avatar asked Apr 03 '15 21:04

Andrew Kirk


People also ask

How do I see 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 check my database in MySQL Workbench?

To view the database created on MySQL Workbench, navigate to Database > Connect to Database . Choose an existing connection to connect to MySQL Server or create a new one. The database created will be as shown in the screenshot below.


2 Answers

D'oh. I realise the problem was just that the Output Area was not visible on my WorkBench screen. For some reason when I first loaded it, the Output area was condensed down to just a heading, with no room to see the lines describing the result of each statement, and error codes when applicable.

One first needs to check that the Output Area is not deliberately hidden, by doing menu actions: View > Panels > and looking whether it says Hide Output Area or Show Output Area. If it says the former then the area is currently hidden, so one needs to click the 'Show Output Area' option and it will appear.

The Output Area appears at the bottom right of the WorkBench screen. If statement results do not appear, one needs to get the horizontal divider at the top of the Output Area and drag it up so there's enough space to see the error codes.

Once the error codes are visible, one can sometimes fix the problem from the attached explanation alone. If not, the error code can be looked up to get more info about what's wrong. Thank to Lucas for pointing that out!

like image 124
Andrew Kirk Avatar answered Sep 21 '22 00:09

Andrew Kirk


It is already there you have to move your mouse and expand it: At first it will look like this: initial state

you have to hover the mouse until the cursor icon change to resize icon.upward enter image description here

then click it and pull enter image description here

and then you can hover on cross sign scroll right to see the error message completely. enter image description here

like image 22
princebillyGK Avatar answered Sep 20 '22 00:09

princebillyGK