This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Use Mysql server from Eggdrop

Old posts that have not been replied to for several years.
M
Mad0nna

Post by Mad0nna »

Hello
I'm running:
-Freebsd4.5 (i386)
-mysql Ver 11.15 Distrib 3.23.47, for -freebsd4.5 (i386)
-Eggdrop v1.6.9: 5 users (mem: 88k)
-TCL8.3

I need to access the Mysql server from the eggdrop, and make standard
SQL queries like SELECT, INSERT, UPDATE etc.

I've tried Mytcl, mysqltcl 2 and msql-tcl 1.5, none worked.
If I understand this correctly, there is two ways of enabling the SQL
functionality in the Eggdrop TCL scripts:
-I include the .so file with the mysql->tcl interface (can someone
tell me how to do this exactly ?)
-I patch the TCL lib on the machine. Using the three releases
mentioned above I've tried both ways, a few times, and no luck.

Has anyone had any experience with this and can supply me with an url
to a release proven to work with FreeBSD and Eggdrop, or an
explanation or whatever, I'm really stuck here.

Also, an url to some site offering a download of the newest Mytcl
version would be greatly appreciated, as the release I found on some
russian ftp didn't contain any examples or readme or anyting (the
official site seems to be redirecting me to a counterstrike site) :sad:

Sorry for the long post, thank you in advance :smile:

<font size=-1>[ This Message was edited by: Mad0nna on 2002-04-30 08:04 ]</font>
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Can you list the steps you took, to which led you to the conclusion "They don't work"?

I have used all 3 of the above Tcl packages without fail.

What errors do you get?
How you tried obtaining support for these errors?
How exactly are you trying to load the packages in to Tcl?
Have you sat and read the documentation.
M
Mad0nna

Post by Mad0nna »

I won't bother listing all the steps I've taken so far, so I've started over. I downloaded a fresh copy of mysqltcl-2.0rc11.tar.gz, unpacked, edited Makefile.org and set the following paths:

# paths to -> tcl.h mysql.h
INCLUDE=-I/usr/local/include/tcl8.3 -I/usr/local/include/mysql

These paths are correct to the best of my knowledge. Still, I get this error when i run ./configure (after running about 20 secs):

------
checking for tcl.h... no
configure: error: Can't find tcl.h which is needed to build MySQLTcl. Consult README and
INSTALL to fix it.
--------
I've tried messing around with the parameters it suggests, but no luck.

If the configure script doesn't work, the INSTALL file suggests copying config.org -> config.h and then running "make -f Makefile.org". I've done this, and it resulted in a libmysqltcl.so around 4kb in size. I've copied this to the /usr/local/lib dir (as this is where it was supposed to be copied by the configure script, i think).
When i try to load the libmysqltcl.so from the regular tclsh:
% load /usr/local/lib/libmysqltcl.so
couldn't load file "/usr/local/lib/libmysqltcl.so": Shared object "libnsl.so.1" not found

I'm guessing this is because the configure script never got to do whatever it's doing ?

Is it correct to assume that once i get the libmysqltcl.so working in tclsh, it should be easy to load it in the eggdrop's tcl scripts ?
M
Mordred

Post by Mordred »

Have you tried this TCL-SQL package? Works fine here. With docs etc.

http://www.bluetitan.com/~tdarugar/tcl-sql/
M
Mad0nna

Post by Mad0nna »

Thank you and no I haven't, it looks nice and well documented.
After I edit the Makefile and set the right paths, I try to run "make clean ; make". I get the following error:

[madonna@bsd:~/tcl-sql]make clean ; make
Cleaned
make: don't know how to make obj/sql-mysql.o. Stop

Any suggestions ?
I noticed the package included precompiled versions for lunix and solaris, would it be possible to just download a precompiled one ?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

If it can't find libnsl.so.1, then you should install that library. It should be on your computer already, at /lib/libnsl.so.1, unless you don't have a recent version of glibc installed.

Maybe it's installed in /usr/local/lib instead, for some reason, and your LD_LIBRARY_PATH variable doesn't include that directory. Is /usr/local/lib in your /etc/ld.so.conf? As well as the location of the mysql libs?
M
Mordred

Post by Mordred »

Stdragon is correct. You might also like to check their forums, linked from their main page.

http://groups.yahoo.com/group/tclsql/

It doesnt show much sign of life any more, but I have seen an old thread mentioning similar to your problem.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

