MacLochlainns Weblog

Michael McLaughlin's Technical Blog

Site Admin

MySQL Workbench Limit

with 6 comments

Working with MySQL Workbench, I was always curious why you couldn’t run a script with a sourcing command, like source or \. command. It raises a 1064 error code, like the one shown in the illustration.

It turned out that there’s a pending feature request to add the ability to run a sourcing command like the following:

SOURCE c:\DATA\some_script.SQL

or,

\. c:\DATA\some_script.SQL

I added my business reason to the bug. Let’s hope the product managers add it quickly.

Written by maclochlainn

September 1st, 2012 at 11:59 pm

Posted in MySQL,MySQL Workbench

Tagged with ,

6 Responses to 'MySQL Workbench Limit'

Subscribe to comments with RSS or TrackBack to 'MySQL Workbench Limit'.

  1. What about opening the script in wb and then running it? That should work.

  2. GREAT COMMENT! Here’s my answer and I added it as a business reason to the feature request.

    Yes, you can run any number of scripts successfully. You just can’t create a script to run a series of scripts in a specific order. That leaves us with two options: write down the order during integration testing and hand the list to the DBA to run in stage or production; or consolidate the scripts into one master script.

    The former places execution sequence at risk, and the latter diminishes identification of ownership when an error occurs. Once an organization gets beyond a single developer, multiple scripts evolve at every major and point release.

    It’s my take that you should be able to wrap the execution sequence of scripts with a master script (one to bind them together and abstract their relationship sequence). That behavior currently doesn’t exist and from my perspective should exist.

    maclochlainn

    3 Sep 12 at 9:36 am

  3. Why not use the command line client for running scripts? Everything you want to do would work.

    Gavin Towey

    3 Sep 12 at 9:49 pm

  4. I do run things at the command line but don’t you think that MySQL Workbench should work the same way too? ;-)

    maclochlainn

    3 Sep 12 at 10:36 pm

  5. You can’t do that in Workbench because it’s not a mysql server feature, it’s a mysql client feature.

    What are the mysql client features? Well, check out the “help” in MySQL:

    mysql> \h
     
    FOR information about MySQL products AND services, visit:
       http://www.mysql.com/
    FOR developer information, including the MySQL Reference Manual, visit:
       http://dev.mysql.com/
    TO buy MySQL Enterprise support, training, OR other products, visit:
       https://shop.mysql.com/
     
    List OF ALL MySQL commands:
    Note that ALL text commands must be FIRST ON line AND END WITH ';'
    ?         (\?) Synonym FOR `help'.
    clear     (\c) Clear the current input statement.
    connect   (\r) Reconnect to the server. Optional arguments are db and host.
    delimiter (\d) Set statement delimiter.
    edit      (\e) Edit command with $EDITOR.
    ego       (\G) Send command to mysql server, display result vertically.
    exit      (\q) Exit mysql. Same as quit.
    go        (\g) Send command to mysql server.
    help      (\h) Display this help.
    nopager   (\n) Disable pager, print to stdout.
    notee     (\t) Don't write into outfile.
    pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
    print     (\p) Print current command.
    prompt    (\R) Change your mysql prompt.
    quit      (\q) Quit mysql.
    rehash    (\#) Rebuild completion hash.
    source    (\.) Execute an SQL script file. Takes a file name as an argument.
    status    (\s) Get status information from the server.
    system    (\!) Execute a system shell command.
    tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
    use       (\u) Use another database. Takes database name as argument.
    charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
    warnings  (\W) Show warnings after every statement.
    nowarning (\w) Don't show warnings after every statement.
  6. Interesting comment? The blog post says it’s a design limitation and a there’s a new feature request. Your comment says it’s not a feature. Doesn’t that mean we concur? Do you disagree with adding the feature? If so, why?

    It also appears to me that MySQL Workbench is a client not a server tool. I believe the “client” sourcing feature should be added to enhance MySQL Workbench’s utilities.

    My supposition that it’s a client tool appears consistent with my understanding from the product manager, and the future direction which will add several server utilities to the next release. My guess is that the new menu options will still support network connections, and therefore fit within the current MySQL Workbench role as a client tool. If you have different information, please share it.

    maclochlainn

    7 Sep 12 at 10:22 am

Leave a Reply