-3

i am a student at computer science, i have made a project in c# that uses mysql for the database. now it's almost ready for deployment but i cant figure it out how to access the database stored on my computer from another device over the internet. i need a noob guide, what should i change?

string connection = "datasource=localhost;port=3306;username=root;password=123456";
MySqlConnection myConn = new MySqlConnection(connection);

i have used mysql workbench to manipulate the database. thank you very much. and sorry for my english.

Spiri
  • 21
  • 3
  • How can it almost be ready for Deployment if you cannot access the Database – David B Mar 13 '15 at 11:43
  • This may help: http://stackoverflow.com/questions/14801948/how-to-connect-to-mysql-using-c – David B Mar 13 '15 at 11:45
  • The problem is that your database is located on your computer and not on a server designed to handle remote calls to the database. Either you need to do like David Soussan said, or you need to use a remotely hosted MySQL server, and connect to that one. -1 because this is something you should have been thought on your computer science studies, or should have read up on before using SQL for remote calls. – WIMP_no Mar 13 '15 at 11:49
  • i can access it from my laptop and it works flawless all that i need now is to access it from another laptop. sorry maybe i am a little to rushed. – Spiri Mar 13 '15 at 11:54

1 Answers1

0
  1. Get a static IP address for your internet connection.
  2. Open port 3306 on your firewall.
  3. Change the datasource in the connection string to the IP address of your internet connection.
David Soussan
  • 2,698
  • 1
  • 16
  • 19