0

I am just starting to use MySQL Workbench 6.3, and I want to just run simple queries. I've created a table with the appropriate schema and everything, but I can't seem to observe the output from my script. Here's what it looks like:

What workbench looks like for me right now

I click on "run script file" in the Scripting drop down menu, but it doesn't seem to do anything at all? Even if there's a syntax error, I'd like to just see the output and debug my script. Am I missing something obvious?

0

Are there any records in table_A (not a good name by the way)? It should at least give you field names though.

For problems like this, it's always best to go back to the good-ol CLI (Command Line Interface) to make sure that nothing's wrong somewhere.

You could also open a new Query (interactive) window and copy, paste and run your code and check that way.

As @MikeLischke points out, the system wasn't designed for interactive scripting in modelling mode (unsurprising really).

However, when you open up MySQL Workbench, you have to choose the modelling option. You then get a new tab with that functionality. You can also open a new Query tab (File-> New Query tab...). You have to connect to an (already existing) schema to actually run any SQL (logically enough).

In the interests of fairness, I think you could maybe mark Mike's post as the correct answer (and give me a +1 if you think I deserve it! :-) ).

  • okay, I can't +1 you since I'm new here, but let me try. thanks – Sother Mar 4 '16 at 5:37
  • as you can see in my picture, I insert the values myself in the script/query. – Sother Mar 4 '16 at 5:49
  • From memory. Top left -> File -> (Open) New Query (Window). A new tab should appear for interactive queries. Run the code there and not through the script tab/window. – Vérace Mar 4 '16 at 6:07
  • I don't see any (Open) New Query. All I see is Open Model, and this doesn't allow me to write any Queries. – Sother Mar 4 '16 at 6:10
  • Close down MySQL Workbench and restart it. – Vérace Mar 4 '16 at 6:15
0

MySQLWorkbench consists of 2 major parts:

  • Query/Admin IDE
  • Modeling

The first one is what you would use to run queries against an existing server, do maintenance (e.g. administer users + privileges or do backups). The second one is for designing a database. In modeling you don't work with actual data, only with meta data (db structure, db objects, user data types, relationships, documentation etc.). Scripts you add to a model therefore cannot be run standalone. They are used when you forward engineer your model to a physical server (creating so a real db from your model).

  • Thanks for that @MikeLischke - it's great to see the actual developer of a product taking the time to answer end-users' questions. – Vérace Mar 4 '16 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.