| View previous topic :: View next topic |
| Author |
Message |
MUSUL Voice
Joined: 26 Apr 2010 Posts: 5
|
Posted: Mon Apr 26, 2010 4:07 pm Post subject: [SOLVED] mysql connection |
|
|
Hello i have a big problem,
I try this:
| Code: | 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 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Apr 26, 2010 4:42 pm Post subject: |
|
|
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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
MUSUL Voice
Joined: 26 Apr 2010 Posts: 5
|
Posted: Mon Apr 26, 2010 5:00 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Apr 26, 2010 5:22 pm Post subject: |
|
|
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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
MUSUL Voice
Joined: 26 Apr 2010 Posts: 5
|
Posted: Mon Apr 26, 2010 5:34 pm Post subject: |
|
|
Omg was using a local mysql account. Now i can ty!
I thought that @ip was for the server :p |
|
| Back to top |
|
 |
|