![]() |
|
C#, connect to MySQL database - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: C#, connect to MySQL database (/Thread-C-connect-to-MySQL-database) Pages:
1
2
|
C#, connect to MySQL database - Skryptec - 11-18-2016 Hello, I've installed the MySql.ConnectorNET.Data package and even some others to test. Code: MySql.Data.MySqlClient.MySqlConnection conn;
string myConnectionString;
myConnectionString = "server=sql212.ihostfull.com;uid=uoolo_lolno;" +
"pwd=lolno;database=uoolo_lolno_test;";
try
{
conn = new MySql.Data.MySqlClient.MySqlConnection();
conn.ConnectionString = myConnectionString;
conn.Open();
MessageBox.Show("This shit finally working.");
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
MessageBox.Show(ex.Message);
}Problem is, it doesn't work. It returns this error. Code: Unable to connect to any of the specified MySQL hosts.Does anyone know how to fix it? I literally copied it from here and it doesn't work. https://dev.mysql.com/doc/connector-net/en/connector-net-programming-connecting-open.html RE: C#, connect to MySQL database - Pikami - 11-18-2016 (11-18-2016, 04:32 PM)Skryptec Wrote: Hello, Everything seems ok. Does the mySQL server allow your user to access it from your ip address? RE: C#, connect to MySQL database - Skryptec - 11-18-2016 (11-18-2016, 04:37 PM)Pikami Wrote:(11-18-2016, 04:32 PM)Skryptec Wrote: Hello, Do you mean Remote MySQL Access? RE: C#, connect to MySQL database - Pikami - 11-18-2016 (11-18-2016, 04:38 PM)Skryptec Wrote:(11-18-2016, 04:37 PM)Pikami Wrote:(11-18-2016, 04:32 PM)Skryptec Wrote: Hello, Yeah. Some hosting providers disallow remote access to MySQL, some of them require you to white-list your ip for remote connections RE: C#, connect to MySQL database - Skryptec - 11-18-2016 (11-18-2016, 04:41 PM)Pikami Wrote:(11-18-2016, 04:38 PM)Skryptec Wrote:(11-18-2016, 04:37 PM)Pikami Wrote: Everything seems ok. Fuck me, man. Do you know any free host that allows that RE: C#, connect to MySQL database - Pikami - 11-18-2016 (11-18-2016, 04:43 PM)Skryptec Wrote:(11-18-2016, 04:41 PM)Pikami Wrote:(11-18-2016, 04:38 PM)Skryptec Wrote: Do you mean Remote MySQL Access? Sadly - No I do not. Most of the free hosting companies disallow remote access to MySQL, and that's not the only limitation. The best thing to do is to rent some VPS or pay for webhosting, it does not cost that much. But if you don't want to spend money you can always make a PHP API that handles the requests and manages the database. RE: C#, connect to MySQL database - Skryptec - 11-18-2016 (11-18-2016, 04:51 PM)Pikami Wrote:(11-18-2016, 04:43 PM)Skryptec Wrote:(11-18-2016, 04:41 PM)Pikami Wrote: Yeah. Some hosting providers disallow remote access to MySQL, some of them require you to white-list your ip for remote connections Problem is, I'm bad at PHP RE: C#, connect to MySQL database - Pikami - 11-18-2016 (11-18-2016, 04:52 PM)Skryptec Wrote:(11-18-2016, 04:51 PM)Pikami Wrote:(11-18-2016, 04:43 PM)Skryptec Wrote: Fuck me, man. Do you know any free host that allows that I could help you out if you want... RE: C#, connect to MySQL database - Skryptec - 11-18-2016 (11-18-2016, 04:54 PM)Pikami Wrote:(11-18-2016, 04:52 PM)Skryptec Wrote:(11-18-2016, 04:51 PM)Pikami Wrote: Sadly - No I do not. Please DM me. RE: C#, connect to MySQL database - fuhrer - 11-18-2016 I could make an sql server for you, I somehow like you, so just ask me for a server and I will dedicate part of mine to you |