我一直在使用 emacs 编写程序,最近我想通过它执行 SQL 查询,我运行以下命令并得到以下错误:
M-x sql-Mysql
然后我就按return然后
user:
password:
database:
server:
我得到了错误
" unable to locate sql program mysql "
我已经连续搜索了两天,得到了编辑 .emacs 文件的建议,但没有用。我正在使用 Windows 7。
我的初始化文件如下所示:
(setq sql-connection-alist
'((pool-a
(sql-product 'mysql)
(sql-server "1.2.3.4")
(sql-user "me")
(sql-password "mypassword")
(sql-database "thedb")
(sql-port 3306))
(pool-b
(sql-product 'mysql)
(sql-server "1.2.3.4")
(sql-user "me")
(sql-password "mypassword")
(sql-database "thedb")
(sql-port 3307))))
(defun sql-connect-preset (name)
"Connect to a predefined SQL connection listed in `sql-connection-alist'"
(eval `(let ,(cdr (assoc name sql-connection-alist))
(flet ((sql-get-login (&rest what)))
(sql-product-interactive sql-product)))))
(defun sql-pool-a ()
(interactive)
(sql-connect-preset 'pool-a))