Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to retrieve data from remote mysql database into c# window application. I user mysqlconnector , i works perfectly on local database. when i use same config to remote host database, showing message "cannot connect to database". any one know what is the problem?

Thank You Everyone!
Posted
Comments
Sushil Mate 27-Jun-13 8:50am    
can you share your connectionstring? the problem might be lies in the connectionstring.
sjelen 27-Jun-13 9:49am    
The problem can be anywhere form network connectivity issue, remote database configuration to local connection string.
Try to ping remote host to see if network is OK.
Are you able to connect to remote database using MySQL admin tools?
Does the database you're trying to connect to allow remote connections?
Check IP/hostname and credentials in your connection string, user and password might be different for remote database.
Victor Rene 30-Jun-13 6:50am    
I have done this many times. Check network as sjelen stated. If connection string and network are OK, then you might have a permission problem. What you should test is to allow anyone to access the database/table. Once it works you can reduce permission levels. Also check this: http://wiki.phpmyadmin.net/pma/user_management.
Nagesh Reddy 16-Jul-13 6:07am    
thank you for ur response! actually i tried using free version of domain and database. that db dont have permissions to read...

1 solution

1- Check the ports is open in firewall
2- goto to table mysql.users and check:
user has '%' value in Host column
3-execute "flush privileges"
 
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