Jump to content

Recommended Posts

Posted

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

Posted

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

Posted
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

Posted
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).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...