Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am developing a desktop application that will connect to server database and do CRUD operations.

The database is MySQL on some hosting.

Implemented test application with MySql.Data. The problem is that the server name is localhost, which conflicts with my computer localhost.

Here is info about the server:
VB
Database server

Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.6.22 - MySQL Community Server (GPL)
Protocol version: 10
User: user@localhost
Server charset: UTF-8 Unicode (utf8)


Always get that I am unable to connect to server or connecting to my PC localhost.
So could you give my any ideas to connect to that server?!
Posted
Comments
Richard MacCutchan 1-Feb-15 11:35am    
Please show the exact connection string and the exact error message.
Zhivko Kabaivanov 1-Feb-15 12:36pm    
This is the connection string: "Server=localhost;Database=database;Uid=user;Pwd=pas;"
The exception says: Unable to connect to any of the specified MySQL hosts.
with number 1042
Zoltán Zörgő 1-Feb-15 14:13pm    
Ok but can you conect with any other tool (GUI, command line) from the same machine to the same server with the same parameters?
There are some other parameters you might need. See: https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/
Zhivko Kabaivanov 2-Feb-15 5:01am    
Also error with GUI or command line.
Zoltán Zörgő 2-Feb-15 5:34am    
Are you sure your DB engine is running?

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