I use R interactively from Org-mode – the keybinding C-x ' from within an R code-block launches an interactive R session using ESS.
When I press C-x ' from inside an SQL code block, it sends the code block to an SQL-mode buffer, but it is not clear how I can then send a query to MySQL.
Can I do this with MySQL?
First, include the code from the accepted answer to How can I get emacs sql-mode to use the mysql config file (.my.cnf)? in your
.emacsSecond, use
C-x 'from within the SQL code block to send the code block to an SQL mode bufferOnce the code block has been sent to a buffer in SQL mode, launch your MySQL session using
M-x pool-a(or whatever connection you wish to use).At this point, the standard SQL keybindings can be used: