0

I tried using the sql-mysql mode but emacs is unable to find the file/directory mysql. However, I can access it from the terminal. How do I point mysql in emacs to /usr/local/mysql/bin/mysql ?

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
ttt
  • 19
  • 2

3 Answers3

4

(setq sql-mysql-program "/path/to/your/mysql")

(setq sql-user "mysql user")

(setq sql-password "password")

(setq sql-server "mysql-server")

(setq sql-mysql-options "optional command line options")

supplying some values to these variables through your .emacs should help your situation.

vpit3833
  • 7,817
  • 2
  • 25
  • 25
2

You can customize the mysql used by SQL mode in emacs.

M-x customize-group [RET] SQL

and update the value for mysql.

ocodo
  • 29,401
  • 18
  • 105
  • 117
1

Your path is probably not being correctly set for emacs sessions. You can check what paths are being searched for executables with C-h v exec-path. A simple way to solve this is to add the needed path entries in your .emacs like so:

(add-to-list 'exec-path "/path/to/your/mysql")
ataylor
  • 64,891
  • 24
  • 161
  • 189