Subscribe Bookmark RSS Feed

How do I get the list of the databases available on a designated MySQL server via JSL?

curtisn_

Community Trekker

Joined:

Jan 16, 2015

I know this is information exists based on the GUI driven process of connecting to a server; however, I don't know if it's possible to do with JSL.  I'm basically looking to get an array/list of database names so I that can loop through each name, create a connection, and extract my specified table fields.

Thanks

2 REPLIES
briancorcoran

Joined:

Jun 23, 2011

This is specific to MySQL.  On some databases, you would use EXEC sp_databases . Anyway, you could do something like the syntax below.  This will return the list in a JMP table.  You will then have to query the cells of the table to get the individual database names.

dt =Open Database ("DSN=MySQL Server;SERVER=mysql.ip.com;UID=MyUserID;PWD=MyPassword", "SHOW DATABASES", "DB List");

Brian Corcoran

JMP Development

curtisn_

Community Trekker

Joined:

Jan 16, 2015

Thanks Brian.