Connection string with odbc connector - odbc

I am getting error
ERROR [08S01] [MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060.
While using connection string
"DRIVER={mysql odbc 5.1 Driver};SERVER=204.11.58.166;DATABASE=dbname;UID=uid;PASSWORD=uid;OPTION=3;"
So, please guide me how to solve it.
Thanks
Ravi

What MySQL version are you using ? ( To see the version you can use 'SELECT VERSION();' )
Is MySQL 64b or 32b ?
What is your OS ?
Try to update to ODBC 5.2, see on dev.mysql.com -> download -> conectors
Roberto Novakosky
Well I already have this in 3 situations
1) I was using old version of connection on Delphi, and with MySQL installed on Linux. I did update of my components and the connection was OK. (similar message)
2) In a remote application I used 'localhost' inside string connection, when must be the IP of server, on server works OK, but when I use from remote host this problem occurs. resolved with the real IP. (similar message)
3) In my LAN, the port 3306 was redirected to other machine, so when I tried to connect an outside server, the response connection was wrong. the message was exactly as yours. As, we can't to change the port of MySQL of outside server (that was 3306), I changed the port of my local MySQL server to 3307 and removed from my router the redirect over 3306. It was with conflict, see: I need to use 3306 from outside and it need to respond to my machine, the router hindered the connection ...
Good luck

Please refer this thread
and this site for detailed explanation

Related

Snowflake - ERROR [HY000] [Snowflake][Snowflake] (4)

ERROR [HY000] [Snowflake][Snowflake] (4)
We are running ODBC on a Windows 10 computer. I have posted an image of the error messages below. We are also NOT using a proxy server.
enter image description here
You are connecting from behind a Proxy server, the name of which the driver is not able to resolve.
Try giving the IP address of the proxy server. Check
https://docs.snowflake.com/en/user-guide/odbc-parameters.html#connecting-through-a-proxy-server
for deatails on how to connect.
get the latest odbc driver
Change registry setting in windows to set ssl_default=true,
https_proxy environment variable with proxy serve:port
finally you would have to allow all the url that is emanating from that server to internet. There will be url's to snowflake computing and s3 aws urls while you invoke odbc different from web UI for querying.
Some systems have proxy settings in their environment; this is not documented on the odbc description on the Snowflake website.
So, if the other solution don't work, check this out.
I had the same issue and it was solved by taking out "https://" from the beginning, so that it will be treated as a server as opposed to a URL.

ORA-12541: TNS: no listener in SSIS

We have oracle oledb connections in SSIS packages that are working well on windows server 2008.
We moved them to windows server 2012 and installed the needed softwares. We installed oracle client (oraoledb driver), moved tnsnames.ora, ldap.ora and sqlnet.ora to %Oracle_Home%\Network\admin path, add %Oracle_Home% and %Oracle_Home%\bin to path variable.
But on server 2012 oracle connections are giving this error ORA-12541: TNS: no listener. Where as on server 2008 same oracle connections are working fine.
Looked so much across internet but found these solutions:
Check tnsnames.ora
Check listener is running
Check path variable contain oracle home, oracle_home\bin
I don't see a problem with tnsnames.ora because same file is present on both window servers. Correct path variables are also set. Listener is also running (since SSIS on server 2008 is connecting). And I am able to ping oracle db server from both machines.
Can anyone suggest anything that we may try.
To put a formal answer in here.
Basic troubleshooting steps with SSIS:
Use the database native tools to check connectivity
In this case for Oracle that is SQLPLUS.EXE
If you have an issue with native tools then it isn't an SSIS issue
Check that you can resolve the host by using PING <hostname>.
If that doesn't work try PING <ip address>
If ping works, check the port with TELNET <host> <port>
If that doesn't work, either the service is not listening or you need to get your network guys to open the port
This goes for any network service
i.e.
SQL Server (default port 1433)
a web server (default port 80 for unencrypted comms)

Create ODBC connection to MariaDB (Localhost)

I have set up a webserver (OS Raspbian, Apache, MariaDB) and now I want to read the database into Qlik Sense (on my desktop PC).
If I want to create a new ODBC connection in Windows, I get the following error message:
"[ma-3.1.4] Can't connect to MySQL server on 'localhost' (10061)"
I am using the "MariaDB ODBC 3.1 Driver". The specified user has all rights.
Do you have any idea where the error is? I am doing this for the first time. Please let me know if you are missing crucial information.
Greetings

AS/400 DDM service not running

