Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
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
Updated 3-Apr-17 3:44am
Comments
Bala Selvanayagam 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 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

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[^].
 
Share this answer
 
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.
 
Share this answer
 
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...

VB
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...
 
Share this answer
 
v2

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