LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   myODBC connect errors (https://www.linuxquestions.org/questions/linux-software-2/myodbc-connect-errors-191167/)

bwreath 06-08-2004 01:29 PM

myODBC connect errors
 
Hi,

I would appreciate help on the following.
I have installed myODBC 3.51 on my Windows 2000 computer.
I am trying to connect mysql database on a linux server.
I configured the ODBC data source adminstrator from the
administrative tools.
After trying to add a new data source and entering all of the appropriate
fields I get the error "Lost connection to MySQL server during query"
The error shows up immediately.
The only change I made was to change the port to 22.

I use port 22 when I try to make a putty connection or WinSCP.
I have no problems connecting to the server when using this method.
I also don't have any problems connecting to the database after connecting with putty or using mysqlcc.

I tried to used the default method of using port of 3306 and I get
an error as well "Can't connect to MySQL server on ..."

I am not sure what the problem is?

thanks very much.

david_ross 06-08-2004 01:32 PM

Port 22 is used for your ssh server and not MySQL. It should be running on port 3306.

Is mysql running?
netstat -nlp

Are there any firewall rules blocking you:
iptables -nL

bwreath 06-08-2004 04:00 PM

Hi,

thanks for your response.

Mysql is running. I ran the netstat command and found mysql.sock to be listed.
I ran a ps -ef | grep mysql | grep -v grep command and mysql was listed.

Maybe it is as you say firewall rules?
If it is one of the rules what rule could I add to allow myodbc connection for computers in our
domain ie. any computer with ip address 123.456.78.XX?

thanks very much

The iptables command gives the following rules

Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Lokkit-0-50-INPUT (2 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 flags:0x16/0x02
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 flags:0x16/0x02
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT udp -- ipaddressofcomputersinourdomain 0.0.0.0/0 udp spt:53
ACCEPT udp -- ipaddressofcomputersinourdomain 0.0.0.0/0 udp spt:53
ACCEPT udp -- ipaddressofcomputersinourdomain 0.0.0.0/0 udp spt:53
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x16/0x02 reject-with icmp-port-unreachable
REJECT udp -- 0.0.0.0/0 0.0.0.0/0 udp reject-with icmp-port-unreachable

david_ross 06-09-2004 12:33 PM

The firewall rules look fine. Was mysql listening on port 3306?
netstat -nlp | grep 3306

bwreath 06-09-2004 02:41 PM

Glad that you think the firewall rules look okay. I was concerned about
the line REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x16/0x02 reject-with icmp-port-unreachable

I ran the command netstat -nlp | grep 3306
and got the following output.


tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3072/


I'm not sure what the problem is.

bwreath 06-10-2004 08:56 AM

Hi,

My problem was related to the firewall rules. I lowered the level of sercurity momentarily
to see if it was the problem. Once I did that I was able to make a successful odbc connection.

Thanks for getting me to think in the right direction.

Now I want to maintain as high a security level as possible while also allowing odbc connections
from allowable ip addresses. My original criteria was to only allow www and ssh connections from allowable
ip addresses.

I'm not sure how to modify the iptable rules.

thanks.


All times are GMT -5. The time now is 11:12 AM.