title: SQLCODE=-1042ect: [IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004
body: <p>I am trying to connect to the Db2 database on Cloud using Python.</p>
  <pre><code>dsn_hostname = &quot;..&quot; 
  dsn_uid = &quot;..&quot;       
  dsn_pwd = &quot;..&quot;      
  
  dsn_driver = &quot;{IBM DB2 ODBC DRIVER}&quot;
  dsn_database = &quot;..&quot;            
  dsn_port = &quot;..&quot;                 
  dsn_protocol = &quot;TCPIP&quot;            
  dsn_security = &quot;SSL&quot;
  
  
  
     dsn = (
      &quot;DRIVER={0};&quot;
      &quot;DATABASE={1};&quot;
      &quot;HOSTNAME={2};&quot;
      &quot;PORT={3};&quot;
      &quot;PROTOCOL={4};&quot;
      &quot;UID={5};&quot;
      &quot;PWD={6};&quot;
      &quot;SECURITY={7};&quot;).format(dsn_driver, dsn_database, dsn_hostname, dsn_port, dsn_protocol, dsn_uid, dsn_pwd,dsn_security)
  
  try:
      conn = ibm_db.connect(dsn, &quot;&quot;, &quot;&quot;)
      print (&quot;Connected to database: &quot;, dsn_database, &quot;as user: &quot;, dsn_uid, &quot;on host: &quot;, dsn_hostname)
  
  except:
      print (&quot;Unable to connect: &quot;, ibm_db.conn_errormsg() )
  </code></pre>
  <p>But,I am getting this error-:</p>
  <p>SQLCODE=-1042ect:  [IBM][CLI Driver] SQL1042C  An unexpected system error occurred.<br />
  SQLSTATE=58004</p>