|
Re: Stuck & confused (vim and mysql): msg#00032editors.vim.mac
If you in a mysql command shell, you can use \e to launch whatever is is defined in your $EDITOR (vim, i hope) and edit command - these are then submitted as if type on the command line - sometimes it seems to need an extra ; after you ZZ or :wq out of vim, Alternatively (what I do) is run: mysql mydatabsae < mycommand.sql from a command promp in another window - i.e. if I had just saved an SQL file 'update.sql' and wanted to run it against database 'davep' my command would be 'mysql davep < update.sql' (take the quotes off ... ) on a mac, option n rotates beween terminal sessions very nicely - I do the same thing in kde konsole with shift - arrow. you could do a control-Z in vim to suspend oyu vim session, then fg to bring vim back to the foreground ... but I find multiple console sessions to be quicker ... also ... if your workstation in secure, you can store your user id and password in ~/.my.cnf - so you do not need the -p ... for example: davep@htpc:~/audio]$ cat ~/.my.cnf [client] #comments are #'s #this is my password user="davep" password="notreally" # grant insert,select on cdr.* to 'r0ckyCDr'@'%' identified by PASSWORD 'notlikely'; #user="r0ckyCDr" #password="notlikely" regardless of password ... you can use the same command environment against a mysql database on a remote server by including a -h switch ... mysql -h davesdb.kinaole.org davep < update.sql ... would run my local sql file against database davep on my remote mysql server ... and display outuput on my local terminal Hope this helps. aloha, dave |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Stuck & confused: 00032, Benji Fisher |
|---|---|
| Next by Date: | Open in a new tab: 00032, Jorge Ferrando |
| Previous by Thread: | Financial report ICCF availablei: 00032, Bram Moolenaar |
| Next by Thread: | Open in a new tab: 00032, Jorge Ferrando |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |