Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB MySQL VB.NET databse
hi all
 
i want connect to online mysql database ...
 
i have this information :
 

PHPmyAdmin url like : 172.53.162.40/phpmyadmin (this is a url that i access all database
also user and pass for enter to this domain like:
 User1 And Password1
 
database name : mygem
database user : uuu
password      : ppp
:::: NOW :::
 
and my host supporter say : not exists any port for access my database ...
i used from below code for connection string
 
string con="Server=172.53.162.40/phpmyadmin;Database=mygem;Uid=uuu;Pwd=ppp;";
 
but error accured ad say : can't connect to mysql host ....
 
How I Create Connection String For Connect to This Database ?
please help me
 
thanks a lot
Posted 9-Feb-13 11:00am
Comments
20061967 at 9-Feb-13 17:28pm
   
Hope you have the database hosted in one of the ISP and you are trying to connect from your local windows application from your PC ?
 
It could be some times the ISPs would not allow connectivity from out side domain and will let you to connect from only their own domain space. could this be the reason why you are getting the "not exists any port for access my database" message ?
Sergey Alexandrovich Kryukov at 26-Feb-13 19:52pm
   
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Check http://www.connectionstrings.com/mysql[^], where you have examples how to compose conn. string for MySql.
Also make sure, you are using suitable solution, how to connect to MySQL from .NET - MySQL .NET connector[^].
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

There are few options and what is your requirement to have the remote server and connect from local windows applicaiton ? this is going to slow down your system ?
 

Option 1: l you may have to shop around for any providers who will enable remote access
 
Option 2: You can have your own dedicated server with the ISP so that you can have remote connectivity and this is expensive compared to option 1 which is shared server.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

First of All you need to Download the MySQL odbc driver 3.51 driver from MySQL website if you are using MySQL. Then you need to enable Remote MySQL Access from your domain or website using your CPANEl Account...
 
You then use the MySQL ODBC 3.51 Driver to connect to your Remote Database using a Connection String from your VB.Net or C# Application.
 
Use this connection string
 
Server=myServerAddress;Database=mydbfile;Uid=myUsername;Pwd=myPassword;
 
myServerAddress website or domains address eg.www.yahoo.com
mydbfile is the name of the database you have created on you cpanel account that you have allowed remote access to and
myUsername and myPassword are the username and password that you will use to connect to your remote mysql Database...
 
For MS Access you can connect to your uploaded Access Database using an OLEDB connection .
For instance if your website is http://www.yahoo.com/db/mydbfile.mdb then you can use the Microsoft.Jet driver with this Connection String below; You need to Specify the password of your database if you have any...
 
Dim DatabaseFile as string = ????
Dim connection_builder As New OleDb.OleDbConnectionStringBuilder
connection_builder = New OleDb.OleDbConnectionStringBuilder
connection_builder.DataSource = Me.mydbfile
connection_builder.Provider = "Microsoft.Jet.OLEDB.4.0"
connection_builder.Add("Jet OLEDB:Database Password", Password)
Return New Data.OleDb.OleDbConnection(connection_builder.ConnectionString)
 
That's it.. In Case you still have problems let me know...
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 520
1 Maciej Los 290
2 Richard MacCutchan 265
3 BillWoodruff 265
4 Suraj Sahoo | Coding Passion 155
0 OriginalGriff 8,764
1 Sergey Alexandrovich Kryukov 7,437
2 DamithSL 5,639
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411028.1 | Last Updated 17 Mar 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100