0

I would like to connect to a MySql data base using c#, but then I need a connection string wich looks like this.

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

I hosted the database at a web host, but what should I put at the "Server="? Do I have to put the ip from my website? I have no idea how to do this.

Michael
  • 50
  • 8
Gewoo
  • 437
  • 6
  • 19

1 Answers1

0

I would use the full domain name of the server. The IP should work too. You may need to include the port. Port 3306 is the default MySql port. This information should be provided by the hosting service. Most likely found in the remote admin tool provided by the web host.

here are other resources to:

https://www.connectionstrings.com/mysql/

How to connect to MySQL Database?

example: http://www.codeproject.com/Articles/71346/Connecting-to-MySQL-Database-using-C-and-NET

Community
  • 1
  • 1
Michael
  • 50
  • 8