As for the mysqltcl package, you might want to follow the all important step, of not just editing the Makefile.org, but ranmining it to Makefile.

It's all well and good editing a file to your needs, but there aint much point unless you expect a program to know whats on your mind.
M
Mad0nna

Post by Mad0nna »

When I set the LD_LIBRARY_PATH (which was previously unset) to:
[bsd:~/madonna]export LD_LIBRARY_PATH="/usr/compat/linux/lib"
which is the path of the libnsl.so.1, but when i try to:

% load /usr/local/lib/libmysqltcl.so
Bus error (core dumped)

and it exits tclsh..

As for the ld.so.conf, i found it in /usr/compat/linux/etc and i edited it and put the path of libnsl.so.1 in it. I seem to be unable to find the mysql libs though.. nothing in /usr/local/lib or /usr/lib. The mysql client & server are both installed. Where can I find them ?
M
Mad0nna

Post by Mad0nna »

As for the tcl-sql package, I got a bit further, but when I try to compile it now I get:

[pluppa@bsd:~/madonna/tcl-sql/tcl-sql]gmake clean ; gmake
Cleaned
cc -c -I/usr/local/include/mysql -I/usr/local/include/tcl8.3/generic -Wall -o obj/sql-mysql.o sql-mysql.cc
cc -c -I/usr/local/include/mysql -I/usr/local/include/tcl8.3/generic -Wall -o obj/sql.o sql.cc
cc -c -I/usr/local/include/mysql -I/usr/local/include/tcl8.3/generic -Wall -o obj/sql-manager.o sql-manager.cc
g++ obj/sql-mysql.o obj/sql.o obj/sql-manager.o -L/usr/lib -lmysqlclient -shared -lg++ -lstdc++ -lm -lgcc_pic -o sql.so
/usr/libexec/elf/ld: cannot find -lg++
gmake: *** [sql.so] Error 1

I saw in the group Mordred linked to ( http://groups.yahoo.com/group/tclsql/me ... threaded=1 ), that this means it can't find the libg++ library.. I've done some searches for libg++ and added the paths I found to the makefile but still the same error. Can someone tell me how to locate the correct path ? Or how to make the compiler find the needed library ?

<font size=-1>[ This Message was edited by: Mad0nna on 2002-05-02 13:16 ]</font>
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

First of all, what OS are you using? It's pretty clear that it's non-standard, or at least that you didn't set up the development environment correctly.

If your OS uses a package-based system for things like the compiler, try getting the latest upgrades to gcc, make, libtool, configure, and libc. See if you can get the packages to install in standard locations, instead of weird stuff like /usr/lib/compat/linux or wherever.

If you don't have a package mechanism... well, maybe install a different OS :) I think you'll find things are a lot easier if you install linux or even windows.

What you really need to do is contact the authors of these libraries you're trying to install. This forum is primarily for eggdrop help. These aren't eggdrop modules you're compiling, they're tcl modules. As such, chances are that nobody here knows very many specifics about them, including odd things you run into when compiling them, especially when you're on an unfamiliar OS.
M
Mad0nna

Post by Mad0nna »

On 2002-04-30 08:03, Mad0nna wrote:
Hello
I'm running:
-Freebsd4.5 (i386)
-mysql Ver 11.15 Distrib 3.23.47, for -freebsd4.5 (i386)
-Eggdrop v1.6.9: 5 users (mem: 88k)
-TCL8.3

I need to access the Mysql server from the eggdrop, and make standard
SQL queries like SELECT, INSERT, UPDATE etc.
As mentioned, those are the versions 'm running. I'll try to update the things you mentioned, and see if it helps. thanx.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

What kind of processor do you have? Usually bus errors are caused by misaligned memory access on strict cpus.

For instance, say you have a structure defined like this:
struct blah {
char flag;
int something;
};

The structure is aligned properly, but when you try to access the "something" variable, that int isn't aligned properly unless your compiler automatically adds padding to the char field.

But on Intel processors, misaligned access doesn't cause a bus error, only a time penalty (2 accesses instead of 1).

I don't know, it might be caused by something else, but I'm just curious.
M
Mad0nna

Post by Mad0nna »

intel pentium 233 with mmx extentions o/
z
zyxep

Post by zyxep »

my friend have FreeBSD and i need mysqltcl where can i find that ?
Locked