cannot connect to mySQL server on linux machine
Added by Shunming Fang about 11 years ago
I tested leginon module on window xp after I install useing python command line windows, after I import leginon module, the I try to import start module, it raised error: leginon.project.notComnnectedError(2003, "can't connect to mySQL server on 'XXXX'), I can ping the machine 'XXXX' from microscope windows pc which install leginon. and in linux machine "XXXX', I can access website using 'XXXX'.
What is wrong ?
Shunming
Replies (12)
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
Sunming,
Try using information in Ports_used_by_Leginon to check if you have the necessary ports opened if you want to specify them. Pinging only tells you that the computer is connected to the network.
RE: cannot connect to mySQL server on linux machine - Added by Shunming Fang about 11 years ago
I tried all the way to debug what is wrong with network communication problems. Ping works, tracert works, but when run test1.py in pc and test2.py in linux, in PC windows, it show warning: localtransport client add failed, then error: ERROR sending request. I also debug socket connection by python, it show error: 10065, no route to host. I check pc's firewall, it was disable. I don't know why? I use intranet to communicate between linux processing server, database server with window pc microscopy machine. I use switch to share intranet. Anyone can help me figure it out?
Thanks a lot
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
Are your host files set up according to
http://emg.nysbc.org/projects/leginon/wiki/Installation_on_the_microscope_computer
Add the IP address and matching hostname of the microscope and digital camera computer in your host file on the main Leginon computer, and vice versa.¶
Give an example of what you have set on both sides so that we can see exactly what it is like. It will also be more helpful if you take screenshot of the test1.py output because we can see which part works which part doesn't.
Thanks.
RE: cannot connect to mySQL server on linux machine - Added by Shunming Fang about 11 years ago
I tested ping by host name and tracert, it works fine. but test1.py is not. and also I check network connection in pc, I found there are 3 network connections. I wondered whether it is NIC causing the problems
Thanks
Shunming
test1.png (38.2 KB) test1.png | |||
test1ifconfig.png (43.6 KB) test1ifconfig.png |
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
Sunming,
Have you run test1.py on your linux machine and try connecting to it from Windows PC with test2.py? Your test1 log shows that it actually accepted the connection from linux ( since the linux hostname showed up). But as it continues to send data as a response, that is when the exception appears. It may be that linux computer is blocking the connection with a firewall.
By the way, The message in test1.py output that says
MANAGER: test2.your.edu:49153 connecting to manager... WARNING localtransport client add failed
This particular warning is normal since the manager it is connected to is not local.
RE: cannot connect to mySQL server on linux machine - Added by Shunming Fang about 11 years ago
Thanks, It make sense. I disable linux firewall, it can see each. Now the question is when I launch legion client, it is still closed immediately. I used python command line to debug, it showed error :(1130, "Host '****' is not allowed to connect to this mySQL server").
It seems I need to add a user in mySQL server? Is it right?
Thanks
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
Google "host not allowed to connect to this mysql server" and you will find the answers. MySQL server as installed does not allow others to connect. You will need to add the hosts. It is not as much a user issue. You should set up a user for the leginon/project databases nevertheless.
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
Take it back. It is both.
1. You need to grant mysql user with specified host access to the database it needs to connect to, as in
Database_Server_Installation Install MySQL step 10 option 3.
2. You need to add the IP and matching hostname to /etc/hosts file if that alone does not work. Since you are able to ping, it is likely this part is o.k. However, a short-handed name needed to be assigned on my computer like this to get it work.
192.168.22.10 mycomputer.mine.edu mycomputer
because, in my case, the remote computer is identified as only mycomputer in the equivalent error message you had.
RE: cannot connect to mySQL server on linux machine - Added by Shunming Fang about 11 years ago
Thanks a lot.
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
Does this mean that you can now connected remotely?
RE: cannot connect to mySQL server on linux machine - Added by Shunming Fang about 11 years ago
Yes. I create a remote user based on pc host name and start leginon client, it open it but hte leginon client GUI didn't show many things. I don't know which part is wrong? Tecnai or gatan ccd camera?
The attachment is the screenshot from leginon client.
Shunming
RE: cannot connect to mySQL server on linux machine - Added by Anchi Cheng about 11 years ago
It is normal to see little on the clients. They are slaves until the main (linux box) put nodes on it.
I suppose you are at wiki page Start_Leginon_at_your_main_working_station_remotely
Just look at What is next to see what you do next.