NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up Teststand and MySQL

Hi All,

I am learning how to configure a MySQL database to work with Teststand.

 

Windows 7,TS 2017, MySQL V5.7, ODBC V5.3.

 

So far I have:

 

Install MySQL server and ODBC driver.

Created a new database using MySQL workbench.

 

Now I am trying to connect test stand to the database. Under the results processing options I have tried to configure the database settings to work with mysql database.

 

The "Test Connection" return a successful test but I cant populate the database with any tables or fields using the inbuilt MySQL Schema.

 

Should I be using a Schema to add my tables and fields to the database or create them through the actual database software (workbench)? 

 

How do I start to log test results to my database?

 

Thanks

Database Options.pngdatabase error.png

 

 

 

 

 

0 Kudos
Message 1 of 14
(5,669 Views)

You need to make sure the tables exist in your database. You should be able to do it automatically by running the output when you click the "Build .sql File" button in the Schema tab.

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
Message 2 of 14
(5,646 Views)

Hi WireWeaver,

 

I have tried to generate the .sql file but it produces the exact same error message I get from validating and attempting to add the entries into the database from the schema.

 

I know the databse is running, the test connection reports a successful test but for some reason test stand does not want to communicate with the database.

 

Quite frustrating for a beginner, any more ideas?

 

Thanks

 

0 Kudos
Message 3 of 14
(5,637 Views)

Hmm... Are there any existing tables in the database that might cause a conflict?

 

There are also pre-built .SQL files located here:

C:\Program Files\National Instruments\TestStand <version>\Components\Models\TestStandModels\Database.

 

There should be one called MySQL Drop Result Tables.sql and MySQL Create Insert Result Tables.sql.

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 4 of 14
(5,630 Views)

I have managed to create a results table using the .sql files found at

 

C:\Program Files\National Instruments\TestStand <version>\Components\Models\TestStandModels\Database

 

I opened the file using MySQL workbench and ran the script to populate the tables.

 

I still cant connect teststand to the database. Any more ideas? running out of hope now.

 

Thanks

0 Kudos
Message 5 of 14
(5,595 Views)

Hi Andy,

I'm in the same situation:

- Windows 7 (64bit)

- TestStand 2014 (64bit)

- MySQL ODBC 5.3 Unicode (64bit)

 

As WireWeaver told you, you need to recreate the same structure of your TS schema also on the database you want to use.

Once done you shuld get an error free validation.

 

Schema correctly configuredSchema correctly configured

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I created my own schema from scratch, set up the connection with database and manged to view the whole structure with TestStand DatabaseViewer.

 

 Database ViewerDatabase Viewer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

But when I try to view records in the table, by right clicking it and selecting "View Data", I get this error:

 

Error I getError I get

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I googled around and many people say it's probably due to a mismatch between the version of the ODBC connector and the application that uses it; for example a 64bit application should use the 64bit version of the connector (and vice versa).

 

However I'm stuck at this point because I'm using correct versions of connector and application but I continue to get this error...

Any ideas....?

 

 

 

0 Kudos
Message 6 of 14
(5,527 Views)

Hi TondelliM,

 

I am in the exact same position as you. I did everything you did and still cant view the data in the database viewer. Get the same error message.

 

I am a member of the SSP so have asked for some dedicated support from NI. I will let you know what is wrong when they get back to me.

 

Thanks

0 Kudos
Message 7 of 14
(5,516 Views)

 

After reading through my emails I have a sokution from NI support.

 

They pointed me towards this fix:

 

How to setup MySQL server - Discussion Forums - National Instruments https://forums.ni.com/t5/NI-TestStand/How-to-setup-MySQL-server/td-p/3265825

 

If you look at the very last reply there is a "Connection String Expression".

 

You have to delete the connection string expression TestStand uses when you select MySQL and enter your own like below.

 

"Driver={MySQL ODBC 5.3 ANSI Driver};Server=127.0.0.1;Database=test_results;User=Andy;password=XXXX"

 

Make sure the ODBC data source you have set up is the same as the one in the string! (MySQL ODBC 5.3 ANSI Driver) was the one I was using.

 

Personally I think this is a bug in the TestStand software. MySQL is touted as being a standard database connection ready to use out the box along with MS Access and MS Server. If this is so, how come we are having to modify the string to get it to work!

 

Very disappointed with this, I have wasted so much time trying to get this to work. I have to give credit to the NI support for looking into this though. Cant help but wonder if your not a member of the SSP who would have looked at this for us? At the mercy of the NI forums I suspect.

 

Hopefully it works for everyone else who has the same issue.

 

Connection String Expression.png

Message 8 of 14
(5,512 Views)

Ciao AndyTT,

thank you very much for the hint, now I'm able to view records in database!

 

I was using the "Build.." button to compose my connection string, but it was generating the wrong string...!

0 Kudos
Message 9 of 14
(5,507 Views)

AndyTT,

 

I'm sorry you had a bad experience trying to get our database logging working, but I'm glad our support team was able to help!

We also have a help topic on building connection strings that we hope would be able to help in the case that someone doesn't have SSP. For reference that can be found here:

http://zone.ni.com/reference/en-XX/help/370052W-01/tsref/infotopics/dbviewer_connectionstrings/

 

TondelliM,

What settings did you have entered in the build UI to generate the connection string? I want to make sure there isn't a bug in the string generation.

 

Thanks,

Kevin Flanagan

Produce Support Engineer | Automated Test Software R&D

National Instruments

0 Kudos
Message 10 of 14
(5,495 Views)