Can I use MySQL interactively from an SQL block to org-mode?

I use R interactively from Org-mode - keybinding Cx ' from the R-code block starts an interactive R session using ESS.

When I press Cx ' inside the SQL code block, it sends the code block to the SQL-mode buffer, but it is not clear how I can send the query to MySQL.

Can I do this with MySQL?

+8
sql mysql emacs org-mode
source share
1 answer

First, include the code from the accepted answer on How can I get the sql mode of emacs to use the mysql configuration file (.my.cnf)? in your .emacs

Second, use Cx ' from the SQL code block to send the code block to the SQL mode buffer

Once a block of code has been sent to the buffer in SQL mode, start a MySQL session using Mx pool-a (or any other connection you want to use).

At this point, you can use standard SQL bindings:

 Cc Cc send paragraph Cc Cr send selected region Cc Cb send entire buffer Cc Cs send string 
+5
source share

All Articles