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.

Mysqltcl [Can't connect to local MySQL...]

Help for those learning Tcl or writing their own scripts.
Post Reply
b
ben
Voice
Posts: 4
Joined: Sat Jun 16, 2007 5:00 pm

Mysqltcl [Can't connect to local MySQL...]

Post by ben »

So I did (debian):
apt-get install mysqtcl

Was happy finally having mysqltcl. Though it didnt last long. Once I try to connect to mysql i get:

Tcl error [sdt:chat]: mysqlconnect/db server: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

though the problem is have apache running with a site using mysql and it connect without a problem to mysql, BUT through socket:
/opt/lampp/var/mysql/mysql.sock

So, how to force mysqltcl to connect same ?
Im someone opposite to a tcl-guru, so forgive me.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

if you show us how your using mysql::connect then maybe we can help.

If the port is the default (3306), dont add the -port option, if the mysql server is local, put -host localhost instead of 127.0.0.1. I find it best to put the -db option first, followed by -user -password and then -host.

I found that it doesn't work some ways, but it always seems to work in that order for me...

Also, i donlt recommend using the -socket option.

Hope this helps :)
r0t3n @ #r0t3n @ Quakenet
b
ben
Voice
Posts: 4
Joined: Sat Jun 16, 2007 5:00 pm

Post by ben »

Thats how I have:
set sqlhand [mysqlconnect -host $sdt(hostname) -user $sdt(username) -password $sdt(password)]
mysqluse $sqlhand $sdt(database)

And I still get:
Tcl error [sdt:chat]: mysqlconnect/db server: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Even if I do, as you recommended:
[mysqlconnect -user $sdt(username) -password $sdt(password) -host $sdt(hostname)]
Post Reply