Question:
Mysqsl database question?
2010-09-17 23:25:05 UTC
If I have a website on a dedicated server and a sql base somewhere else would it still connect to the other database? And how would I connect the to I know localhost is if its on the main computer your using the website on but I am forced to use IIS and I can only install website and no database so is it possible to make these 2 connect?
Three answers:
TheMadProfessor
2010-09-20 09:12:08 UTC
As long as you have the proper connection string (including any userid and/or password), then they can connect. Just be aware that if you use a server-side script to connect to the database and pass results back, it has the potentieal to be slow since you will be not only have transmission time between your client and dedicated server but also the dedicated server and the database. If you can handle the database requests on the client side, you eliminate one link.
Transformer
2010-09-18 03:36:02 UTC
Install MySQL ODBC connector



Pl go to MySQL Reference Manual

Example:



*/

//Connection string for MyODBC 3.51

string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +

"SERVER=localhost;" +

"DATABASE=test;" +

"UID=venu;" +

"PASSWORD=venu;" +

"OPTION=3";



//Connect to MySQL using MyODBC

OdbcConnection MyConnection = new OdbcConnection(MyConString);

MyConnection.Open();



Console.WriteLine("\n !!! success, connected successfully !!!\n");
thebig_a_27
2010-09-17 23:42:45 UTC
yes, you can connect to a mysql server anywhere in the world, you just use it's IP address or hostname in place of localhost.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...