I wanted to make a ODBC connection from Windows PC to AS/400 DB2 server and I wrote a VBA program. But I got the following error.
Remote port could not be resolved
Then, I checked the status of server with CWSPING and got the result below:
I - Verifying connection to system 192.168.1.2...
I - Successfully connected to server application: Central Client
I - Successfully connected to server application: Network File
I - Successfully connected to server application: Network Print
I - Successfully connected to server application: Data Access
I - Successfully connected to server application: Data Queues
I - Successfully connected to server application: Remote Command
I - Successfully connected to server application: Security
E - CWBCO1011 - Remote port could not be resolved
E - CWBCO1008 - Unable to connect to server application DDM, returned 8407
I - Successfully connected to server application: Telnet
W - CWBCO1015 - Connection verified to system 192.168.1.2, but there were warnings
This means DDM service is not working on the server. ODBC connection requires DRDA, which runs upon DDM service, so I think running DDM service is the key to make ODBC connection. So I tried STRTCPSVR *DDM command but got the result below
*DDM not valid for parameter SERVER
And also tried CHGDDMTCPA AUTOSTART(*YES) PWDRQD(*YES) command, but got an error and I got stuck.
Command CHGDDMTCPA in library *LIBL not found
Does anyone have an idea of enabling DDM server on AS400?
Server: IBM AS400
OS version: V4R1
Try STRHOSTSVR *DATABASE.
STRHOSTSVR is used to start servers associated with IBM i Access and i Access Client Solutions.
STRTCPSVR is used, in general, to start servers associated with TCP/IP like FTP, Telnet, etc. Except the HTTP Server which is started via the Web Administration site at http://<server>:2001.
Additionally to the answer from #jmarkmurphy:
You can easily check netstat *cnn for open ports.
There is actually a tcpsvr named *ddm but that isn't used with ODBC.
ODBC-Access only needs host server *database. There aren't any further requirements for host servers.
For checking which services are started at tcp startup time, use strfdu, option 5 with the file qusrsys/qatocstart. From there you can easily view and change what should be started and what not.
Finally, I got connected by using JDBC. The summary of what I found is as follows:
ODBC seems using DRDA(port 446) but the server does not have DRDA/DDM service
OLEDB seems connecting Data Access(port 8471) but issued unknown error
JDBC also connection Data Access(port 8471) and it worked!
The first error I encountered when using ODBC is "Remote port could not be resolved". What happened behind this seems as follows:
ODBC asked Server Mapper(port 449) to find DRDA port(it may change on a server)
Server Mapper could not find DRDA port because the server has no DRDA service
ODBC showed "port not resolved" error
Then, I tried OLEDB this time. It checked user/password correctly but issued unknown error. When I put incorrect password, it showed "password is incorrect", which means OLEDB successfully log on to the server but got some error after sign on.
The last, I used JDBC and successfully connected! Generally, the connection url is like "jdbc:as400://" but it showed error. Using trace of JDBC, it seems to have problem on sign on to the server. So I changed the url to "jdbc:as400://:8471", then I finally connected. Looking into trace, it directly access to port 8741 and send user/password and get connected. I don't know the detail, but it worked!
Appreciated for your help!

Unable to connect to Oracle 12c from client machine

I have spent 3 days now trying to figure out why I can't connect to my Oracle 12 database from a client machine. I have read lots of articles and Googling around but haven't been able to find a solution yet. I have tried everything possible and know of already. So I am hoping someone maybe able to point me in the right direction.
Here are some details:
Win7 x64 with Oracle 12c installed.
Windows Server 2012 R2 (client, yes this setup isn't ideal. will explain why later).
Windows Server 2012 R2 (domain controller)
All machines are VM's and part of a domain.
All VM's are running under ESXI 6.0
I can do the following without any issues:
Logon to oracle server.
ORCL is my oracle isntance (global database identifier).
6.1 run tnsping orcl
6.2 lsnrctl status (up and running)
6.3 stop and restart the listner service from the Windows Services snap-in.
6.4 sqlplus system/xyz#orcl
Connects w/o any problems.
6.5 Oracle SQL Developer can connect to ORCL
6.6 can ping client machine.
However I CAN NOT do the following:
Logon to client machine
7.1 copied tnsnames.ora from oracle server to this client machine and placed under [ORACLE_HOME]\network\admin where it should be. replaced "localhost" with the oracle sserver IP.
7.2 Using sqlplus system/xyz#orcl or Oracle SQL Developer to connect
I get TNS: no listener found.
7.3 can ping oracle server.
7.4 tnsping orcl (failed)
7.4 already disabled all firewalls (domain, private and public) on oracle server.
There shouldn't be any issues with firewalls or ports.
No matter what I do, I just can't connect from the client machine. Can someone tell me what I'm doing wrong? As a side note, I was not able to install Oracle 12c on Win2012R2. So I installed on a Win7x64. But eventually
all the VM's will run on Windows Server 2012R2. This setup is my home lab.
Thank you!
replaced "localhost" with the oracle sserver IP
It looks like the listener is only listening on localhost (127.0.0.1); you can confirm that with lsnrctl status, or with netstat -an | find "1521" (or your actual port number if you aren't using the default).
It isn't listening on the server's external IP address, so when you try to connect to post 1521 (or whatever you have configured) on that IP there is nothing there listening - which is why you get "no listener found".
You need to modify your listener.ora to either listen to both localhost and the server IP address, or to only listen to the external address. But the latter has side-effects - your existing connections and tnsnames.ora entries would need to change to refer to that address (or, even if it is static, a DNS name that resolves to that address), and your database may need to be modified so it knows the listener address to register against, via the LOCAL_LISTENER initialisation parameter. After changing the listener.ora you will need to bounce the listener, and you can then check netstat again.

Resources