MySQL Workbench - how to diagnose query failure problems

Andrew Kirk picture Andrew Kirk · Apr 3, 2015 · Viewed 19.6k times · Source

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

Answer

Andrew Kirk picture Andrew Kirk · Apr 5, 2015

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!