forums › forums › SQLyog › Using SQLyog › Connection To Localhost Failed
- This topic is empty.
-
AuthorPosts
-
-
December 2, 2005 at 4:43 pm #9385vvvvMember
i am trying to start synchronization on debian gnu/linux
i use the simpliest configuration. the config is here:
job version=”4.0″>
10.5.1.1 tmp_backup 4444 3306 lms localhost root a 3306 lms when i lounch #./sja sja-sample1.xml i get:
SQLyog Job Agent Version 5.0
Copyright © Webyog Softworks Pvt. Ltd.. All Rights Reserved.
Sync started at Fri Dec 2 17:34:44 2005
Could not connect to TARGET MySQL server
Check sja.log for complete error details.
the sja.log:
Sync started at Fri Dec 2 17:34:44 2005
Could not connect to TARGET MySQL server
user root@localhost is absolutely valid: i can log in to mysql using #mysql -uroot -pa
what have i done wrong?
when i do that on remote machine (making mysql listening on 10.5.1.3:3306), connection seems to be done;
any efforts to start synchronization on localhost are unsuccessful so far.
thanks in advance,
iv
-
December 2, 2005 at 5:14 pm #19934peterlaursenParticipant
We have a few FAQ entries about this:
http://www.webyog.com/faq/23_36_en.html
http://www.webyog.com/faq/16_67_en.html
… but I shall not claim it is complete.
We have seen this *nix/localhost issue a few times, but people never reported back if and how they solved their problem. 🙁
What does your hosts' file say?
I don't know Debian (I use SUSE) so I can't help you to find it!
But I believe the info is available from some KDE module on Debian too.
Do you have any sort of nameserver running ?
A clever guy remarked once that the 'localhost' mess-up was caused by certain mailer programs when running in server mode. It could also be problems with a ip-forwarding/backlooping setting (any router software installed ?). Firewall ??
Did you try to use the ip 127.0.0.1 instead of 'localhost'.
Or the ip of the machine on the network.
I am also able to use the SAMBA/Netbios name (I am running a SAMBA server in 'primary domain-controller mode'), but implementation may differ with various *nix versions. But on my Linux box, Netbios name simply gets mapped to ip 127.0.0.1 in the hosts' file just like 'localhost' does.
I am 99% sure that it is a problem that the system cannot resolve the meaning of 'localhost'. Are other clients able to connect to MySQL on 'localhost'? You can try MySQL Administrator or MySQL Query Browser (connect with tcp-ip, not through socket file if both options are available!). And SQLyog for Windows runs under Wine too – you can try this too http://www.webyog.com/faq/5_71_en.html. But I don't think any of them will connect to 'localhost'.
No solution. But a few things that you could check and think about …
-
December 4, 2005 at 2:22 pm #19935vvvvMember
hi peter
i've checked whether 'localhost' is resolving, and it is. here is my /etc/hosts:
127.0.0.1 localhost.localdomain localhost
127.0.1.1 darkstar
darkstar:/home/iv/installs/sja# ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.081 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.068 ms
i tried to change 'localhost' to 127.0.0.1, 127.0.1.1 and even 'localhost.localdomain' – nothing helped.
and no, it's not a router.. i have only 2 interfaces:
1: eth0:
mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:05:5d:d9:41:0d brd ff:ff:ff:ff:ff:ff
inet 10.5.1.3/25 brd 10.5.1.127 scope global eth0
2: lo:
mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
darkstar:/home/iv/installs/sja# cat /proc/sys/net/ipv4/ip_forward
0
i'm not sure if any of client applications use tcp/ip connection. i run phpmyadmin, and if it does, there is no problem with connecting – phpmyadmin works perfectly.
with high probability i can solve this problem by making mysql listening on a dedicated ip address, probably even on dummy interface – but i don't like this solution.
you wrote sth about a sock, and i saw many mentions about this, but default installation doesn't contain any config samples with this option. if i could connect to server via mysql.sock i would be happy :). do you have any idea how to do that?
btw, if you are a developer (or you know someone of them 😉 ) – sja.log is absolutely unuseful in this case. it would be a good idea to add some logs, for example “can't connect to database” or “the user/password is wrong” – because if user/password is wrong, the log is the same – 'Could not connect to TARGET MySQL server'..
best regards
iv
-
December 4, 2005 at 2:44 pm #19936peterlaursenParticipant
This is the problem I believe
Quote:127.0.0.1 localhost.localdomain localhostdid you read the FAQs that I linked to?
one of them described the 'localhost.localdomain' issue
try reversing things to read 127.0.0.1 localhost localhost.localdomain
also try testing with 127.0.0.1 localhost only
and put the two in each their line!
like
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
(I never saw two URL's on one line in a hosts' file before!)
I think you are turning things upside down when you write:
Quote:i tried to change 'localhost' to 127.0.0.1. You 'map' or 'assign' 'localhost' to ip '127.0.0.1'
127.0.0.1 is ALWAYS your local machine. 'localhost' is only if host file says so and it is read correctly!
This is not relevant either I believe
Quote:phpmyadmin works perfectlyphpMyAdmin probably connects through socket, not TCP-IP.
did you try using '127.0.0.1' as host name instead of 'localhost' in the jobfile ??
and did you try the ip on the network ?
BTW: We agree that there should be more logging options! But when not even connection is established there is nothing to log here anyway, I am afraid.
yeah … I am a developer .. I wrote 48 lines of code 17 years ago. In PPPPL (Peters Private Personal Programming Language), but neither Microsoft, IBM nor Sun would release the API, so I never had it tested! But I still believe it was great 😛
-
December 4, 2005 at 2:52 pm #19937peterlaursenParticipant
And …
did you try another client (such as MySQL Administrator) to check whether this one is able to connect on TCP-IP/localhost
-
December 4, 2005 at 3:06 pm #19938peterlaursenParticipant
And …
did you try another client (such as MySQL Administrator) to check whether this one is able to connect on TCP-IP/localhost
And more
'localhost.localdomain localhost' is not a valid URL at all! ther can't be blanks in an URL. 'localhost.localdomain localhost' get interpreted as 'localhost.localdomainlocalhost' . That will be solved by putting them in each their line!
You can map as many URL's to ip 127.0.0.1 as you like – but only one per line!
If you have a webserver running then you can try if you can connect to it with [url=”http://localhost”%5Dhttp://localhost%5B/url%5D as the URL. If you can't then your computer does not know any 'localhost'.
-
December 5, 2005 at 4:52 am #19939RiteshMember
Improvement of sja logging is in our TO-DO list. This issue seems to be TCP/IP problem.
BTW, we don't support connection through sockets.
-
December 5, 2005 at 4:26 pm #19940vvvvMember
hi there 🙂
to be sure there is no problem with my /etc/hosts i change 'localhost' to 127.0.0.1 in my sja config and it looked like this:
10.5.1.1 tmp_backup 4444 3306 lms 127.0.0.1 root a 3306 lms and got the same:
./sja config
SQLyog Job Agent Version 5.0
Copyright © Webyog Softworks Pvt. Ltd.. All Rights Reserved.
Sync started at Mon Dec 5 15:51:03 2005
Could not connect to TARGET MySQL server
Check sja.log for complete error details.
mysql-admin works.
changing /etc/hosts to
127.0.0.1 localhost
didnt help.
no doubt, the problem is not in wrong resolving of 'localhost'.
i made it work.. somehow. i don't like the way how.
add external ip, no metter on which phisical devise:
#ip a a 10.10.10.10/32 dev dummy0
#ip l s dev dummy0 up
force mysql listen on this ip. change /etc/mysql/my.cfg:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 10.10.10.10
#
(in order to chech if it works:)
darkstar:/home/iv/installs/sja# lsof | grep -i listen
mysqld 6579 mysql 3u IPv4 10075 TCP 10.10.10.10:mysql (LISTEN)
now create a mysql user whith apropriate previleges. i just copied my 'root'@'localhost' to 'root'@'%'
and change sja config:
10.5.1.1 tmp_backup 4444 3306 lms 10.10.10.10 root a 3306 lms at this point i can connect to both source and target servers. but something odd appeared
look here:
darkstar:/home/iv/installs/sja# ./sja config
SQLyog Job Agent Version 5.0
Copyright © Webyog Softworks Pvt. Ltd.. All Rights Reserved.
Sync started at Mon Dec 5 16:35:04 2005
Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`tariffs` 21 21 0 0 No change
`tariffs` 21 21 0 0 No change
`timestamps` 15 15 There was an error while execute a query. The query and the error has been logged in the log file.`timestamps` 15 15 There was an error while execute a query. The query and the error has been logged in the log file.`userassignments` 1709 1709 0 0 No change
`userassignments` 1709 1709 0 0 No change
sja.log:
Sync started at Mon Dec 5 16:35:04 2005
Error No. 1142
INSERT command denied to user: '[email protected]' for table 'timestamps'
you can say “previleges”. ok, i intentionally didn't allow user 'tmp_backup'@'%' to make any inserts and updates, only selects on the source server. so it looks like sja try to change both source and target databases? is it a bug or i don't uderstand something? why the source database has being changed?
best regards
iv
-
December 5, 2005 at 5:00 pm #19941peterlaursenParticipant
Thanks for your report.
I'll try to understand that and write up our FAQ accordingly!
I don't understand exactly what you write on the privilege problem on table 'timestamps'
If the error message relates to the source: that is strange! Did you specify a one-way sync?
NB: Edited!
-
December 5, 2005 at 5:09 pm #19942peterlaursenParticipant
I think I got it.
You have this in the jobfile:
Code:You specified a two-way sync. Try 'no' instead of 'yes'.
There must some data in 'timestamp' table that exist in target that don't exist in source. With a two-way sync they will be written to the source. Was that it?
-
December 5, 2005 at 5:38 pm #19943vvvvMemberpeterlaursen wrote on Dec 5 2005, 06:09 PM:I think I got it.
You have this in the jobfile:
Code:You specified a two-way sync. Try 'no' instead of 'yes'.
There must some data in 'timestamp' table that exist in target that don't exist in source. With a two-way sync they will be written to the source. Was that it?
[post=”8112″]<{POST_SNAPBACK}>[/post]yes it was. wow. thanks a lot!!
-
-
AuthorPosts
- You must be logged in to reply to this topic.