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.

[SOLVED] mysql connection

Help for those learning Tcl or writing their own scripts.
Post Reply
M
MUSUL
Voice
Posts: 5
Joined: Mon Apr 26, 2010 4:02 pm

[SOLVED] mysql connection

Post by MUSUL »

Hello i have a big problem,

I try this:

Code: Select all

set db(host) "myhost.com"
set db(id) "user"
set db(pass) "******"
set db(dbase) "bot"

package require mysqltcl 

set db(conex) [::mysql::connect -host $db(host) -port "3306" -user $db(id) -password $db(pass) -db $db(dbase) ]
And i receive this ouput:

[19:54] ::mysql::connect/db server: Access denied for user 'user'@'208.*.*.*' (using password: YES)
while executing
"::mysql::connect -host $db(host) -port "3306" -user $db(id) -password $db(pass) "

Is trying to connect the the local ip (localhost i guess).

How can specify my own IP? All the time is taking 208.*.*.* as mysql IP, and i'm opening from "myhost.com".

Need some help. ty!
Last edited by MUSUL on Mon Apr 26, 2010 5:34 pm, edited 1 time in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Use the appropriate IP for the destination. The IP used by your mysql-library is in fact determined by the routing table of the system.

If you connect to myhost.com, which resolves to 208.aaa.bbb.ccc, then your connection will originate from whatever interface (and thus the IP bound to that interface) which has the shortest path to 208.aaa.bbb.ccc. If this is on the same host, that would be 208.aaa.bbb.ccc.

If you'd like the connection to originate from localhost (127.0.0.1), then you can only connect to that very same IP.
NML_375
M
MUSUL
Voice
Posts: 5
Joined: Mon Apr 26, 2010 4:02 pm

Post by MUSUL »

No, myhost.com is resolving with 84.*.*.*. 208.*.*.* is the IP from my private shell.

So, i wanna connect to myhost.com (external IP), and eggdrop is trying to connect to the shell's IP.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Please don't confuse the IP-part of the access denied-message with where you are connecting to. The fact that it's stating 'user'@'208.aaa.bbb.ccc' means that the connection originated from 208.aaa.bbb.ccc, and that there was no matching user record on the mysql-server with the password you provided.

Most likely then, you are connecting to the correct database server, but failed to set up a valid user account with permissions to connect from your IP (208.aaa.bbb.ccc).
NML_375
M
MUSUL
Voice
Posts: 5
Joined: Mon Apr 26, 2010 4:02 pm

Post by MUSUL »

Omg was using a local mysql account. Now i can :D ty!

I thought that @ip was for the server :p
Post Reply