Developer Posted August 18, 2010 Posted August 18, 2010 Below is the code I am using to connect : private void Initialize() { server = "http://thefarmersmarketplace.heliohost.org"; database = "khemkas_social"; userName = "Something"; //changed for security reasons. password = "something"; string connectionString; connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + userName + ";" + "PASSWORD=" + password + ";"; connection = new MySqlConnection(connectionString); } However, I am not able to connect to the database. What should the server be. I am doing anything wrong Quote
Derek Posted August 18, 2010 Posted August 18, 2010 If the code is hosted on the server, you should be using "localhost" as the server. Otherwise, you're might want to use "stevie.heliohost.org" or "216.218.192.170". I'm not sure if you need to include "http://" at the beginning of the server address, so try without "http://" first. If that doesn't help, just add it in to see if it helps. I hope I was clear, ~Derek Quote
Developer Posted August 18, 2010 Author Posted August 18, 2010 If the code is hosted on the server, you should be using "localhost" as the server. Otherwise, you're might want to use "stevie.heliohost.org" or "216.218.192.170". I'm not sure if you need to include "http://" at the beginning of the server address, so try without "http://" first. If that doesn't help, just add it in to see if it helps. I hope I was clear, ~Derek Hey, I tried your solution. now i get this : Access denied for user 'khemkas_root'@'nusnet-213-192.dynip.nus.edu.sg' (using password: YES)". Why does it add things after @. I never added them. below is the code private void Initialize() { server = "stevie.heliohost.org"; database = "khemkas_social"; userName = "khemkas_root"; password = "something"; string connectionString; connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + userName + ";" + "PASSWORD=" + password + ";"; connection = new MySqlConnection(connectionString); } thanks Quote
Derek Posted August 18, 2010 Posted August 18, 2010 Hey, I tried your solution. now i get this : Access denied for user 'khemkas_root'@'nusnet-213-192.dynip.nus.edu.sg' (using password: YES)". Why does it add things after @. I never added them. The error is saying that the user "khemkas_root" at (<--- That's why there's an @ sign) the server "nusnet-213-192.dynip.nus.edu.sg". Did you use localhost? Usually if you use localhost, the server is "localhost". If you didn't, your sql user might not have been "added" to your database. You can do that in the MySQL wizard in your cPanel. Also, if your C# program isn't located on the Heliohost server, then you could try adding the IP address of where the C# program actually is in your MySQL Remote Access list (in your cPanel). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.