作者:元元木樨_669 | 来源:互联网 | 2023-05-18 13:14
IhavebeenusingemacsforwritingprogramsandrecentlyIwanttoexecuteSQLqueriesthroughit,
I have been using emacs for writing programs and recently I want to execute SQL queries through it , I run the following commands and get the following error:
我一直在使用emacs编写程序,最近我想通过它执行SQL查询,我运行以下命令并得到以下错误:
M-x sql-Mysql
then I just press return and then
然后我按回车然后
user:
password:
database:
server:
and I get the error
我得到了错误
" unable to locate sql program mysql "
I have searched for two continuous days and got the suggestions to edit .emacs file but of no use. I am using windows 7.
我已连续两天搜索并获得了编辑.emacs文件但没有用的建议。我正在使用Windows 7。
My init file looks like this :
我的init文件如下所示:
(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))
1 个解决方案