Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MySQL How do I enumerate a list of servers

Posted on 2013-06-24
4
Medium Priority
?
458 Views
Last Modified: 2013-06-25
I have to convert a VB 2010 application from SQL Server to MySQL. One thin this program does the first time it run is to check for a SQL installation. If it does not fine one it then installs SQL Server. I need that to happen with MySQL, So my question is what is the MySQL equivalent to System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources.

Thanks
Art
0
Comment
Question by:Nashua58
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 39274049
GetDataSources return visible SQL Server instances in the whole network, do u want to do the same with MySql?
or just look for the client machine and if no instance is running then install MySql?
0
 

Author Comment

by:Nashua58
ID: 39274460
Hi Sedgwick

I would really like just the client machine.

Thanks
0
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 total points
ID: 39274466
string query = "SELECT * FROM Win32_Product WHERE Name LIKE '%MySQL%'";

            var s = new ManagementObjectSearcher("root\\CIMV2", query);
            foreach (ManagementObject service in s.Get())
            {
                // show the instance 
                Console.WriteLine(service.ToString());

            } 

Open in new window

0
 

Author Closing Comment

by:Nashua58
ID: 39276619
Thank you so much this is just what I was looking for. Out of curiosity how would you accomplish this if you were looking over the entire network?

Art
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question