Re: How can I connect to MySQL?



Thank you so much for your recomendation of this ODBC tool. I think I'll try
that later. However, I'm using MySQL API to connect database under C++.
Right now, I've got the reason: User to remote access MySQL should be
priviledged, i.e. user table should be changed: host field should be "%"
rather than "localhost" which is for local machine connection.

--

Best regards.

Susan
"Kurt Grittner" <grittkmg_NO_SPAM_@xxxxxxxxxxx> wrote in message
news:861rc11omc5l3m4d6gl1h9fdejl4dm6uhe@xxxxxxxxxx
> Hi Susan,
>
> Use this:
>
> http://dev.mysql.com/downloads/connector/odbc/3.51.html
>
> Then hook it up like this, for example (An example for using MSAccess)
>
> To get the MyODBC working in Windows you do the following:
> Download MyODBC and run the Setup
>
> In the Windows control panel pick ODBC Data Sources (32 bit)
> Click on System DSN tab and click 'Add...' Pick MySQL from the list
> and click 'Finish'
>
> Fill in the configuration screen. Mine is: mydbname, 192.168.1.nn,
> mydbname, User, password (the rest is left blank)
>
> The 'User' and 'password' from the previous step must have been setup
> in Privileges using phpMyAdmin or something similar
> Load the Access database
>
> If a table definition has changed, you must delete (the attachment),
> and re-attach to it in MyODBC for the new table def. to be seen. If
> you load my database, then all of the attachments will be wrong, so
> you can delete them all.
>
> Re-attach tables by doing: File, Get External Data, Link Tables...
>
> Drop down the 'Files of Type' combo box and pick 'ODBC Databases'
> Click on the 'Machine Data Sources' tab of the 'Select Data Source'
> Dialog
>
> Double-click the 'mydbname' data source
> Select All the tables (or only those which have changed) and click OK
>
> The tables you picked will re-appear in the tables section of Access
> with a big black arrow pointing to them (which indicates they are
> attached, and not actual tables) Now you can use these tables like
> they were part of Access
>
> Hope this helps,
> -Kurt
>
> On Thu, 7 Jul 2005 17:25:55 +0800, "Susan Kong" <susan@xxxxxxxxxxxxxx>
> wrote:
>
> >Hi,there,
> >
> >I have no way to connect to MySQL database which is setup on Linux with
> >statement below in my MFC application.
> >
>
>mysql_real_connect(MyData,"202.44.131.11","username","password","dbname",MY
S
> >QL_PORT,NULL,0)
> >
> >However, I can connect to MySQL database which is set up on Windows.
> >
> >What's the possible problem? BTW, I use libMySQL.lib and libMySQL.dll
when
> >connecting.
>


.



Relevant Pages