如何加载mysqltlc包?
thufir@mordor:~/tcl$
thufir@mordor:~/tcl$ tclsh mysql.tcl
can't find package mysqltcl
while executing
"package require mysqltcl"
(file "mysql.tcl" line 1)
thufir@mordor:~/tcl$
thufir@mordor:~/tcl$ cat mysql.tcl
package require mysqltcl
set m [mysqlconnect -user root -db mysql -password foobar]
mysqluse $m mysql
foreach res [mysqlsel $m {select host from user} -flatlist] {
puts $res
}
mysqlclose $m
thufir@mordor:~/tcl$
参考:http://wiki.tcl.tk/6051
最佳答案
谢谢,是的,通过安装这个包tcl很好地接受了它。我不知道tcl是怎么做到的。Java使用JAR、maven、ivy等,而ruby使用gems等。
thufir@tleilax:~/tcl$
thufir@tleilax:~/tcl$ dpkg -s mysqltcl
Package: mysqltcl
Status: install ok installed
Priority: optional
Section: database
Installed-Size: 114
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Version: 3.052-1
Depends: libc6 (>= 2.4), libmysqlclient18 (>= 5.5.24+dfsg-1), tcl (>= 8.6.0-2) | tclsh
Description: interface to the MySQL database for the Tcl language
The mysqltcl package provides a Tcl interface to the MySQL database system.
Within Tcl you've a range of Tcl commands and a global Tcl array available
to access the database server.
Written in C mysqltcl uses the official MySQL C-API so that almost all
Tcl commands correspond to MySQL C-API functions.
Original-Maintainer: Sven Hoexter <[email protected]>
Homepage: http://www.xdobry.de/mysqltcl/
thufir@tleilax:~/tcl$
thufir@tleilax:~/tcl$ tclsh mysql.tcl
%
127.0.0.1
::1
localhost
localhost
tleilax
thufir@tleilax:~/tcl$
(在另一台机器上)
如果有更好或不同的方法来安装tcl包,请务必这样说。
关于mysql - 找不到软件包mysqltcl-如何安装该软件包?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36452905/