Home > Database > Mysql Tutorial > body text

使用Artful MySQL模块报错

WBOY
Release: 2016-06-07 16:25:28
Original
940 people have browsed it

使用Artful MySQL模块出错 总是报错: root@gitlab:/opt# newlispnewLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h (load /opt/mysql.lsp)ERR: string expected in function import : libmysqlclient 结果发现是Ubuntu 12.04下安

使用Artful MySQL模块出错

总是报错:

root@gitlab:/opt# newlisp
newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (load "/opt/mysql.lsp")

ERR: string expected in function import : libmysqlclient
Copy after login

结果发现是Ubuntu 12.04下安装的libmysqlclient.so的路径不正常,用 find / -name查找, 将真实路径添加到mysql.lsp文件中

;;; Find the libmysqlclient library on this system                                                                                               
(setf is-64-bit nil)
(let ((paths '("/usr/lib/libmysqlclient.so"
               "/usr/lib/x86_64-linux-gnu/libmysqlclient.so" ;;here
               "/usr/lib64/mysql/libmysqlclient.so"
               "/usr/local/mysql/lib/libmysqlclient.dylib"
               "/opt/local/lib/libmysqlclient.dylib"
               "/sw/lib/libmysqlclient.dylib")))
Copy after login

好了,加载模块成功:

> (load "/opt/mysql.lsp")
MAIN
Copy after login

可是连接数据库报错,原来是没有跟上newllisp 10.6.0的步伐。 现在获取最新的未测试的代码:

git clone https://gist.github.com/10490156.git
Copy after login

> (load "/opt/10490156/mysql.lsp")                                                                                                               
MAIN                                                                                                                                             
> _MYSQL:is-64-bit                                                                                                                               
true                                                                                                                                             
> (setf db (Mysql))                                                                                                                              
(Mysql 10710960)                                                                                                                                 
> (:connect db "localhost" "root" "770328" "mysql")                                                                                              
true                                                                                                                                             
> (:query db "show tables")                                                                                                                      
(MysqlResult 10812080)                                                                                                                           
> (exit)
Copy after login

似乎可用了,具体还要等作者完成测试。

http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4502

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!