How can I access to a database on OpenShift?


I created an application on OpenShift, everything is working and there are no problems. I now need to attach the database that is on OpenShift with my desktop application developed in C #. The desktop application only needs to read the data that we have within the database tables and nothing else. On the net I found no tutorial related to OpenShift and so I ask here if anyone has had experience in this regard.

The connection to the application of OpenShift is performative as a key complementary and do not know if this can create problems. Can someone show me a simple example?

I know does not provide aid of this kind, but I just want to figure out how to connect my desktop application to the online database hosted on OpenShift and nothing else, how could I do?

string connStr = @";Port=8000;Database=test;Uid=adminxxJ;Pwd=FxxxBdL;";
        MySqlConnection conn = new MySqlConnection(connStr);

            Console.WriteLine("Connecting to MySQL...");
            Console.WriteLine("Connection successfull !");

        catch (Exception ex)
            Console.WriteLine("Eccezione =>  " + ex.ToString());

on conn.Open() is returned this exception:

Eccezione => MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. in MySql.Data.MySqlClient.NativeDriver.Open() in MySql.Data.MySqlClient.Driver.Open() in MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) in MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() in MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() in MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() in MySql.Data.MySqlClient.MySqlPool.GetConnection() in MySql.Data.MySqlClient.MySqlConnection.Open()

asked on Server Fault Aug 9, 2015 by J.Doe • edited Aug 9, 2015 by J.Doe

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0