找不到包mysqltcl - 我该如何安装这个包?

时间:2016-04-06 13:40:00

标签: mysql linux database tcl static-libraries

如何加载 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

1 个答案:

答案 0 :(得分:0)

谢谢,是的,通过安装包tcl很好地把它拿起来。我不知道这对tcl有什么作用。 Java使用JAR&s,maven,ivy等,而ruby有宝石......等等。

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 <ubuntu-devel-discuss@lists.ubuntu.com>
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 <hoexter@debian.org>
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软件包有更好或更好的方法,请说明。

相关问题