Discussion:
Error while connecting to MySQL database using DSN
(too old to reply)
user_1
2007-06-29 02:10:07 UTC
Permalink
Hi All,
 
I have some problems with connecting to the MySQL database.
 
I have created the dsn as follows..
from control pannel,odbc connection..then user dsn filled in the computer name,username,pwd and db name
Connect option and advanced option(the next two tabs) i havent filled anything.
as i have installed mysql in mypc and so its a local host.Test connection also successful.
 
But i was getting an error when i was trying to open the connection.
using open connection.vi.
 
In the open connection.vi. i gave the dmu.dsn(the name of dsn i created ) for connection information parameter,for userid ,user name to MySQL which is root and the appropriate password also(i tried both wth giving user name and password and also without giving username and password.)
 
TRied by creating user dsn and also system dsn and establishing connection.But i was getting the following error.
 
the error is...
Error -2147467259 occurred at DB Tools Open Connec (String).vi->DB Tools Open Connec (Path).vi->Untitled 1Possible reason(s):Exception occured in Microsoft OLE DB Provider for ODBC Drivers: General error: Invalid file dsn 'dmu.dsn' in DB Tools Open Connec (String).vi->DB Tools Open Connec (Path).vi->Untitled 1
 
 
Can anybody help me?
 
 
 
user_1
2007-06-29 03:40:14 UTC
Permalink
Thank u sir and sorry for the disturbance caused by my repeted question.
 
I managed to connect to mysql database without using dsn.I created a text file which contains information about the driver,database,server,uid and password and i fed to the connection information of the db tools open connection.vi.the contents from the text file.
Its working and nw can interact with the database.
 
But i will surely try with the File dsn also so if a need arises,i can manage and i can learn a new method also.
 
Thank you so much
 
user_1
2007-06-29 09:10:09 UTC
Permalink
Hello again..
 
I tried by creating file dsn. i tried to create file dsn,as follows..
selected file dsn tab,added MySQL ODBC 3.51 driver,gave the name data to the dsn theh while entering the login information i entered login info ,i gave localhost for servername,root for user name and the password also.It did not allow me to select(the list was empty) the database name as it was giving me the eeror-loading database list not implemented for sql driver connect.Then i clicked ok after typing the database name in the box.After that when i opened the dsn the password column was empty.
 
When i used the dsn with DB tools open connection.vi it gave me the following error...
 
Error -2147467259 occurred at DB Tools Open Connec (String).vi->DB Tools Open Connec (Path).vi->connecttomysql.vi
Possible reason(s):Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [MySQL][ODBC 3.51 Driver]Access denied for user <a href="mailto: root @ localhost" target="_blank">'root'@'localhost'</a> (using password: NO) in DB Tools Open Connec (String).vi-&gt;DB Tools Open Connec (Path).vi-&gt;connecttomysql.vi
&nbsp;

But for system dsn and user dsn i could complete all information and test connection was also successful.But i need to create a file dsn as both system dsn and user dsn wont work wth DB tools open connection.vi
&nbsp;
Pls help me regarding this.
user_1
2007-06-29 10:40:08 UTC
Permalink
ok Thanksss a lot...
But the test connection was successful for user dsn and system dsn and in that cases the database names were also appearing.
But i think labview can deal with file dsn only as the user dsn and system dsn were giving me errors.
Thats why i tried to create file dsn.Dont know what is happening.
Any way i tried to establish a connection wthout using dsn by giving connection information of the DB tools connect as follows
DRIVER=MySQL ODBC 3.51 Driver; DB=dmu; server=Localhost; UID=root; PWD=pwd; OPTION=785
it can connect to my sql.But when executing query i have specify the database name also along with the table name
say....select * from dmu.tab1(tab1 be the table name)So i &nbsp;changed to Data Source Name instead of DB but still the same.
So any way i have to create file dsn.
I will check the Driver installation is proper as told by u,once again.And if not if possible can u send me the working one pls?
Thanks once again
&nbsp;

Continue reading on narkive:
Loading...