List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 2 2003 8:43pm
Subject:RE: Getting to the shell from mysql> prompt
View as plain text  
At 13:14 -0700 5/2/03, Daevid Vincent wrote:
>This doesn't work for me... However, I could use CTRL+Z (suspend) and then
>fg to get back...

You have 3.25.56, and the \! command was added in 4.0.1.
It's also a Unix-only thing, for any Windows people who might
be reading this thread.

I've listed this command in the MySQL manual now.

>
>[daevid=pts/0]1:12pm@silver:{/home/daevid}> mycrm
>Reading table information for completion of table and column names
>You can turn off this feature to get a quicker startup with -A
>
>Welcome to the MySQL monitor.  Commands end with ; or \g.
>Your MySQL connection id is 12476 to server version: 3.23.56-Max
>
>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
>mysql> \! ls
>ERROR:
>Unknown command '\!'.
>     -> ;
>ERROR 1064: You have an error in your SQL syntax near '\! ls' at line 1
>mysql> \! ls *.sql
>ERROR:
>Unknown command '\!'.
>     -> ;
>ERROR 1064: You have an error in your SQL syntax near '\! ls *.sql' at line
>1
>mysql>
>Suspended
>[daevid=pts/0]1:13pm@silver:{/home/daevid}> fg
>mysql -hlocalhost -uroot crm
>
>mysql> ls
>     -> ;
>ERROR 1064: You have an error in your SQL syntax near 'ls' at line 1
>mysql>
>
>>  -----Original Message-----
>>  From: Curtis Maurand [mailto:curtis@stripped]
>>  Sent: Friday, May 02, 2003 6:47 AM
>>  To: Dan Nelson
>>  Cc: Myhre, Julie; mysql@stripped
>>  Subject: Re: Getting to the shell from mysql> prompt
>>
>>
>>
>>  And I searched for that in the docs yesterday, too.  I
>>  couldn't find it
>>  anywhere.  I searched on the terms "shell," "external," and
>>  "ext."  then
>>  again, I wasn't searching using the website search function.
>>  I was looking
>>  in the table of contents.
>>
>>  hrmmm.
>>
>>  Curtis
>>
>>  On Thu, 1 May 2003, Dan Nelson wrote:
>>
>>  > In the last episode (May 01), Myhre, Julie said:
>>  > > Is there a way to spawn off to the shell from the mysql prompt,
>>  > > either for a quick shell command (like an ls of your current
>>  > > directory), or to stay there and run a couple commands,
>>  then get back
>>  > > to the same mysql session?
>>  > >
>>  > > For example, on a UNIX box, from an Oracle SQL*Plus
>>  prompt I can do:
>>  > > sqlplus>!ls *.sql
>>  > >
>>  > > Or just type the ! and get to my shell.  When I type 'exit' I am
>>  > > returned to that sqlplus prompt.
>>  >
>>  > Try:
>>  >
>>  > mysql> \! ls *.sql
>>  >
>>  > For a plain shell, run "\! sh", or whatever your favorite shell is.
>>  >
>>  >
>>
>>  --
>>  --
>>  Curtis Maurand
>>  mailto:curtis@stripped
>  > http://www.maurand.com


-- 
Paul DuBois
http://www.kitebird.com/
sql, query
Thread
Getting to the shell from mysql> promptJulie Myhre1 May
  • Re: Getting to the shell from mysql> promptDan Nelson2 May
    • Re: Getting to the shell from mysql> promptCurtis Maurand2 May
      • Re: Getting to the shell from mysql> promptStephen Fromm2 May
      • RE: Getting to the shell from mysql> promptDaevid Vincent2 May
        • Re: Getting to the shell from mysql> promptDan Nelson2 May
        • RE: Getting to the shell from mysql> promptPaul DuBois2 May
RE: Getting to the shell from mysql> promptJulie Myhre5 May
  • Re: Getting to the shell from mysql> promptBrian Reichert5 May