Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have purchased a web domain and I got these credentials

Host: mywebsite.com.mysql
Database: database name
Username: username
Password: password

I also downloaded the MYSQL database connector
I created a simple table using PHPMyAdmin(provided by the webserver) and I tried writing a simple C# program to connect to the database. But it threw an exception saying
"Unable to connect to any of the specified MYSQL hosts"
Note that I don't know what my server's name is. (I tried the hostname as the server name but same exception).
Posted
Comments
Bala Selvanayagam 3-Nov-11 8:11am    
Can you please post your connection string for me and also hope that the host is running on linux platform ?

also,please check

The default port number for the MySql Server is 3306 and you may have to make sure that this port is not blocked in your firewall

Give the Database name,user id,password in the connection strings(Webconfig file)
 
Share this answer
 
Check Your Connection String Again................

1)Install MysqlQuery Browser on Your Local machine To Check Connection With database...
 
Share this answer
 
Comments
Megha Sandesh 3-Nov-11 10:54am    
I installed the browser and tested the connection and it failed. So I tried to ping the server and that too timed out. Any suggestions?
_Tushar Patil 4-Nov-11 0:51am    
If server is on local Machine Check the the server is started or not..?
Check The Server is Started or not if not manually start the server and than try to connect.

Use SqlDataSource Control.by using this you can easily connect to ur server to find the connection string
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900