Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MySQL How do I enumerate a list of servers

Posted on 2013-06-24
4
Medium Priority
?
469 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
  • 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

Independent Software Vendors: 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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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…
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 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